Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Christoph Hellwig and committed by
Jens Axboe
339d3948 8c8f5c85

+6 -5
-1
block/blk-settings.c
··· 479 479 b->max_write_zeroes_sectors); 480 480 t->max_zone_append_sectors = min(queue_limits_max_zone_append_sectors(t), 481 481 queue_limits_max_zone_append_sectors(b)); 482 - t->bounce = max(t->bounce, b->bounce); 483 482 484 483 t->seg_boundary_mask = min_not_zero(t->seg_boundary_mask, 485 484 b->seg_boundary_mask);
+1 -1
block/blk.h
··· 394 394 static inline bool blk_queue_may_bounce(struct request_queue *q) 395 395 { 396 396 return IS_ENABLED(CONFIG_BOUNCE) && 397 - q->limits.bounce == BLK_BOUNCE_HIGH && 397 + (q->limits.features & BLK_FEAT_BOUNCE_HIGH) && 398 398 max_low_pfn >= max_pfn; 399 399 } 400 400
+1 -1
drivers/scsi/scsi_lib.c
··· 1986 1986 shost->dma_alignment, dma_get_cache_alignment() - 1); 1987 1987 1988 1988 if (shost->no_highmem) 1989 - lim->bounce = BLK_BOUNCE_HIGH; 1989 + lim->features |= BLK_FEAT_BOUNCE_HIGH; 1990 1990 1991 1991 dma_set_seg_boundary(dev, shost->dma_boundary); 1992 1992 dma_set_max_seg_size(dev, shost->max_segment_size);
+4 -2
include/linux/blkdev.h
··· 325 325 326 326 /* skip this queue in blk_mq_(un)quiesce_tagset */ 327 327 BLK_FEAT_SKIP_TAGSET_QUIESCE = (1u << 13), 328 + 329 + /* bounce all highmem pages */ 330 + BLK_FEAT_BOUNCE_HIGH = (1u << 14), 328 331 }; 329 332 330 333 /* ··· 335 332 */ 336 333 #define BLK_FEAT_INHERIT_MASK \ 337 334 (BLK_FEAT_WRITE_CACHE | BLK_FEAT_FUA | BLK_FEAT_ROTATIONAL | \ 338 - BLK_FEAT_STABLE_WRITES | BLK_FEAT_ZONED) 335 + BLK_FEAT_STABLE_WRITES | BLK_FEAT_ZONED | BLK_FEAT_BOUNCE_HIGH) 339 336 340 337 /* internal flags in queue_limits.flags */ 341 338 enum { ··· 355 352 struct queue_limits { 356 353 unsigned int features; 357 354 unsigned int flags; 358 - enum blk_bounce bounce; 359 355 unsigned long seg_boundary_mask; 360 356 unsigned long virt_boundary_mask; 361 357