Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345713
b: refs/heads/master
c: dac1389
h: refs/heads/master
i:
  345711: 37b4f27
v: v3
  • Loading branch information
Andreas Gruenbacher authored and Philipp Reisner committed Aug 29, 2011
1 parent 34b6fd0 commit ae61d99
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 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: de696716e8c40475d259fb49b3876ca0d9415970
refs/heads/master: dac1389ccc273b5486f2931c64c8e1672f233727
3 changes: 2 additions & 1 deletion trunk/drivers/block/drbd/drbd_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,8 @@ struct drbd_conf {
struct hlist_head *tl_hash;
unsigned int tl_hash_s;

/* Interval tree of pending local write requests */
/* Interval tree of pending local requests */
struct rb_root read_requests;
struct rb_root write_requests;

/* blocks to resync in this run [unit BM_BLOCK_SIZE] */
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3473,6 +3473,7 @@ struct drbd_conf *drbd_new_device(unsigned int minor)
/* no need to lock access, we are still initializing this minor device. */
if (!tl_init(mdev))
goto out_no_tl;
mdev->read_requests = RB_ROOT;
mdev->write_requests = RB_ROOT;

mdev->app_reads_hash = kzalloc(APP_R_HSIZE*sizeof(void *), GFP_KERNEL);
Expand Down
13 changes: 10 additions & 3 deletions trunk/drivers/block/drbd/drbd_req.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,15 @@ void _req_may_be_done(struct drbd_request *req, struct bio_and_error *m)

/* remove the request from the conflict detection
* respective block_id verification hash */
if (!hlist_unhashed(&req->collision)) {
if (!drbd_interval_empty(&req->i)) {
struct rb_root *root;

hlist_del(&req->collision);
if (!drbd_interval_empty(&req->i))
drbd_remove_interval(&mdev->write_requests, &req->i);
if (rw == WRITE)
root = &mdev->write_requests;
else
root = &mdev->read_requests;
drbd_remove_interval(root, &req->i);
} else
D_ASSERT((s & (RQ_NET_MASK & ~RQ_NET_DONE)) == 0);

Expand Down Expand Up @@ -332,6 +337,7 @@ static int _req_conflicts(struct drbd_request *req)
struct hlist_head *slot;

D_ASSERT(hlist_unhashed(&req->collision));
D_ASSERT(drbd_interval_empty(&req->i));

if (!get_net_conf(mdev))
return 0;
Expand Down Expand Up @@ -493,6 +499,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
/* so we can verify the handle in the answer packet
* corresponding hlist_del is in _req_may_be_done() */
hlist_add_head(&req->collision, ar_hash_slot(mdev, req->i.sector));
drbd_insert_interval(&mdev->read_requests, &req->i);

set_bit(UNPLUG_REMOTE, &mdev->flags);

Expand Down

0 comments on commit ae61d99

Please sign in to comment.