From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>,
linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 10/10] block: move struct block_device to blk_types.h
Date: Sat, 20 Jun 2020 09:16:44 +0200 [thread overview]
Message-ID: <20200620071644.463185-11-hch@lst.de> (raw)
In-Reply-To: <20200620071644.463185-1-hch@lst.de>
Move the struct block_device definition together with most of the
block layer definitions, as it has nothing to do with the rest of fs.h.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/adfs/super.c | 1 +
fs/befs/linuxvfs.c | 1 +
fs/efs/super.c | 1 +
fs/jfs/jfs_mount.c | 1 +
fs/jfs/resize.c | 1 +
include/linux/blk_types.h | 39 ++++++++++++++++++++++++++++++++++++-
include/linux/blkdev.h | 1 +
include/linux/dasd_mod.h | 2 ++
include/linux/fs.h | 41 ---------------------------------------
9 files changed, 46 insertions(+), 42 deletions(-)
diff --git a/fs/adfs/super.c b/fs/adfs/super.c
index a3cc8ecb50da1a..d553bb5bc17abd 100644
--- a/fs/adfs/super.c
+++ b/fs/adfs/super.c
@@ -12,6 +12,7 @@
#include <linux/slab.h>
#include <linux/statfs.h>
#include <linux/user_namespace.h>
+#include <linux/blkdev.h>
#include "adfs.h"
#include "dir_f.h"
#include "dir_fplus.h"
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 64cdf4d8e42451..2482032021cac7 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -22,6 +22,7 @@
#include <linux/cred.h>
#include <linux/exportfs.h>
#include <linux/seq_file.h>
+#include <linux/blkdev.h>
#include "befs.h"
#include "btree.h"
diff --git a/fs/efs/super.c b/fs/efs/super.c
index 4a6ebff2af76f3..a4a945d0ac6a42 100644
--- a/fs/efs/super.c
+++ b/fs/efs/super.c
@@ -13,6 +13,7 @@
#include <linux/slab.h>
#include <linux/buffer_head.h>
#include <linux/vfs.h>
+#include <linux/blkdev.h>
#include "efs.h"
#include <linux/efs_vh.h>
diff --git a/fs/jfs/jfs_mount.c b/fs/jfs/jfs_mount.c
index eb8b9e233d73db..2935d4c776ec75 100644
--- a/fs/jfs/jfs_mount.c
+++ b/fs/jfs/jfs_mount.c
@@ -36,6 +36,7 @@
#include <linux/fs.h>
#include <linux/buffer_head.h>
+#include <linux/blkdev.h>
#include "jfs_incore.h"
#include "jfs_filsys.h"
diff --git a/fs/jfs/resize.c b/fs/jfs/resize.c
index 66acea9d878b97..bde787c354fcc1 100644
--- a/fs/jfs/resize.c
+++ b/fs/jfs/resize.c
@@ -6,6 +6,7 @@
#include <linux/fs.h>
#include <linux/buffer_head.h>
#include <linux/quotaops.h>
+#include <linux/blkdev.h>
#include "jfs_incore.h"
#include "jfs_filsys.h"
#include "jfs_metapage.h"
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index ccb895f911b185..a602132cbe32c2 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -14,12 +14,49 @@ struct bio_set;
struct bio;
struct bio_integrity_payload;
struct page;
-struct block_device;
struct io_context;
struct cgroup_subsys_state;
typedef void (bio_end_io_t) (struct bio *);
struct bio_crypt_ctx;
+struct block_device {
+ dev_t bd_dev; /* not a kdev_t - it's a search key */
+ int bd_openers;
+ struct inode * bd_inode; /* will die */
+ struct super_block * bd_super;
+ struct mutex bd_mutex; /* open/close mutex */
+ void * bd_claiming;
+ void * bd_holder;
+ int bd_holders;
+ bool bd_write_holder;
+#ifdef CONFIG_SYSFS
+ struct list_head bd_holder_disks;
+#endif
+ struct block_device * bd_contains;
+ unsigned bd_block_size;
+ u8 bd_partno;
+ struct hd_struct * bd_part;
+ /* number of times partitions within this device have been opened. */
+ unsigned bd_part_count;
+ int bd_invalidated;
+ struct gendisk * bd_disk;
+ struct request_queue * bd_queue;
+ struct backing_dev_info *bd_bdi;
+ struct list_head bd_list;
+ /*
+ * Private data. You must have bd_claim'ed the block_device
+ * to use this. NOTE: bd_claim allows an owner to claim
+ * the same device multiple times, the owner must take special
+ * care to not mess up bd_private for that case.
+ */
+ unsigned long bd_private;
+
+ /* The counter of freeze processes */
+ int bd_fsfreeze_count;
+ /* Mutex for freeze */
+ struct mutex bd_fsfreeze_mutex;
+} __randomize_layout;
+
/*
* Block error status values. See block/blk-core:blk_errors for the details.
* Alpha cannot write a byte atomically, so we need to use 32-bit value.
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0f021ee2ce1c3b..60d07e89582bfa 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1932,6 +1932,7 @@ void bd_abort_claiming(struct block_device *bdev, struct block_device *whole,
void *holder);
void blkdev_put(struct block_device *bdev, fmode_t mode);
+struct block_device *I_BDEV(struct inode *inode);
struct block_device *bdget(dev_t);
struct block_device *bdgrab(struct block_device *bdev);
void bdput(struct block_device *);
diff --git a/include/linux/dasd_mod.h b/include/linux/dasd_mod.h
index d39abad2ff6e4c..14e6cf8c62677f 100644
--- a/include/linux/dasd_mod.h
+++ b/include/linux/dasd_mod.h
@@ -4,6 +4,8 @@
#include <asm/dasd.h>
+struct gendisk;
+
extern int dasd_biodasdinfo(struct gendisk *disk, dasd_information2_t *info);
#endif
diff --git a/include/linux/fs.h b/include/linux/fs.h
index add30c3bdf9a28..1d7c4f7465d24c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -470,45 +470,6 @@ struct address_space {
* must be enforced here for CRIS, to let the least significant bit
* of struct page's "mapping" pointer be used for PAGE_MAPPING_ANON.
*/
-struct request_queue;
-
-struct block_device {
- dev_t bd_dev; /* not a kdev_t - it's a search key */
- int bd_openers;
- struct inode * bd_inode; /* will die */
- struct super_block * bd_super;
- struct mutex bd_mutex; /* open/close mutex */
- void * bd_claiming;
- void * bd_holder;
- int bd_holders;
- bool bd_write_holder;
-#ifdef CONFIG_SYSFS
- struct list_head bd_holder_disks;
-#endif
- struct block_device * bd_contains;
- unsigned bd_block_size;
- u8 bd_partno;
- struct hd_struct * bd_part;
- /* number of times partitions within this device have been opened. */
- unsigned bd_part_count;
- int bd_invalidated;
- struct gendisk * bd_disk;
- struct request_queue * bd_queue;
- struct backing_dev_info *bd_bdi;
- struct list_head bd_list;
- /*
- * Private data. You must have bd_claim'ed the block_device
- * to use this. NOTE: bd_claim allows an owner to claim
- * the same device multiple times, the owner must take special
- * care to not mess up bd_private for that case.
- */
- unsigned long bd_private;
-
- /* The counter of freeze processes */
- int bd_fsfreeze_count;
- /* Mutex for freeze */
- struct mutex bd_fsfreeze_mutex;
-} __randomize_layout;
/* XArray tags, for tagging dirty and writeback pages in the pagecache. */
#define PAGECACHE_TAG_DIRTY XA_MARK_0
@@ -907,8 +868,6 @@ static inline unsigned imajor(const struct inode *inode)
return MAJOR(inode->i_rdev);
}
-extern struct block_device *I_BDEV(struct inode *inode);
-
struct fown_struct {
rwlock_t lock; /* protects pid, uid, euid fields */
struct pid *pid; /* pid or -pgrp where SIGIO should be sent */
--
2.26.2
next prev parent reply other threads:[~2020-06-20 7:17 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-20 7:16 move block bits out of fs.h Christoph Hellwig
2020-06-20 7:16 ` [PATCH 01/10] tty/sysrq: emergency_thaw_all does not depend on CONFIG_BLOCK Christoph Hellwig
2020-06-20 7:21 ` Greg Kroah-Hartman
2020-06-21 2:54 ` Bart Van Assche
2020-06-22 8:48 ` Johannes Thumshirn
2020-06-20 7:16 ` [PATCH 02/10] block: mark bd_finish_claiming static Christoph Hellwig
2020-06-21 2:54 ` Bart Van Assche
2020-06-22 8:47 ` Johannes Thumshirn
2020-06-20 7:16 ` [PATCH 03/10] fs: remove an unused block_device_operations forward declaration Christoph Hellwig
2020-06-21 2:55 ` Bart Van Assche
2020-06-22 9:12 ` Johannes Thumshirn
2020-06-20 7:16 ` [PATCH 04/10] fs: remove the HAVE_UNLOCKED_IOCTL and HAVE_COMPAT_IOCTL defines Christoph Hellwig
2020-06-21 2:56 ` Bart Van Assche
2020-06-22 9:13 ` Johannes Thumshirn
2020-06-20 7:16 ` [PATCH 05/10] fs: remove the mount_bdev and kill_block_super stubs Christoph Hellwig
2020-06-22 9:26 ` Johannes Thumshirn
2020-06-20 7:16 ` [PATCH 06/10] block: simplify sb_is_blkdev_sb Christoph Hellwig
2020-06-21 2:57 ` Bart Van Assche
2020-06-22 9:27 ` Johannes Thumshirn
2020-06-20 7:16 ` [PATCH 07/10] block: move block-related definitions out of fs.h Christoph Hellwig
2020-06-22 9:33 ` Johannes Thumshirn
2020-06-20 7:16 ` [PATCH 08/10] fs: move the buffer_heads_over_limit stub to buffer_head.h Christoph Hellwig
2020-06-21 3:03 ` Bart Van Assche
2020-06-22 9:36 ` Johannes Thumshirn
2020-06-20 7:16 ` [PATCH 09/10] block: reduce ifdef CONFIG_BLOCK madness in headers Christoph Hellwig
2020-06-20 7:16 ` Christoph Hellwig [this message]
2020-06-22 9:42 ` [PATCH 10/10] block: move struct block_device to blk_types.h Johannes Thumshirn
2020-06-24 15:09 ` move block bits out of fs.h Jens Axboe
2020-06-24 15:12 ` Christoph Hellwig
2020-06-24 15:14 ` Jens Axboe
2020-06-24 15:14 ` Christoph Hellwig
2020-06-24 15:16 ` 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=20200620071644.463185-11-hch@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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).