]> Git Repo - linux.git/commitdiff
dm: stop using blk_limits_io_{min,opt}
authorChristoph Hellwig <[email protected]>
Wed, 3 Jul 2024 13:12:08 +0000 (15:12 +0200)
committerMikulas Patocka <[email protected]>
Wed, 10 Jul 2024 11:10:06 +0000 (13:10 +0200)
Remove use of the blk_limits_io_{min,opt} and assign the values directly
to the queue_limits structure.  For the io_opt this is a completely
mechanical change, for io_min it removes flooring the limit to the
physical and logical block size in the particular caller.  But as
blk_validate_limits will do the same later when actually applying the
limits, there still is no change in overall behavior.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Mikulas Patocka <[email protected]>
drivers/md/dm-cache-target.c
drivers/md/dm-clone-target.c
drivers/md/dm-ebs-target.c
drivers/md/dm-era-target.c
drivers/md/dm-integrity.c
drivers/md/dm-raid.c
drivers/md/dm-stripe.c
drivers/md/dm-thin.c
drivers/md/dm-vdo/dm-vdo-target.c
drivers/md/dm-verity-target.c
drivers/md/dm-zoned-target.c

index 2d8dd9283ff4cf76da2327e7ddee5c3bd557569f..17f0fab1e25496c22e8a69fb2db1174202db9a11 100644 (file)
@@ -3416,8 +3416,8 @@ static void cache_io_hints(struct dm_target *ti, struct queue_limits *limits)
         */
        if (io_opt_sectors < cache->sectors_per_block ||
            do_div(io_opt_sectors, cache->sectors_per_block)) {
-               blk_limits_io_min(limits, cache->sectors_per_block << SECTOR_SHIFT);
-               blk_limits_io_opt(limits, cache->sectors_per_block << SECTOR_SHIFT);
+               limits->io_min = cache->sectors_per_block << SECTOR_SHIFT;
+               limits->io_opt = cache->sectors_per_block << SECTOR_SHIFT;
        }
 
        disable_passdown_if_not_supported(cache);
index b4384a8b13e36012b2003e69c47e7bcc24e19852..12bbe487a4c89506412be292e7d0322f84eb5438 100644 (file)
@@ -2073,8 +2073,8 @@ static void clone_io_hints(struct dm_target *ti, struct queue_limits *limits)
         */
        if (io_opt_sectors < clone->region_size ||
            do_div(io_opt_sectors, clone->region_size)) {
-               blk_limits_io_min(limits, clone->region_size << SECTOR_SHIFT);
-               blk_limits_io_opt(limits, clone->region_size << SECTOR_SHIFT);
+               limits->io_min = clone->region_size << SECTOR_SHIFT;
+               limits->io_opt = clone->region_size << SECTOR_SHIFT;
        }
 
        disable_passdown_if_not_supported(clone);
index b70d4016c2acd080daba7570eac363e2437078bd..ec5db1478b2fcebb77c9cf714136f8d9d2150ca0 100644 (file)
@@ -428,7 +428,7 @@ static void ebs_io_hints(struct dm_target *ti, struct queue_limits *limits)
        limits->logical_block_size = to_bytes(ec->e_bs);
        limits->physical_block_size = to_bytes(ec->u_bs);
        limits->alignment_offset = limits->physical_block_size;
-       blk_limits_io_min(limits, limits->logical_block_size);
+       limits->io_min = limits->logical_block_size;
 }
 
 static int ebs_iterate_devices(struct dm_target *ti,
index 8f81e597858d5c7c15291dc4490a05fbc4b9bdfa..e627781b1420e3dc9fdd6be249df809c8169991c 100644 (file)
@@ -1733,8 +1733,8 @@ static void era_io_hints(struct dm_target *ti, struct queue_limits *limits)
         */
        if (io_opt_sectors < era->sectors_per_block ||
            do_div(io_opt_sectors, era->sectors_per_block)) {
-               blk_limits_io_min(limits, 0);
-               blk_limits_io_opt(limits, era->sectors_per_block << SECTOR_SHIFT);
+               limits->io_min = 0;
+               limits->io_opt = era->sectors_per_block << SECTOR_SHIFT;
        }
 }
 
index 2a89f8eb4713c973e12a63956fcf06f2bc3721ae..3c18d58358f5dfecdb3251317c6eb93b1130703a 100644 (file)
@@ -3471,7 +3471,7 @@ static void dm_integrity_io_hints(struct dm_target *ti, struct queue_limits *lim
        if (ic->sectors_per_block > 1) {
                limits->logical_block_size = ic->sectors_per_block << SECTOR_SHIFT;
                limits->physical_block_size = ic->sectors_per_block << SECTOR_SHIFT;
-               blk_limits_io_min(limits, ic->sectors_per_block << SECTOR_SHIFT);
+               limits->io_min = ic->sectors_per_block << SECTOR_SHIFT;
                limits->dma_alignment = limits->logical_block_size - 1;
                limits->discard_granularity = ic->sectors_per_block << SECTOR_SHIFT;
        }
index a790d6a82e141a079ec900693bc9dc42696da388..46559f5d21e87c28d982b68681cc98d37a603fc3 100644 (file)
@@ -3802,8 +3802,8 @@ static void raid_io_hints(struct dm_target *ti, struct queue_limits *limits)
        struct raid_set *rs = ti->private;
        unsigned int chunk_size_bytes = to_bytes(rs->md.chunk_sectors);
 
-       blk_limits_io_min(limits, chunk_size_bytes);
-       blk_limits_io_opt(limits, chunk_size_bytes * mddev_data_stripes(rs));
+       limits->io_min = chunk_size_bytes;
+       limits->io_opt = chunk_size_bytes * mddev_data_stripes(rs);
 }
 
 static void raid_presuspend(struct dm_target *ti)
index ec908cf8cfdcf0875c3e21541d2ca65cd7e6641b..4112071de0be0c17d70ad10b0da237bd825f1df9 100644 (file)
@@ -459,8 +459,8 @@ static void stripe_io_hints(struct dm_target *ti,
        struct stripe_c *sc = ti->private;
        unsigned int chunk_size = sc->chunk_size << SECTOR_SHIFT;
 
-       blk_limits_io_min(limits, chunk_size);
-       blk_limits_io_opt(limits, chunk_size * sc->stripes);
+       limits->io_min = chunk_size;
+       limits->io_opt = chunk_size * sc->stripes;
 }
 
 static struct target_type stripe_target = {
index 991f77a5885b721b4275570065f451791d6b9535..a0c1620e90c8ce4e02103f3dd085fbc70332f9a1 100644 (file)
@@ -4079,10 +4079,10 @@ static void pool_io_hints(struct dm_target *ti, struct queue_limits *limits)
        if (io_opt_sectors < pool->sectors_per_block ||
            !is_factor(io_opt_sectors, pool->sectors_per_block)) {
                if (is_factor(pool->sectors_per_block, limits->max_sectors))
-                       blk_limits_io_min(limits, limits->max_sectors << SECTOR_SHIFT);
+                       limits->io_min = limits->max_sectors << SECTOR_SHIFT;
                else
-                       blk_limits_io_min(limits, pool->sectors_per_block << SECTOR_SHIFT);
-               blk_limits_io_opt(limits, pool->sectors_per_block << SECTOR_SHIFT);
+                       limits->io_min = pool->sectors_per_block << SECTOR_SHIFT;
+               limits->io_opt = pool->sectors_per_block << SECTOR_SHIFT;
        }
 
        /*
index b423bec6458bbe6bf53e7bf56da5c1d8251b5a7a..b1a62de1562f344ec4d5378ecd82e4d8ac34b951 100644 (file)
@@ -928,9 +928,9 @@ static void vdo_io_hints(struct dm_target *ti, struct queue_limits *limits)
        limits->physical_block_size = VDO_BLOCK_SIZE;
 
        /* The minimum io size for random io */
-       blk_limits_io_min(limits, VDO_BLOCK_SIZE);
+       limits->io_min = VDO_BLOCK_SIZE;
        /* The optimal io size for streamed/sequential io */
-       blk_limits_io_opt(limits, VDO_BLOCK_SIZE);
+       limits->io_opt = VDO_BLOCK_SIZE;
 
        /*
         * Sets the maximum discard size that will be passed into VDO. This value comes from a
index adf21b095dc311cabfc755a45898e0ac0e3d32ec..0a2399d958b7e768cebca773c1e120faadeb8543 100644 (file)
@@ -919,7 +919,7 @@ static void verity_io_hints(struct dm_target *ti, struct queue_limits *limits)
        if (limits->physical_block_size < 1 << v->data_dev_block_bits)
                limits->physical_block_size = 1 << v->data_dev_block_bits;
 
-       blk_limits_io_min(limits, limits->logical_block_size);
+       limits->io_min = limits->logical_block_size;
 
        /*
         * Similar to what dm-crypt does, opt dm-verity out of support for
index cd0ee144973f9fd97243133a417cf0742c189b67..6141fc25d8421a4f3689eaa27b5c16aea25ef9e1 100644 (file)
@@ -996,8 +996,8 @@ static void dmz_io_hints(struct dm_target *ti, struct queue_limits *limits)
        limits->logical_block_size = DMZ_BLOCK_SIZE;
        limits->physical_block_size = DMZ_BLOCK_SIZE;
 
-       blk_limits_io_min(limits, DMZ_BLOCK_SIZE);
-       blk_limits_io_opt(limits, DMZ_BLOCK_SIZE);
+       limits->io_min = DMZ_BLOCK_SIZE;
+       limits->io_opt = DMZ_BLOCK_SIZE;
 
        limits->discard_alignment = 0;
        limits->discard_granularity = DMZ_BLOCK_SIZE;
This page took 0.079667 seconds and 4 git commands to generate.