diff options
author | Yu Kuai <yukuai3@huawei.com> | 2025-08-29 11:04:17 +0300 |
---|---|---|
committer | Yu Kuai <yukuai3@huawei.com> | 2025-09-06 12:17:58 +0300 |
commit | 7797da149d4622bbe803eaee6eaf22a7f62f44ab (patch) | |
tree | 46f8c460455d454d0202579eefc1596799242068 /drivers/md/md.c | |
parent | d01acbce391767318c94fb1f6d648cfabb428f9d (diff) | |
download | linux-7797da149d4622bbe803eaee6eaf22a7f62f44ab.tar.xz |
md: factor out a helper raid_is_456()
There are no functional changes, the helper will be used by llbitmap in
following patches.
Link: https://lore.kernel.org/linux-raid/20250829080426.1441678-3-yukuai1@huaweicloud.com
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Xiao Ni <xni@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Li Nan <linan122@huawei.com>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 528c99396458..4bc35362f4d0 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -9121,19 +9121,12 @@ static sector_t md_sync_position(struct mddev *mddev, enum sync_action action) static bool sync_io_within_limit(struct mddev *mddev) { - int io_sectors; - /* * For raid456, sync IO is stripe(4k) per IO, for other levels, it's * RESYNC_PAGES(64k) per IO. */ - if (mddev->level == 4 || mddev->level == 5 || mddev->level == 6) - io_sectors = 8; - else - io_sectors = 128; - return atomic_read(&mddev->recovery_active) < - io_sectors * sync_io_depth(mddev); + (raid_is_456(mddev) ? 8 : 128) * sync_io_depth(mddev); } #define SYNC_MARKS 10 |