mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
rbd: only set disk to read-only once
rbd_open(), called every time the device is opened, calls set_device_ro(). There's no reason to set the device read-only or read-write every time it is opened. Just do this once during device setup, using set_disk_ro() instead because the struct block_device isn't available to us there. Signed-off-by: Josh Durgin <[email protected]> Reviewed-by: Alex Elder <[email protected]>
This commit is contained in:
parent
77f33c0373
commit
22001f619f
1 changed files with 1 additions and 1 deletions
|
|
@ -541,7 +541,6 @@ static int rbd_open(struct block_device *bdev, fmode_t mode)
|
|||
return -ENOENT;
|
||||
|
||||
(void) get_device(&rbd_dev->dev);
|
||||
set_device_ro(bdev, rbd_dev->mapping.read_only);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -5060,6 +5059,7 @@ static int rbd_dev_device_setup(struct rbd_device *rbd_dev)
|
|||
if (ret)
|
||||
goto err_out_disk;
|
||||
set_capacity(rbd_dev->disk, rbd_dev->mapping.size / SECTOR_SIZE);
|
||||
set_disk_ro(rbd_dev->disk, rbd_dev->mapping.read_only);
|
||||
|
||||
ret = rbd_bus_add_dev(rbd_dev);
|
||||
if (ret)
|
||||
|
|
|
|||
Loading…
Reference in a new issue