aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-11-03 11:00:11 +0100
committerJens Axboe <axboe@kernel.dk>2020-11-16 08:14:29 -0700
commite00adcadf3af7a8335026d71ab9f0e0a922191ac (patch)
tree7d7f22326e387ef08b23cf9a3a76e6f16fc1b089 /include/linux/blkdev.h
parentblock: don't call into the driver for BLKFLSBUF (diff)
downloadlinux-dev-e00adcadf3af7a8335026d71ab9f0e0a922191ac.tar.xz
linux-dev-e00adcadf3af7a8335026d71ab9f0e0a922191ac.zip
block: add a new set_read_only method
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>
Diffstat (limited to 'include/linux/blkdev.h')
-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 639cae2c158b..5c1ba8a8d2bc 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1850,6 +1850,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);
int (*report_zones)(struct gendisk *, sector_t sector,