aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorYu Kuai <[email protected]>2024-08-26 07:44:52 +0000
committerSong Liu <[email protected]>2024-08-27 19:43:16 +0000
commit59fdd43304f4cbb7ee8e281ca337afd803c309f6 (patch)
tree6e450240b2be7acff0f83d74dcbcf67e66c6fdec /drivers/md/raid1.c
parentmd/md-bitmap: merge md_bitmap_enabled() into bitmap_operations (diff)
downloadkernel-59fdd43304f4cbb7ee8e281ca337afd803c309f6.tar.gz
kernel-59fdd43304f4cbb7ee8e281ca337afd803c309f6.zip
md/md-bitmap: make in memory structure internal
Now that struct bitmap_page and bitmap is not used externally anymore, move them from md-bitmap.h to md-bitmap.c (expect that dm-raid is still using define marco 'COUNTER_MAX'). Also fix some checkpatch warnings. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index b15725a7a581..f55c8e67d059 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1412,7 +1412,6 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
struct r1conf *conf = mddev->private;
struct r1bio *r1_bio;
int i, disks;
- struct bitmap *bitmap = mddev->bitmap;
unsigned long flags;
struct md_rdev *blocked_rdev;
int first_clone;
@@ -1565,7 +1564,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
* at a time and thus needs a new bio that can fit the whole payload
* this bio in page sized chunks.
*/
- if (write_behind && bitmap)
+ if (write_behind && mddev->bitmap)
max_sectors = min_t(int, max_sectors,
BIO_MAX_VECS * (PAGE_SIZE >> 9));
if (max_sectors < bio_sectors(bio)) {
@@ -1601,7 +1600,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
* Not if there are too many, or cannot
* allocate memory, or a reader on WriteMostly
* is waiting for behind writes to flush */
- err = mddev->bitmap_ops->get_stats(bitmap, &stats);
+ err = mddev->bitmap_ops->get_stats(mddev->bitmap, &stats);
if (!err && write_behind && !stats.behind_wait &&
stats.behind_writes < max_write_behind)
alloc_behind_master_bio(r1_bio, bio);