Commit 27d5ea04 authored by Namhyung Kim's avatar Namhyung Kim Committed by NeilBrown

md/bitmap: use proper accessor macro

Use COUNTER()/NEEDED() macro instead of open-coding them.
Signed-off-by: default avatarNamhyung Kim <namhyung@gmail.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 01393f3d
...@@ -1408,7 +1408,7 @@ int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sect ...@@ -1408,7 +1408,7 @@ int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sect
return 0; return 0;
} }
if (unlikely((*bmc & COUNTER_MAX) == COUNTER_MAX)) { if (unlikely(COUNTER(*bmc) == COUNTER_MAX)) {
DEFINE_WAIT(__wait); DEFINE_WAIT(__wait);
/* note that it is safe to do the prepare_to_wait /* note that it is safe to do the prepare_to_wait
* after the test as long as we do it before dropping * after the test as long as we do it before dropping
...@@ -1480,10 +1480,10 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long secto ...@@ -1480,10 +1480,10 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long secto
sysfs_notify_dirent_safe(bitmap->sysfs_can_clear); sysfs_notify_dirent_safe(bitmap->sysfs_can_clear);
} }
if (!success && ! (*bmc & NEEDED_MASK)) if (!success && !NEEDED(*bmc))
*bmc |= NEEDED_MASK; *bmc |= NEEDED_MASK;
if ((*bmc & COUNTER_MAX) == COUNTER_MAX) if (COUNTER(*bmc) == COUNTER_MAX)
wake_up(&bitmap->overflow_wait); wake_up(&bitmap->overflow_wait);
(*bmc)--; (*bmc)--;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment