aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/blk_types.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-05-21 13:02:56 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2024-05-21 13:02:56 -0700
commit3413efa8885d7a714c54c6752eaf49fd17d351c9 (patch)
tree8737b11827379324405593e91c60101e6ae7f7ca /include/linux/blk_types.h
parentMerge tag 's390-6.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux (diff)
parentbdev: move ->bd_make_it_fail to ->__bd_flags (diff)
downloadwireguard-linux-3413efa8885d7a714c54c6752eaf49fd17d351c9.tar.xz
wireguard-linux-3413efa8885d7a714c54c6752eaf49fd17d351c9.zip
Merge tag 'pull-bd_flags-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull bdev flags update from Al Viro: "Compactifying bdev flags. We can easily have up to 24 flags with sane atomicity, _without_ pushing anything out of the first cacheline of struct block_device" * tag 'pull-bd_flags-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: bdev: move ->bd_make_it_fail to ->__bd_flags bdev: move ->bd_ro_warned to ->__bd_flags bdev: move ->bd_has_subit_bio to ->__bd_flags bdev: move ->bd_write_holder into ->__bd_flags bdev: move ->bd_read_only to ->__bd_flags bdev: infrastructure for flags wrapper for access to ->bd_partno Use bdev_is_paritition() instead of open-coding it
Diffstat (limited to 'include/linux/blk_types.h')
-rw-r--r--include/linux/blk_types.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index d88c0a009483..781c4500491b 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -45,10 +45,15 @@ struct block_device {
struct request_queue * bd_queue;
struct disk_stats __percpu *bd_stats;
unsigned long bd_stamp;
- bool bd_read_only; /* read-only policy */
- u8 bd_partno;
- bool bd_write_holder;
- bool bd_has_submit_bio;
+ atomic_t __bd_flags; // partition number + flags
+#define BD_PARTNO 255 // lower 8 bits; assign-once
+#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)
+#ifdef CONFIG_FAIL_MAKE_REQUEST
+#define BD_MAKE_IT_FAIL (1u<<12)
+#endif
dev_t bd_dev;
struct address_space *bd_mapping; /* page cache */
@@ -65,10 +70,6 @@ struct block_device {
struct mutex bd_fsfreeze_mutex; /* serialize freeze/thaw */
struct partition_meta_info *bd_meta_info;
-#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