summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-11-03 13:00:11 +0300
committerSasha Levin <sashal@kernel.org>2024-03-27 01:22:34 +0300
commitf28658bc8a7faa03578dc2588b5b3b56b09575a6 (patch)
tree6c14f929e8c4b67c81576f066f2ef45e0d69730d /include/linux
parentdc51c01a3d5a796e18520a186f56e13f8e70749f (diff)
downloadlinux-f28658bc8a7faa03578dc2588b5b3b56b09575a6.tar.xz
block: add a new set_read_only method
[ Upstream commit e00adcadf3af7a8335026d71ab9f0e0a922191ac ] Add a new method to allow for driver-specific processing when setting or clearing the block device read-only state. This allows to replace the cumbersome and error-prone override of the whole ioctl implementation. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk> Stable-dep-of: 9674f54e41ff ("md: Don't clear MD_CLOSING when the raid is about to stop") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/blkdev.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index ac407c1d4d40..8f0aafae09d9 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1997,6 +1997,7 @@ struct block_device_operations {
void (*unlock_native_capacity) (struct gendisk *);
int (*revalidate_disk) (struct gendisk *);
int (*getgeo)(struct block_device *, struct hd_geometry *);
+ int (*set_read_only)(struct block_device *bdev, bool ro);
/* this callback is with swap_lock and sometimes page table lock held */
void (*swap_slot_free_notify) (struct block_device *, unsigned long);
struct module *owner;