diff options
author | NeilBrown <neilb@suse.de> | 2011-12-22 18:17:50 -0500 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-12-22 18:17:50 -0500 |
commit | 2e61ebbcc45438899235d7a39f17291cb24e746c (patch) | |
tree | 9d12a2a641c9980fb08f704449631d8012db0686 /drivers/md | |
parent | 506c9e44a85f6a79fc0643f2d2498ab6cda3d3f8 (diff) |
md/bitmap: daemon_work cleanup.
We have a variable 'mddev' in this function, but repeatedly get the
same value by dereferencing bitmap->mddev.
There is room for simplification here...
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/bitmap.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 6d03774b176e..048eec751474 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -1149,12 +1149,12 @@ void bitmap_daemon_work(struct mddev *mddev) | |||
1149 | return; | 1149 | return; |
1150 | } | 1150 | } |
1151 | if (time_before(jiffies, bitmap->daemon_lastrun | 1151 | if (time_before(jiffies, bitmap->daemon_lastrun |
1152 | + bitmap->mddev->bitmap_info.daemon_sleep)) | 1152 | + mddev->bitmap_info.daemon_sleep)) |
1153 | goto done; | 1153 | goto done; |
1154 | 1154 | ||
1155 | bitmap->daemon_lastrun = jiffies; | 1155 | bitmap->daemon_lastrun = jiffies; |
1156 | if (bitmap->allclean) { | 1156 | if (bitmap->allclean) { |
1157 | bitmap->mddev->thread->timeout = MAX_SCHEDULE_TIMEOUT; | 1157 | mddev->thread->timeout = MAX_SCHEDULE_TIMEOUT; |
1158 | goto done; | 1158 | goto done; |
1159 | } | 1159 | } |
1160 | bitmap->allclean = 1; | 1160 | bitmap->allclean = 1; |
@@ -1206,7 +1206,7 @@ void bitmap_daemon_work(struct mddev *mddev) | |||
1206 | * sure that events_cleared is up-to-date. | 1206 | * sure that events_cleared is up-to-date. |
1207 | */ | 1207 | */ |
1208 | if (bitmap->need_sync && | 1208 | if (bitmap->need_sync && |
1209 | bitmap->mddev->bitmap_info.external == 0) { | 1209 | mddev->bitmap_info.external == 0) { |
1210 | bitmap_super_t *sb; | 1210 | bitmap_super_t *sb; |
1211 | bitmap->need_sync = 0; | 1211 | bitmap->need_sync = 0; |
1212 | sb = kmap_atomic(bitmap->sb_page, KM_USER0); | 1212 | sb = kmap_atomic(bitmap->sb_page, KM_USER0); |
@@ -1270,8 +1270,8 @@ void bitmap_daemon_work(struct mddev *mddev) | |||
1270 | 1270 | ||
1271 | done: | 1271 | done: |
1272 | if (bitmap->allclean == 0) | 1272 | if (bitmap->allclean == 0) |
1273 | bitmap->mddev->thread->timeout = | 1273 | mddev->thread->timeout = |
1274 | bitmap->mddev->bitmap_info.daemon_sleep; | 1274 | mddev->bitmap_info.daemon_sleep; |
1275 | mutex_unlock(&mddev->bitmap_info.mutex); | 1275 | mutex_unlock(&mddev->bitmap_info.mutex); |
1276 | } | 1276 | } |
1277 | 1277 | ||