bdev: move ->bd_ro_warned to ->__bd_flags
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 12 Apr 2024 05:24:27 +0000 (01:24 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 3 May 2024 00:04:17 +0000 (20:04 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
block/blk-core.c
include/linux/blk_types.h

index f61460b65408733d828fbeaefec328eaaa71449e..1be49be9fac4d1ea4c18e730f3108c08d25329d1 100644 (file)
@@ -514,10 +514,11 @@ static inline void bio_check_ro(struct bio *bio)
                if (op_is_flush(bio->bi_opf) && !bio_sectors(bio))
                        return;
 
-               if (bio->bi_bdev->bd_ro_warned)
+               if (bdev_test_flag(bio->bi_bdev, BD_RO_WARNED))
                        return;
 
-               bio->bi_bdev->bd_ro_warned = true;
+               bdev_set_flag(bio->bi_bdev, BD_RO_WARNED);
+
                /*
                 * Use ioctl to set underlying disk of raid/dm to read-only
                 * will trigger this.
index 11b9e8eeb79f73e581d2cce5e3d3f79399fca631..4e0c8785090c2b708d9535c945e7e627466d107c 100644 (file)
@@ -50,6 +50,7 @@ struct block_device {
 #define BD_READ_ONLY           (1u<<8) // read-only policy
 #define BD_WRITE_HOLDER                (1u<<9)
 #define BD_HAS_SUBMIT_BIO      (1u<<10)
+#define BD_RO_WARNED           (1u<<11)
        dev_t                   bd_dev;
        struct inode            *bd_inode;      /* will die */
 
@@ -69,7 +70,6 @@ struct block_device {
 #ifdef CONFIG_FAIL_MAKE_REQUEST
        bool                    bd_make_it_fail;
 #endif
-       bool                    bd_ro_warned;
        int                     bd_writers;
        /*
         * keep this out-of-line as it's both big and not needed in the fast