Commit cbf72cce authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Acked-by: default avatarIlya Dryomov <idryomov@gmail.com>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 947139bf
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -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,
};

/*