aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-08-01 18:20:50 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2018-08-01 18:49:39 -0400
commite64e4018d572710c44f42c923d4ac059f0a23320 (patch)
treeaae285c6a7fa0b7566de31313683b57b38f821b2 /drivers/md/raid1.c
parent5cc9cdf631da804510d2d3ab1d97f3d9dd8d632d (diff)
md: Avoid namespace collision with bitmap API
bitmap API (include/linux/bitmap.h) has 'bitmap' prefix for its methods. On the other hand MD bitmap API is special case. Adding 'md' prefix to it to avoid name space collision. No functional changes intended. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Shaohua Li <shli@kernel.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index e9e3308cb0a7..136294139d05 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -385,10 +385,10 @@ static void close_write(struct r1bio *r1_bio)
385 r1_bio->behind_master_bio = NULL; 385 r1_bio->behind_master_bio = NULL;
386 } 386 }
387 /* clear the bitmap if all writes complete successfully */ 387 /* clear the bitmap if all writes complete successfully */
388 bitmap_endwrite(r1_bio->mddev->bitmap, r1_bio->sector, 388 md_bitmap_endwrite(r1_bio->mddev->bitmap, r1_bio->sector,
389 r1_bio->sectors, 389 r1_bio->sectors,
390 !test_bit(R1BIO_Degraded, &r1_bio->state), 390 !test_bit(R1BIO_Degraded, &r1_bio->state),
391 test_bit(R1BIO_BehindIO, &r1_bio->state)); 391 test_bit(R1BIO_BehindIO, &r1_bio->state));
392 md_write_end(r1_bio->mddev); 392 md_write_end(r1_bio->mddev);
393} 393}
394 394
@@ -781,7 +781,7 @@ static int raid1_congested(struct mddev *mddev, int bits)
781static void flush_bio_list(struct r1conf *conf, struct bio *bio) 781static void flush_bio_list(struct r1conf *conf, struct bio *bio)
782{ 782{
783 /* flush any pending bitmap writes to disk before proceeding w/ I/O */ 783 /* flush any pending bitmap writes to disk before proceeding w/ I/O */
784 bitmap_unplug(conf->mddev->bitmap); 784 md_bitmap_unplug(conf->mddev->bitmap);
785 wake_up(&conf->wait_barrier); 785 wake_up(&conf->wait_barrier);
786 786
787 while (bio) { /* submit pending writes */ 787 while (bio) { /* submit pending writes */
@@ -1470,10 +1470,8 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
1470 alloc_behind_master_bio(r1_bio, bio); 1470 alloc_behind_master_bio(r1_bio, bio);
1471 } 1471 }
1472 1472
1473 bitmap_startwrite(bitmap, r1_bio->sector, 1473 md_bitmap_startwrite(bitmap, r1_bio->sector, r1_bio->sectors,
1474 r1_bio->sectors, 1474 test_bit(R1BIO_BehindIO, &r1_bio->state));
1475 test_bit(R1BIO_BehindIO,
1476 &r1_bio->state));
1477 first_clone = 0; 1475 first_clone = 0;
1478 } 1476 }
1479 1477
@@ -1881,8 +1879,7 @@ static void end_sync_write(struct bio *bio)
1881 long sectors_to_go = r1_bio->sectors; 1879 long sectors_to_go = r1_bio->sectors;
1882 /* make sure these bits doesn't get cleared. */ 1880 /* make sure these bits doesn't get cleared. */
1883 do { 1881 do {
1884 bitmap_end_sync(mddev->bitmap, s, 1882 md_bitmap_end_sync(mddev->bitmap, s, &sync_blocks, 1);
1885 &sync_blocks, 1);
1886 s += sync_blocks; 1883 s += sync_blocks;
1887 sectors_to_go -= sync_blocks; 1884 sectors_to_go -= sync_blocks;
1888 } while (sectors_to_go > 0); 1885 } while (sectors_to_go > 0);
@@ -2629,12 +2626,12 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr,
2629 * We can find the current addess in mddev->curr_resync 2626 * We can find the current addess in mddev->curr_resync
2630 */ 2627 */
2631 if (mddev->curr_resync < max_sector) /* aborted */ 2628 if (mddev->curr_resync < max_sector) /* aborted */
2632 bitmap_end_sync(mddev->bitmap, mddev->curr_resync, 2629 md_bitmap_end_sync(mddev->bitmap, mddev->curr_resync,
2633 &sync_blocks, 1); 2630 &sync_blocks, 1);
2634 else /* completed sync */ 2631 else /* completed sync */
2635 conf->fullsync = 0; 2632 conf->fullsync = 0;
2636 2633
2637 bitmap_close_sync(mddev->bitmap); 2634 md_bitmap_close_sync(mddev->bitmap);
2638 close_sync(conf); 2635 close_sync(conf);
2639 2636
2640 if (mddev_is_clustered(mddev)) { 2637 if (mddev_is_clustered(mddev)) {
@@ -2654,7 +2651,7 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr,
2654 /* before building a request, check if we can skip these blocks.. 2651 /* before building a request, check if we can skip these blocks..
2655 * This call the bitmap_start_sync doesn't actually record anything 2652 * This call the bitmap_start_sync doesn't actually record anything
2656 */ 2653 */
2657 if (!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) && 2654 if (!md_bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) &&
2658 !conf->fullsync && !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) { 2655 !conf->fullsync && !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) {
2659 /* We can skip this block, and probably several more */ 2656 /* We can skip this block, and probably several more */
2660 *skipped = 1; 2657 *skipped = 1;
@@ -2672,7 +2669,7 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr,
2672 * sector_nr + two times RESYNC_SECTORS 2669 * sector_nr + two times RESYNC_SECTORS
2673 */ 2670 */
2674 2671
2675 bitmap_cond_end_sync(mddev->bitmap, sector_nr, 2672 md_bitmap_cond_end_sync(mddev->bitmap, sector_nr,
2676 mddev_is_clustered(mddev) && (sector_nr + 2 * RESYNC_SECTORS > conf->cluster_sync_high)); 2673 mddev_is_clustered(mddev) && (sector_nr + 2 * RESYNC_SECTORS > conf->cluster_sync_high));
2677 2674
2678 2675
@@ -2831,8 +2828,8 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr,
2831 if (len == 0) 2828 if (len == 0)
2832 break; 2829 break;
2833 if (sync_blocks == 0) { 2830 if (sync_blocks == 0) {
2834 if (!bitmap_start_sync(mddev->bitmap, sector_nr, 2831 if (!md_bitmap_start_sync(mddev->bitmap, sector_nr,
2835 &sync_blocks, still_degraded) && 2832 &sync_blocks, still_degraded) &&
2836 !conf->fullsync && 2833 !conf->fullsync &&
2837 !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) 2834 !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery))
2838 break; 2835 break;
@@ -3171,7 +3168,7 @@ static int raid1_resize(struct mddev *mddev, sector_t sectors)
3171 mddev->array_sectors > newsize) 3168 mddev->array_sectors > newsize)
3172 return -EINVAL; 3169 return -EINVAL;
3173 if (mddev->bitmap) { 3170 if (mddev->bitmap) {
3174 int ret = bitmap_resize(mddev->bitmap, newsize, 0, 0); 3171 int ret = md_bitmap_resize(mddev->bitmap, newsize, 0, 0);
3175 if (ret) 3172 if (ret)
3176 return ret; 3173 return ret;
3177 } 3174 }