summaryrefslogtreecommitdiff
path: root/block/bdev.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2024-04-12 01:07:29 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2024-05-02 19:50:11 -0400
commit1116b9fa15c09748ae05d2365a305fa22671eb1e (patch)
tree0d380782b6d3aadc770d758ef956887f028423fa /block/bdev.c
parentb8c873edbf35570b93edfeddad9e85da54defa52 (diff)
bdev: infrastructure for flags
Replace bd_partno with a 32bit field (__bd_flags). The lower 8 bits contain the partition number, the upper 24 are for flags. Helpers: bdev_{test,set,clear}_flag(bdev, flag), with atomic_or() and atomic_andnot() used to set/clear. NOTE: this commit does not actually move any flags over there - they are still bool fields. As the result, it shifts the fields wrt cacheline boundaries; that's going to be restored once the first 3 flags are dealt with. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'block/bdev.c')
-rw-r--r--block/bdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/bdev.c b/block/bdev.c
index 7a5f611c3d2e..2ec223315500 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -411,7 +411,7 @@ struct block_device *bdev_alloc(struct gendisk *disk, u8 partno)
mutex_init(&bdev->bd_fsfreeze_mutex);
spin_lock_init(&bdev->bd_size_lock);
mutex_init(&bdev->bd_holder_lock);
- bdev->bd_partno = partno;
+ atomic_set(&bdev->__bd_flags, partno);
bdev->bd_inode = inode;
bdev->bd_queue = disk->queue;
if (partno)