Skip to content

Commit 7d4dec5

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: move the raid_partial_stripes_expensive flag into the features field
Move the raid_partial_stripes_expensive flags into the features field to reclaim a little bit of space. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Link: https://lore.kernel.org/r/20240619154623.450048-7-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 4cac3d3 commit 7d4dec5

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

block/blk-settings.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,6 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
556556
ret = -1;
557557
}
558558

559-
t->raid_partial_stripes_expensive =
560-
max(t->raid_partial_stripes_expensive,
561-
b->raid_partial_stripes_expensive);
562-
563559
/* Find lowest common alignment_offset */
564560
t->alignment_offset = lcm_not_zero(t->alignment_offset, alignment)
565561
% max(t->physical_block_size, t->io_min);

drivers/md/bcache/super.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,8 +1416,8 @@ static int cached_dev_init(struct cached_dev *dc, unsigned int block_size)
14161416
}
14171417

14181418
if (bdev_io_opt(dc->bdev))
1419-
dc->partial_stripes_expensive =
1420-
q->limits.raid_partial_stripes_expensive;
1419+
dc->partial_stripes_expensive = q->limits.features &
1420+
BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE;
14211421

14221422
ret = bcache_device_init(&dc->disk, block_size,
14231423
bdev_nr_sectors(dc->bdev) - dc->sb.data_offset,

drivers/md/raid5.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7707,7 +7707,7 @@ static int raid5_set_limits(struct mddev *mddev)
77077707
blk_set_stacking_limits(&lim);
77087708
lim.io_min = mddev->chunk_sectors << 9;
77097709
lim.io_opt = lim.io_min * (conf->raid_disks - conf->max_degraded);
7710-
lim.raid_partial_stripes_expensive = 1;
7710+
lim.features |= BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE;
77117711
lim.discard_granularity = stripe;
77127712
lim.max_write_zeroes_sectors = 0;
77137713
mddev_stack_rdev_limits(mddev, &lim, 0);

include/linux/blkdev.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,14 +328,18 @@ enum {
328328

329329
/* bounce all highmem pages */
330330
BLK_FEAT_BOUNCE_HIGH = (1u << 14),
331+
332+
/* undocumented magic for bcache */
333+
BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE = (1u << 15),
331334
};
332335

333336
/*
334337
* Flags automatically inherited when stacking limits.
335338
*/
336339
#define BLK_FEAT_INHERIT_MASK \
337340
(BLK_FEAT_WRITE_CACHE | BLK_FEAT_FUA | BLK_FEAT_ROTATIONAL | \
338-
BLK_FEAT_STABLE_WRITES | BLK_FEAT_ZONED | BLK_FEAT_BOUNCE_HIGH)
341+
BLK_FEAT_STABLE_WRITES | BLK_FEAT_ZONED | BLK_FEAT_BOUNCE_HIGH | \
342+
BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE)
339343

340344
/* internal flags in queue_limits.flags */
341345
enum {
@@ -377,7 +381,6 @@ struct queue_limits {
377381
unsigned short max_integrity_segments;
378382
unsigned short max_discard_segments;
379383

380-
unsigned char raid_partial_stripes_expensive;
381384
unsigned int max_open_zones;
382385
unsigned int max_active_zones;
383386

0 commit comments

Comments
 (0)