Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346118
b: refs/heads/master
c: 71fc7ee
h: refs/heads/master
v: v3
  • Loading branch information
Andreas Gruenbacher authored and Philipp Reisner committed Nov 8, 2012
1 parent 9916ef7 commit 1ad6f87
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1b7ab15b11716d075b3dca34cf41e8d7aba3cba2
refs/heads/master: 71fc7eedb37585ab2f1bec2e615202908bd4f4b7
13 changes: 4 additions & 9 deletions trunk/drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,36 +484,31 @@ void tl_restart(struct drbd_tconn *tconn, enum drbd_req_event what)
}

/**
* tl_apply() - Applies an event to all requests for a certain mdev in the TL
* tl_abort_disk_io() - Abort disk I/O for all requests for a certain mdev in the TL
* @mdev: DRBD device.
* @what: The action/event to perform with all request objects
*
* @what might ony be ABORT_DISK_IO.
*/
void tl_apply(struct drbd_conf *mdev, enum drbd_req_event what)
void tl_abort_disk_io(struct drbd_conf *mdev)
{
struct drbd_tconn *tconn = mdev->tconn;
struct drbd_tl_epoch *b;
struct list_head *le, *tle;
struct drbd_request *req;

D_ASSERT(what == ABORT_DISK_IO);

spin_lock_irq(&tconn->req_lock);
b = tconn->oldest_tle;
while (b) {
list_for_each_safe(le, tle, &b->requests) {
req = list_entry(le, struct drbd_request, tl_requests);
if (req->w.mdev == mdev)
_req_mod(req, what);
_req_mod(req, ABORT_DISK_IO);
}
b = b->next;
}

list_for_each_safe(le, tle, &tconn->barrier_acked_requests) {
req = list_entry(le, struct drbd_request, tl_requests);
if (req->w.mdev == mdev)
_req_mod(req, what);
_req_mod(req, ABORT_DISK_IO);
}

spin_unlock_irq(&tconn->req_lock);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/block/drbd/drbd_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "drbd_req.h"

/* in drbd_main.c */
extern void tl_apply(struct drbd_conf *mdev, enum drbd_req_event what);
extern void tl_abort_disk_io(struct drbd_conf *mdev);

struct after_state_chg_work {
struct drbd_work w;
Expand Down Expand Up @@ -1319,7 +1319,7 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,

/* Immediately allow completion of all application IO, that waits
for completion from the local disk. */
tl_apply(mdev, ABORT_DISK_IO);
tl_abort_disk_io(mdev);

/* current state still has to be D_FAILED,
* there is only one way out: to D_DISKLESS,
Expand Down

0 comments on commit 1ad6f87

Please sign in to comment.