linux-nilfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Vignesh Raghavendra <vigneshr@ti.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	linux-nvme@lists.infradead.org,
	Phillip Potter <phil@philpotter.co.uk>, Chris Mason <clm@fb.com>,
	dm-devel@redhat.com, "Md. Haris Iqbal" <haris.iqbal@ionos.com>,
	Pavel Machek <pavel@ucw.cz>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Jack Wang <jinpu.wang@ionos.com>,
	linux-nilfs@vger.kernel.org, linux-scsi@vger.kernel.org,
	Richard Weinberger <richard@nod.at>,
	linux-pm@vger.kernel.org, linux-um@lists.infradead.org,
	Josef Bacik <josef@toxicpanda.com>, Coly Li <colyli@suse.de>,
	linux-block@vger.kernel.org, linux-bcache@vger.kernel.org,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	David Sterba <dsterba@suse.com>,
	Christian Brauner <brauner@kernel.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.
Subject: [PATCH 25/30] block: move a few internal definitions out of blkdev.h
Date: Thu,  8 Jun 2023 13:02:53 +0200	[thread overview]
Message-ID: <20230608110258.189493-26-hch@lst.de> (raw)
In-Reply-To: <20230608110258.189493-1-hch@lst.de>

All these helpers are only used in core block code, so move them out of
the public header.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Acked-by: Christian Brauner <brauner@kernel.org>
---
 block/blk.h            | 23 +++++++++++++++++++++--
 include/linux/blkdev.h | 27 ---------------------------
 2 files changed, 21 insertions(+), 29 deletions(-)

diff --git a/block/blk.h b/block/blk.h
index 9582fcd0df4123..6910220aa030f1 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -394,10 +394,27 @@ static inline struct bio *blk_queue_bounce(struct bio *bio,
 #ifdef CONFIG_BLK_DEV_ZONED
 void disk_free_zone_bitmaps(struct gendisk *disk);
 void disk_clear_zone_settings(struct gendisk *disk);
-#else
+int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode,
+		unsigned int cmd, unsigned long arg);
+int blkdev_zone_mgmt_ioctl(struct block_device *bdev, fmode_t mode,
+		unsigned int cmd, unsigned long arg);
+#else /* CONFIG_BLK_DEV_ZONED */
 static inline void disk_free_zone_bitmaps(struct gendisk *disk) {}
 static inline void disk_clear_zone_settings(struct gendisk *disk) {}
-#endif
+static inline int blkdev_report_zones_ioctl(struct block_device *bdev,
+		fmode_t mode, unsigned int cmd, unsigned long arg)
+{
+	return -ENOTTY;
+}
+static inline int blkdev_zone_mgmt_ioctl(struct block_device *bdev,
+		fmode_t mode, unsigned int cmd, unsigned long arg)
+{
+	return -ENOTTY;
+}
+#endif /* CONFIG_BLK_DEV_ZONED */
+
+struct block_device *bdev_alloc(struct gendisk *disk, u8 partno);
+void bdev_add(struct block_device *bdev, dev_t dev);
 
 int blk_alloc_ext_minor(void);
 void blk_free_ext_minor(unsigned int minor);
@@ -449,6 +466,8 @@ extern struct device_attribute dev_attr_events_poll_msecs;
 
 extern struct attribute_group blk_trace_attr_group;
 
+int truncate_bdev_range(struct block_device *bdev, fmode_t mode, loff_t lstart,
+		loff_t lend);
 long blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg);
 long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg);
 
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 97803603902076..6b65623e447c02 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -318,7 +318,6 @@ typedef int (*report_zones_cb)(struct blk_zone *zone, unsigned int idx,
 void disk_set_zoned(struct gendisk *disk, enum blk_zoned_model model);
 
 #ifdef CONFIG_BLK_DEV_ZONED
-
 #define BLK_ALL_ZONES  ((unsigned int)-1)
 int blkdev_report_zones(struct block_device *bdev, sector_t sector,
 			unsigned int nr_zones, report_zones_cb cb, void *data);
@@ -328,33 +327,11 @@ extern int blkdev_zone_mgmt(struct block_device *bdev, enum req_op op,
 			    gfp_t gfp_mask);
 int blk_revalidate_disk_zones(struct gendisk *disk,
 			      void (*update_driver_data)(struct gendisk *disk));
-
-extern int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode,
-				     unsigned int cmd, unsigned long arg);
-extern int blkdev_zone_mgmt_ioctl(struct block_device *bdev, fmode_t mode,
-				  unsigned int cmd, unsigned long arg);
-
 #else /* CONFIG_BLK_DEV_ZONED */
-
 static inline unsigned int bdev_nr_zones(struct block_device *bdev)
 {
 	return 0;
 }
-
-static inline int blkdev_report_zones_ioctl(struct block_device *bdev,
-					    fmode_t mode, unsigned int cmd,
-					    unsigned long arg)
-{
-	return -ENOTTY;
-}
-
-static inline int blkdev_zone_mgmt_ioctl(struct block_device *bdev,
-					 fmode_t mode, unsigned int cmd,
-					 unsigned long arg)
-{
-	return -ENOTTY;
-}
-
 #endif /* CONFIG_BLK_DEV_ZONED */
 
 /*
@@ -1493,11 +1470,7 @@ void blkdev_put(struct block_device *bdev, void *holder);
 struct block_device *blkdev_get_no_open(dev_t dev);
 void blkdev_put_no_open(struct block_device *bdev);
 
-struct block_device *bdev_alloc(struct gendisk *disk, u8 partno);
-void bdev_add(struct block_device *bdev, dev_t dev);
 struct block_device *I_BDEV(struct inode *inode);
-int truncate_bdev_range(struct block_device *bdev, fmode_t mode, loff_t lstart,
-		loff_t lend);
 
 #ifdef CONFIG_BLOCK
 void invalidate_bdev(struct block_device *bdev);
-- 
2.39.2

  parent reply	other threads:[~2023-06-08 11:02 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08 11:02 decouple block open flags from fmode_t v2 Christoph Hellwig
2023-06-08 11:02 ` [PATCH 01/30] block: also call ->open for incremental partition opens Christoph Hellwig
     [not found]   ` <20230608110258.189493-2-hch-jcswGhMUV9g@public.gmane.org>
2023-07-06  0:18     ` [f2fs-dev] " patchwork-bot+f2fs-DgEjT+Ai2ygdnm+yROfE0A
2023-08-25  2:44   ` Al Viro
2023-08-28 12:09     ` Christoph Hellwig
2023-06-08 11:02 ` [PATCH 02/30] cdrom: remove the unused bdev argument to cdrom_open Christoph Hellwig
2023-06-08 11:02 ` [PATCH 03/30] cdrom: remove the unused mode argument to cdrom_ioctl Christoph Hellwig
2023-06-08 11:02 ` [PATCH 04/30] cdrom: remove the unused cdrom_close_write release code Christoph Hellwig
2023-06-08 11:02 ` [PATCH 05/30] cdrom: track if a cdrom_device_info was opened for data Christoph Hellwig
2023-06-09  6:37   ` Hannes Reinecke
2023-06-08 11:02 ` [PATCH 06/30] cdrom: remove the unused mode argument to cdrom_release Christoph Hellwig
2023-06-08 11:02 ` [PATCH 07/30] block: pass a gendisk on bdev_check_media_change Christoph Hellwig
2023-06-08 11:02 ` [PATCH 08/30] block: pass a gendisk to ->open Christoph Hellwig
2023-06-08 11:02 ` [PATCH 09/30] block: remove the unused mode argument to ->release Christoph Hellwig
2023-06-08 11:02 ` [PATCH 10/30] block: rename blkdev_close to blkdev_release Christoph Hellwig
2023-06-08 11:02 ` [PATCH 11/30] swsusp: don't pass a stack address to blkdev_get_by_path Christoph Hellwig
2023-06-09 18:13   ` Rafael J. Wysocki
2023-06-08 11:02 ` [PATCH 12/30] bcache: " Christoph Hellwig
2023-06-08 11:02 ` [PATCH 13/30] rnbd-srv: don't pass a holder for non-exclusive blkdev_get_by_path Christoph Hellwig
2023-06-08 11:02 ` [PATCH 14/30] btrfs: " Christoph Hellwig
2023-06-08 11:02 ` [PATCH 15/30] block: use the holder as indication for exclusive opens Christoph Hellwig
2023-06-08 11:02 ` [PATCH 16/30] block: add a sb_open_mode helper Christoph Hellwig
2023-06-08 11:02 ` [PATCH 17/30] fs: remove sb->s_mode Christoph Hellwig
2023-06-08 11:02 ` [PATCH 18/30] scsi: replace the fmode_t argument to scsi_cmd_allowed with a simple bool Christoph Hellwig
2023-06-08 11:02 ` [PATCH 19/30] scsi: replace the fmode_t argument to scsi_ioctl " Christoph Hellwig
2023-06-08 11:02 ` [PATCH 20/30] scsi: replace the fmode_t argument to ->sg_io_fn " Christoph Hellwig
2023-06-08 11:02 ` [PATCH 21/30] nvme: replace the fmode_t argument to the nvme ioctl handlers " Christoph Hellwig
     [not found]   ` <20230608110258.189493-22-hch-jcswGhMUV9g@public.gmane.org>
2023-06-09 15:49     ` Keith Busch
2023-06-08 11:02 ` [PATCH 22/30] mtd: block: use a simple bool to track open for write Christoph Hellwig
2023-06-08 11:02 ` [PATCH 23/30] rnbd-srv: replace sess->open_flags with a "bool readonly" Christoph Hellwig
2023-06-08 11:02 ` [PATCH 24/30] ubd: remove commented out code in ubd_open Christoph Hellwig
2023-06-08 11:02 ` Christoph Hellwig [this message]
2023-06-08 11:02 ` [PATCH 26/30] block: remove unused fmode_t arguments from ioctl handlers Christoph Hellwig
2023-06-08 11:02 ` [PATCH 27/30] block: replace fmode_t with a block-specific type for block open flags Christoph Hellwig
2023-06-08 11:45   ` Christian Brauner
2023-06-09  6:40   ` [dm-devel] " Hannes Reinecke
2023-06-08 11:02 ` [PATCH 28/30] block: always use I_BDEV on file->f_mapping->host to find the bdev Christoph Hellwig
2023-06-08 11:02 ` [PATCH 29/30] block: store the holder in file->private_data Christoph Hellwig
2023-06-09  6:41   ` Hannes Reinecke
2023-06-08 11:02 ` [PATCH 30/30] fs: remove the now unused FMODE_* flags Christoph Hellwig
2023-06-12 14:11 ` decouple block open flags from fmode_t v2 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=20230608110258.189493-26-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=clm@fb.com \
    --cc=colyli@suse.de \
    --cc=dm-devel@redhat.com \
    --cc=dsterba@suse.com \
    --cc=haris.iqbal@ionos.com \
    --cc=jinpu.wang@ionos.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead. \
    --cc=linux-nilfs@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=martin.petersen@oracle.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=pavel@ucw.cz \
    --cc=phil@philpotter.co.uk \
    --cc=rafael@kernel.org \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    --cc=viro@zeniv.linux.org.uk \
    /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).