ceph-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Ilya Dryomov <idryomov@gmail.com>, Song Liu <song@kernel.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Stefan Haberland <sth@linux.ibm.com>,
	Jan Hoeppner <hoeppner@linux.ibm.com>,
	linux-block@vger.kernel.org, ceph-devel@vger.kernel.org,
	linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org,
	linux-mtd@lists.infradead.org, linux-s390@vger.kernel.org
Subject: [PATCH 09/10] block: remove set_device_ro
Date: Tue,  3 Nov 2020 11:00:17 +0100	[thread overview]
Message-ID: <20201103100018.683694-10-hch@lst.de> (raw)
In-Reply-To: <20201103100018.683694-1-hch@lst.de>

Fold set_device_ro into its only remaining caller.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/genhd.c         | 7 -------
 block/ioctl.c         | 2 +-
 include/linux/genhd.h | 1 -
 3 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/block/genhd.c b/block/genhd.c
index 0a273211fec283..a487590b365e89 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1843,13 +1843,6 @@ static void set_disk_ro_uevent(struct gendisk *gd, int ro)
 	kobject_uevent_env(&disk_to_dev(gd)->kobj, KOBJ_CHANGE, envp);
 }
 
-void set_device_ro(struct block_device *bdev, int flag)
-{
-	bdev->bd_part->policy = flag;
-}
-
-EXPORT_SYMBOL(set_device_ro);
-
 void set_disk_ro(struct gendisk *disk, int flag)
 {
 	struct disk_part_iter piter;
diff --git a/block/ioctl.c b/block/ioctl.c
index 96cb4544736468..04255dc5f3bff3 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -371,7 +371,7 @@ static int blkdev_roset(struct block_device *bdev, fmode_t mode,
 		if (ret)
 			return ret;
 	}
-	set_device_ro(bdev, n);
+	bdev->bd_part->policy = n;
 	return 0;
 }
 
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 38f23d75701379..f232f26d7c777b 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -304,7 +304,6 @@ extern void del_gendisk(struct gendisk *gp);
 extern struct gendisk *get_gendisk(dev_t dev, int *partno);
 extern struct block_device *bdget_disk(struct gendisk *disk, int partno);
 
-extern void set_device_ro(struct block_device *bdev, int flag);
 extern void set_disk_ro(struct gendisk *disk, int flag);
 
 static inline int get_disk_ro(struct gendisk *disk)
-- 
2.28.0


  parent reply	other threads:[~2020-11-03 10:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03 10:00 block ioctl cleanups v2 Christoph Hellwig
2020-11-03 10:00 ` [PATCH 01/10] mtd_blkdevs: don't override BLKFLSBUF Christoph Hellwig
2020-11-03 10:00 ` [PATCH 02/10] block: don't call into the driver for BLKFLSBUF Christoph Hellwig
2020-11-03 10:00 ` [PATCH 03/10] block: add a new set_read_only method Christoph Hellwig
2020-11-03 10:00 ` [PATCH 04/10] rbd: implement ->set_read_only to hook into BLKROSET processing Christoph Hellwig
2020-11-03 10:00 ` [PATCH 05/10] md: " Christoph Hellwig
2020-11-06  0:59   ` Song Liu
2020-11-03 10:00 ` [PATCH 06/10] dasd: " Christoph Hellwig
2020-11-05 20:56   ` Stefan Haberland
2020-11-06 14:02     ` Christoph Hellwig
2020-11-06 16:08       ` Stefan Haberland
2020-11-03 10:00 ` [PATCH 07/10] block: don't call into the driver for BLKROSET Christoph Hellwig
2020-11-03 10:00 ` [PATCH 08/10] loop: use set_disk_ro Christoph Hellwig
2020-11-03 10:00 ` Christoph Hellwig [this message]
2020-11-03 10:00 ` [PATCH 10/10] block: remove __blkdev_driver_ioctl Christoph Hellwig
2020-11-11  7:58 ` block ioctl cleanups v2 Christoph Hellwig
2020-11-11 16:13   ` Jens Axboe
2020-11-11 16:20     ` Christoph Hellwig
2020-11-11 16:23       ` Jens Axboe

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=20201103100018.683694-10-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=ceph-devel@vger.kernel.org \
    --cc=hoeppner@linux.ibm.com \
    --cc=idryomov@gmail.com \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=song@kernel.org \
    --cc=sth@linux.ibm.com \
    --cc=vigneshr@ti.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).