dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Sagi Grimberg <sagi@grimberg.me>,
	Mike Snitzer <snitzer@redhat.com>,
	Oleksii Kurochko <olkuroch@cisco.com>,
	Dongsheng Yang <dongsheng.yang@easystack.cn>,
	linux-block@vger.kernel.org, dm-devel@redhat.com,
	linux-nvme@lists.infradead.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Ilya Dryomov <idryomov@gmail.com>,
	ceph-devel@vger.kernel.org
Subject: [dm-devel] [PATCH 5/6] rbd: remove the ->set_read_only method
Date: Sat,  9 Jan 2021 11:42:53 +0100	[thread overview]
Message-ID: <20210109104254.1077093-6-hch@lst.de> (raw)
In-Reply-To: <20210109104254.1077093-1-hch@lst.de>

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>
---
 drivers/block/rbd.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 59cfe71d0b3a39..bbb88eb009e0ba 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -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,
 };
 
 /*
-- 
2.29.2

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


  parent reply	other threads:[~2021-01-09 10:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-09 10:42 [dm-devel] split hard read-only vs read-only policy v3 (resend) Christoph Hellwig
2021-01-09 10:42 ` [dm-devel] [PATCH 1/6] dm: use bdev_read_only to check if a device is read-only Christoph Hellwig
2021-01-09 10:42 ` [dm-devel] [PATCH 2/6] block: remove the NULL bdev check in bdev_read_only Christoph Hellwig
2021-01-09 20:14   ` Chaitanya Kulkarni
2021-01-10 14:59   ` Hannes Reinecke
2021-01-09 10:42 ` [dm-devel] [PATCH 3/6] block: add a hard-readonly flag to struct gendisk Christoph Hellwig
2021-01-09 10:42 ` [dm-devel] [PATCH 4/6] block: propagate BLKROSET on the whole device to all partitions Christoph Hellwig
2021-01-10 15:00   ` Hannes Reinecke
2021-01-09 10:42 ` Christoph Hellwig [this message]
2021-01-09 10:42 ` [dm-devel] [PATCH 6/6] nvme: allow revalidate to set a namespace read-only Christoph Hellwig
2021-01-09 20:27   ` Chaitanya Kulkarni
2021-01-10 15:01   ` Hannes Reinecke
  -- strict thread matches above, loose matches on Subject: below --
2020-12-08 16:28 [dm-devel] split hard read-only vs read-only policy v3 Christoph Hellwig
2020-12-08 16:28 ` [dm-devel] [PATCH 5/6] rbd: remove the ->set_read_only method Christoph Hellwig
2020-12-09  2:52   ` Ming Lei
2020-12-07 13:19 [dm-devel] split hard read-only vs read-only policy v2 Christoph Hellwig
2020-12-07 13:19 ` [dm-devel] [PATCH 5/6] rbd: remove the ->set_read_only method Christoph Hellwig
2020-12-07 14:57   ` Ilya Dryomov
2020-12-08  5:30   ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210109104254.1077093-6-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dm-devel@redhat.com \
    --cc=dongsheng.yang@easystack.cn \
    --cc=idryomov@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=martin.petersen@oracle.com \
    --cc=olkuroch@cisco.com \
    --cc=sagi@grimberg.me \
    --cc=snitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).