Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rbd: remove the ->set_read_only method

Now that the hardware read-only state can't be changed by the BLKROSET
ioctl, the code in this method is not required anymore.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Acked-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
cbf72cce 947139bf

-19
-19
drivers/block/rbd.c
··· 692 692 put_device(&rbd_dev->dev); 693 693 } 694 694 695 - static int rbd_set_read_only(struct block_device *bdev, bool ro) 696 - { 697 - struct rbd_device *rbd_dev = bdev->bd_disk->private_data; 698 - 699 - /* 700 - * Both images mapped read-only and snapshots can't be marked 701 - * read-write. 702 - */ 703 - if (!ro) { 704 - if (rbd_is_ro(rbd_dev)) 705 - return -EROFS; 706 - 707 - rbd_assert(!rbd_is_snap(rbd_dev)); 708 - } 709 - 710 - return 0; 711 - } 712 - 713 695 static const struct block_device_operations rbd_bd_ops = { 714 696 .owner = THIS_MODULE, 715 697 .open = rbd_open, 716 698 .release = rbd_release, 717 - .set_read_only = rbd_set_read_only, 718 699 }; 719 700 720 701 /*