Commit ec9b1cf0 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: rename BLK_FEAT_MISALIGNED

This is a flag for ->flags and not a feature for ->features.  And fix the
one place that actually incorrectly cleared it from ->features.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJohn Garry <john.g.garry@oracle.com>
Reviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20240626142637.300624-4-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 78887d00
...@@ -351,7 +351,7 @@ static int blk_validate_limits(struct queue_limits *lim) ...@@ -351,7 +351,7 @@ static int blk_validate_limits(struct queue_limits *lim)
if (lim->alignment_offset) { if (lim->alignment_offset) {
lim->alignment_offset &= (lim->physical_block_size - 1); lim->alignment_offset &= (lim->physical_block_size - 1);
lim->features &= ~BLK_FEAT_MISALIGNED; lim->flags &= ~BLK_FLAG_MISALIGNED;
} }
if (!(lim->features & BLK_FEAT_WRITE_CACHE)) if (!(lim->features & BLK_FEAT_WRITE_CACHE))
...@@ -564,7 +564,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, ...@@ -564,7 +564,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
if (!(b->features & BLK_FEAT_POLL)) if (!(b->features & BLK_FEAT_POLL))
t->features &= ~BLK_FEAT_POLL; t->features &= ~BLK_FEAT_POLL;
t->flags |= (b->flags & BLK_FEAT_MISALIGNED); t->flags |= (b->flags & BLK_FLAG_MISALIGNED);
t->max_sectors = min_not_zero(t->max_sectors, b->max_sectors); t->max_sectors = min_not_zero(t->max_sectors, b->max_sectors);
t->max_user_sectors = min_not_zero(t->max_user_sectors, t->max_user_sectors = min_not_zero(t->max_user_sectors,
...@@ -603,7 +603,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, ...@@ -603,7 +603,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
/* Verify that top and bottom intervals line up */ /* Verify that top and bottom intervals line up */
if (max(top, bottom) % min(top, bottom)) { if (max(top, bottom) % min(top, bottom)) {
t->flags |= BLK_FEAT_MISALIGNED; t->flags |= BLK_FLAG_MISALIGNED;
ret = -1; ret = -1;
} }
} }
...@@ -625,28 +625,28 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, ...@@ -625,28 +625,28 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
/* Physical block size a multiple of the logical block size? */ /* Physical block size a multiple of the logical block size? */
if (t->physical_block_size & (t->logical_block_size - 1)) { if (t->physical_block_size & (t->logical_block_size - 1)) {
t->physical_block_size = t->logical_block_size; t->physical_block_size = t->logical_block_size;
t->flags |= BLK_FEAT_MISALIGNED; t->flags |= BLK_FLAG_MISALIGNED;
ret = -1; ret = -1;
} }
/* Minimum I/O a multiple of the physical block size? */ /* Minimum I/O a multiple of the physical block size? */
if (t->io_min & (t->physical_block_size - 1)) { if (t->io_min & (t->physical_block_size - 1)) {
t->io_min = t->physical_block_size; t->io_min = t->physical_block_size;
t->flags |= BLK_FEAT_MISALIGNED; t->flags |= BLK_FLAG_MISALIGNED;
ret = -1; ret = -1;
} }
/* Optimal I/O a multiple of the physical block size? */ /* Optimal I/O a multiple of the physical block size? */
if (t->io_opt & (t->physical_block_size - 1)) { if (t->io_opt & (t->physical_block_size - 1)) {
t->io_opt = 0; t->io_opt = 0;
t->flags |= BLK_FEAT_MISALIGNED; t->flags |= BLK_FLAG_MISALIGNED;
ret = -1; ret = -1;
} }
/* chunk_sectors a multiple of the physical block size? */ /* chunk_sectors a multiple of the physical block size? */
if ((t->chunk_sectors << 9) & (t->physical_block_size - 1)) { if ((t->chunk_sectors << 9) & (t->physical_block_size - 1)) {
t->chunk_sectors = 0; t->chunk_sectors = 0;
t->flags |= BLK_FEAT_MISALIGNED; t->flags |= BLK_FLAG_MISALIGNED;
ret = -1; ret = -1;
} }
...@@ -656,7 +656,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, ...@@ -656,7 +656,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
/* Verify that new alignment_offset is on a logical block boundary */ /* Verify that new alignment_offset is on a logical block boundary */
if (t->alignment_offset & (t->logical_block_size - 1)) { if (t->alignment_offset & (t->logical_block_size - 1)) {
t->flags |= BLK_FEAT_MISALIGNED; t->flags |= BLK_FLAG_MISALIGNED;
ret = -1; ret = -1;
} }
...@@ -809,7 +809,7 @@ int bdev_alignment_offset(struct block_device *bdev) ...@@ -809,7 +809,7 @@ int bdev_alignment_offset(struct block_device *bdev)
{ {
struct request_queue *q = bdev_get_queue(bdev); struct request_queue *q = bdev_get_queue(bdev);
if (q->limits.flags & BLK_FEAT_MISALIGNED) if (q->limits.flags & BLK_FLAG_MISALIGNED)
return -1; return -1;
if (bdev_is_partition(bdev)) if (bdev_is_partition(bdev))
return queue_limit_alignment_offset(&q->limits, return queue_limit_alignment_offset(&q->limits,
......
...@@ -347,7 +347,7 @@ enum { ...@@ -347,7 +347,7 @@ enum {
BLK_FLAG_WRITE_CACHE_DISABLED = (1u << 0), BLK_FLAG_WRITE_CACHE_DISABLED = (1u << 0),
/* I/O topology is misaligned */ /* I/O topology is misaligned */
BLK_FEAT_MISALIGNED = (1u << 1), BLK_FLAG_MISALIGNED = (1u << 1),
}; };
struct queue_limits { struct queue_limits {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment