]> www.infradead.org Git - nvme.git/commitdiff
block: renumber and rename the cache disabled flag
authorChristoph Hellwig <hch@lst.de>
Wed, 19 Jun 2024 15:45:35 +0000 (17:45 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 20 Jun 2024 12:53:14 +0000 (06:53 -0600)
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>
block/blk-sysfs.c
include/linux/blkdev.h

index da4e96d686f91e9c07088d7e47ad27f4bd5308e5..59e6d111ed059a0c039f269807cd2190194291f1 100644 (file)
@@ -429,7 +429,7 @@ static ssize_t queue_io_timeout_store(struct request_queue *q, const char *page,
 
 static ssize_t queue_wc_show(struct request_queue *q, char *page)
 {
-       if (q->limits.features & BLK_FLAGS_WRITE_CACHE_DISABLED)
+       if (q->limits.features & BLK_FLAG_WRITE_CACHE_DISABLED)
                return sprintf(page, "write through\n");
        return sprintf(page, "write back\n");
 }
@@ -452,9 +452,9 @@ static ssize_t queue_wc_store(struct request_queue *q, const char *page,
 
        lim = queue_limits_start_update(q);
        if (disable)
-               lim.flags |= BLK_FLAGS_WRITE_CACHE_DISABLED;
+               lim.flags |= BLK_FLAG_WRITE_CACHE_DISABLED;
        else
-               lim.flags &= ~BLK_FLAGS_WRITE_CACHE_DISABLED;
+               lim.flags &= ~BLK_FLAG_WRITE_CACHE_DISABLED;
        err = queue_limits_commit_update(q, &lim);
        if (err)
                return err;
index f7d275e3fb2c1e74097d0c5eafa3c722070189a1..713a98b6dbba089c88172d32bb6e20b279f9cfa2 100644 (file)
@@ -339,8 +339,8 @@ enum {
 
 /* internal flags in queue_limits.flags */
 enum {
-       /* do not send FLUSH or FUA command despite advertised write cache */
-       BLK_FLAGS_WRITE_CACHE_DISABLED          = (1u << 31),
+       /* do not send FLUSH/FUA commands despite advertising a write cache */
+       BLK_FLAG_WRITE_CACHE_DISABLED           = (1u << 0),
 };
 
 struct queue_limits {
@@ -1339,7 +1339,7 @@ static inline bool bdev_stable_writes(struct block_device *bdev)
 static inline bool blk_queue_write_cache(struct request_queue *q)
 {
        return (q->limits.features & BLK_FEAT_WRITE_CACHE) &&
-               !(q->limits.flags & BLK_FLAGS_WRITE_CACHE_DISABLED);
+               !(q->limits.flags & BLK_FLAG_WRITE_CACHE_DISABLED);
 }
 
 static inline bool bdev_write_cache(struct block_device *bdev)