md/bitmap: use proper accessor macro
authorNamhyung Kim <namhyung@gmail.com>
Thu, 9 Jun 2011 01:42:57 +0000 (11:42 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 9 Jun 2011 01:42:57 +0000 (11:42 +1000)
Use COUNTER()/NEEDED() macro instead of open-coding them.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/bitmap.c

index 7fc028f9701e4b128b4e61ff2a3e97de18f94e10..663e6051bbad1b169203c6d533a7de96c57af336 100644 (file)
@@ -1408,7 +1408,7 @@ int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sect
                        return 0;
                }
 
-               if (unlikely((*bmc & COUNTER_MAX) == COUNTER_MAX)) {
+               if (unlikely(COUNTER(*bmc) == COUNTER_MAX)) {
                        DEFINE_WAIT(__wait);
                        /* note that it is safe to do the prepare_to_wait
                         * 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
                        sysfs_notify_dirent_safe(bitmap->sysfs_can_clear);
                }
 
-               if (!success && ! (*bmc & NEEDED_MASK))
+               if (!success && !NEEDED(*bmc))
                        *bmc |= NEEDED_MASK;
 
-               if ((*bmc & COUNTER_MAX) == COUNTER_MAX)
+               if (COUNTER(*bmc) == COUNTER_MAX)
                        wake_up(&bitmap->overflow_wait);
 
                (*bmc)--;