Skip to content

Commit bae1c74

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: renumber and rename the cache disabled flag
Start with the first bit, and drop the plural-S from the name. 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-4-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 4e54ea7 commit bae1c74

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

block/blk-sysfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ static ssize_t queue_io_timeout_store(struct request_queue *q, const char *page,
429429

430430
static ssize_t queue_wc_show(struct request_queue *q, char *page)
431431
{
432-
if (q->limits.features & BLK_FLAGS_WRITE_CACHE_DISABLED)
432+
if (q->limits.features & BLK_FLAG_WRITE_CACHE_DISABLED)
433433
return sprintf(page, "write through\n");
434434
return sprintf(page, "write back\n");
435435
}
@@ -452,9 +452,9 @@ static ssize_t queue_wc_store(struct request_queue *q, const char *page,
452452

453453
lim = queue_limits_start_update(q);
454454
if (disable)
455-
lim.flags |= BLK_FLAGS_WRITE_CACHE_DISABLED;
455+
lim.flags |= BLK_FLAG_WRITE_CACHE_DISABLED;
456456
else
457-
lim.flags &= ~BLK_FLAGS_WRITE_CACHE_DISABLED;
457+
lim.flags &= ~BLK_FLAG_WRITE_CACHE_DISABLED;
458458
err = queue_limits_commit_update(q, &lim);
459459
if (err)
460460
return err;

include/linux/blkdev.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ enum {
339339

340340
/* internal flags in queue_limits.flags */
341341
enum {
342-
/* do not send FLUSH or FUA command despite advertised write cache */
343-
BLK_FLAGS_WRITE_CACHE_DISABLED = (1u << 31),
342+
/* do not send FLUSH/FUA commands despite advertising a write cache */
343+
BLK_FLAG_WRITE_CACHE_DISABLED = (1u << 0),
344344
};
345345

346346
struct queue_limits {
@@ -1339,7 +1339,7 @@ static inline bool bdev_stable_writes(struct block_device *bdev)
13391339
static inline bool blk_queue_write_cache(struct request_queue *q)
13401340
{
13411341
return (q->limits.features & BLK_FEAT_WRITE_CACHE) &&
1342-
!(q->limits.flags & BLK_FLAGS_WRITE_CACHE_DISABLED);
1342+
!(q->limits.flags & BLK_FLAG_WRITE_CACHE_DISABLED);
13431343
}
13441344

13451345
static inline bool bdev_write_cache(struct block_device *bdev)

0 commit comments

Comments
 (0)