diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2011-01-13 12:40:57 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-08-25 08:57:57 -0400 |
commit | 579b57ed730819970a3542b4bbcc2d4176f25c72 (patch) | |
tree | 379b7f54b595abfa7aa6db893ddf757e13625ed9 /drivers/block/drbd/drbd_worker.c | |
parent | e7fad8af750c5780143e4b6876f80042ec0c21f5 (diff) |
drbd: Magic reserved block_id value cleanup
The ID_VACANT definition has become entirely irrelevant by now.
The is_syncer_block_id() macro does not improve the code, so eliminated
it.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_worker.c')
-rw-r--r-- | drivers/block/drbd/drbd_worker.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 10438c41f559..43a9fefd29b8 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
@@ -85,8 +85,6 @@ void drbd_endio_read_sec_final(struct drbd_epoch_entry *e) __releases(local) | |||
85 | unsigned long flags = 0; | 85 | unsigned long flags = 0; |
86 | struct drbd_conf *mdev = e->mdev; | 86 | struct drbd_conf *mdev = e->mdev; |
87 | 87 | ||
88 | D_ASSERT(e->block_id != ID_VACANT); | ||
89 | |||
90 | spin_lock_irqsave(&mdev->req_lock, flags); | 88 | spin_lock_irqsave(&mdev->req_lock, flags); |
91 | mdev->read_cnt += e->size >> 9; | 89 | mdev->read_cnt += e->size >> 9; |
92 | list_del(&e->w.list); | 90 | list_del(&e->w.list); |
@@ -108,18 +106,16 @@ static void drbd_endio_write_sec_final(struct drbd_epoch_entry *e) __releases(lo | |||
108 | struct drbd_conf *mdev = e->mdev; | 106 | struct drbd_conf *mdev = e->mdev; |
109 | sector_t e_sector; | 107 | sector_t e_sector; |
110 | int do_wake; | 108 | int do_wake; |
111 | int is_syncer_req; | 109 | u64 block_id; |
112 | int do_al_complete_io; | 110 | int do_al_complete_io; |
113 | 111 | ||
114 | D_ASSERT(e->block_id != ID_VACANT); | ||
115 | |||
116 | /* after we moved e to done_ee, | 112 | /* after we moved e to done_ee, |
117 | * we may no longer access it, | 113 | * we may no longer access it, |
118 | * it may be freed/reused already! | 114 | * it may be freed/reused already! |
119 | * (as soon as we release the req_lock) */ | 115 | * (as soon as we release the req_lock) */ |
120 | e_sector = e->sector; | 116 | e_sector = e->sector; |
121 | do_al_complete_io = e->flags & EE_CALL_AL_COMPLETE_IO; | 117 | do_al_complete_io = e->flags & EE_CALL_AL_COMPLETE_IO; |
122 | is_syncer_req = is_syncer_block_id(e->block_id); | 118 | block_id = e->block_id; |
123 | 119 | ||
124 | spin_lock_irqsave(&mdev->req_lock, flags); | 120 | spin_lock_irqsave(&mdev->req_lock, flags); |
125 | mdev->writ_cnt += e->size >> 9; | 121 | mdev->writ_cnt += e->size >> 9; |
@@ -131,15 +127,13 @@ static void drbd_endio_write_sec_final(struct drbd_epoch_entry *e) __releases(lo | |||
131 | * done from "drbd_process_done_ee" within the appropriate w.cb | 127 | * done from "drbd_process_done_ee" within the appropriate w.cb |
132 | * (e_end_block/e_end_resync_block) or from _drbd_clear_done_ee */ | 128 | * (e_end_block/e_end_resync_block) or from _drbd_clear_done_ee */ |
133 | 129 | ||
134 | do_wake = is_syncer_req | 130 | do_wake = list_empty(block_id == ID_SYNCER ? &mdev->sync_ee : &mdev->active_ee); |
135 | ? list_empty(&mdev->sync_ee) | ||
136 | : list_empty(&mdev->active_ee); | ||
137 | 131 | ||
138 | if (test_bit(__EE_WAS_ERROR, &e->flags)) | 132 | if (test_bit(__EE_WAS_ERROR, &e->flags)) |
139 | __drbd_chk_io_error(mdev, false); | 133 | __drbd_chk_io_error(mdev, false); |
140 | spin_unlock_irqrestore(&mdev->req_lock, flags); | 134 | spin_unlock_irqrestore(&mdev->req_lock, flags); |
141 | 135 | ||
142 | if (is_syncer_req) | 136 | if (block_id == ID_SYNCER) |
143 | drbd_rs_complete_io(mdev, e_sector); | 137 | drbd_rs_complete_io(mdev, e_sector); |
144 | 138 | ||
145 | if (do_wake) | 139 | if (do_wake) |