diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-05-21 13:02:56 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-05-21 13:02:56 -0700 |
commit | 3413efa8885d7a714c54c6752eaf49fd17d351c9 (patch) | |
tree | 8737b11827379324405593e91c60101e6ae7f7ca /block/ioctl.c | |
parent | 2a8120d7b4827380f30b57788ff92ec5594e2194 (diff) | |
parent | 811ba89a8838e7c43ff46b6210ba1878bfe4437e (diff) |
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 'block/ioctl.c')
-rw-r--r-- | block/ioctl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/block/ioctl.c b/block/ioctl.c index 515f75fd0d83..d570e1695896 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -431,7 +431,10 @@ static int blkdev_roset(struct block_device *bdev, unsigned cmd, if (ret) return ret; } - bdev->bd_read_only = n; + if (n) + bdev_set_flag(bdev, BD_READ_ONLY); + else + bdev_clear_flag(bdev, BD_READ_ONLY); return 0; } |