]> git.baikalelectronics.ru Git - kernel.git/commitdiff
rbd: remove the ->set_read_only method
authorChristoph Hellwig <hch@lst.de>
Sat, 9 Jan 2021 10:42:53 +0000 (11:42 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Jan 2021 01:15:57 +0000 (18:15 -0700)
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>
drivers/block/rbd.c

index 59cfe71d0b3a39925fd96c79b5985af80c24d11e..bbb88eb009e0ba915de24e0d8ba5fbcc8493084a 100644 (file)
@@ -692,29 +692,10 @@ static void rbd_release(struct gendisk *disk, fmode_t mode)
        put_device(&rbd_dev->dev);
 }
 
-static int rbd_set_read_only(struct block_device *bdev, bool ro)
-{
-       struct rbd_device *rbd_dev = bdev->bd_disk->private_data;
-
-       /*
-        * Both images mapped read-only and snapshots can't be marked
-        * read-write.
-        */
-       if (!ro) {
-               if (rbd_is_ro(rbd_dev))
-                       return -EROFS;
-
-               rbd_assert(!rbd_is_snap(rbd_dev));
-       }
-
-       return 0;
-}
-
 static const struct block_device_operations rbd_bd_ops = {
        .owner                  = THIS_MODULE,
        .open                   = rbd_open,
        .release                = rbd_release,
-       .set_read_only          = rbd_set_read_only,
 };
 
 /*