Skip to content

Commit 339d394

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: move the bounce flag into the features field
Move the bounce flag into the features field to reclaim a little bit of space. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Link: https://lore.kernel.org/r/20240617060532.127975-27-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 8c8f5c8 commit 339d394

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

block/blk-settings.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,6 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
479479
b->max_write_zeroes_sectors);
480480
t->max_zone_append_sectors = min(queue_limits_max_zone_append_sectors(t),
481481
queue_limits_max_zone_append_sectors(b));
482-
t->bounce = max(t->bounce, b->bounce);
483482

484483
t->seg_boundary_mask = min_not_zero(t->seg_boundary_mask,
485484
b->seg_boundary_mask);

block/blk.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ struct bio *__blk_queue_bounce(struct bio *bio, struct request_queue *q);
394394
static inline bool blk_queue_may_bounce(struct request_queue *q)
395395
{
396396
return IS_ENABLED(CONFIG_BOUNCE) &&
397-
q->limits.bounce == BLK_BOUNCE_HIGH &&
397+
(q->limits.features & BLK_FEAT_BOUNCE_HIGH) &&
398398
max_low_pfn >= max_pfn;
399399
}
400400

drivers/scsi/scsi_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,7 @@ void scsi_init_limits(struct Scsi_Host *shost, struct queue_limits *lim)
19861986
shost->dma_alignment, dma_get_cache_alignment() - 1);
19871987

19881988
if (shost->no_highmem)
1989-
lim->bounce = BLK_BOUNCE_HIGH;
1989+
lim->features |= BLK_FEAT_BOUNCE_HIGH;
19901990

19911991
dma_set_seg_boundary(dev, shost->dma_boundary);
19921992
dma_set_max_seg_size(dev, shost->max_segment_size);

include/linux/blkdev.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,17 @@ enum {
325325

326326
/* skip this queue in blk_mq_(un)quiesce_tagset */
327327
BLK_FEAT_SKIP_TAGSET_QUIESCE = (1u << 13),
328+
329+
/* bounce all highmem pages */
330+
BLK_FEAT_BOUNCE_HIGH = (1u << 14),
328331
};
329332

330333
/*
331334
* Flags automatically inherited when stacking limits.
332335
*/
333336
#define BLK_FEAT_INHERIT_MASK \
334337
(BLK_FEAT_WRITE_CACHE | BLK_FEAT_FUA | BLK_FEAT_ROTATIONAL | \
335-
BLK_FEAT_STABLE_WRITES | BLK_FEAT_ZONED)
338+
BLK_FEAT_STABLE_WRITES | BLK_FEAT_ZONED | BLK_FEAT_BOUNCE_HIGH)
336339

337340
/* internal flags in queue_limits.flags */
338341
enum {
@@ -352,7 +355,6 @@ enum blk_bounce {
352355
struct queue_limits {
353356
unsigned int features;
354357
unsigned int flags;
355-
enum blk_bounce bounce;
356358
unsigned long seg_boundary_mask;
357359
unsigned long virt_boundary_mask;
358360

0 commit comments

Comments
 (0)