block: move struct block_device to blk_types.h
authorChristoph Hellwig <hch@lst.de>
Sat, 20 Jun 2020 07:16:44 +0000 (09:16 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 24 Jun 2020 15:16:02 +0000 (09:16 -0600)
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>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/adfs/super.c
fs/befs/linuxvfs.c
fs/efs/super.c
fs/jfs/jfs_mount.c
fs/jfs/resize.c
include/linux/blk_types.h
include/linux/blkdev.h
include/linux/dasd_mod.h
include/linux/fs.h

index a3cc8ec..d553bb5 100644 (file)
@@ -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"
index 64cdf4d..2482032 100644 (file)
@@ -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"
index 4a6ebff..a4a945d 100644 (file)
@@ -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>
index eb8b9e2..2935d4c 100644 (file)
@@ -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"
index 66acea9..bde787c 100644 (file)
@@ -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"
index ccb895f..a602132 100644 (file)
@@ -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.
index f788bdd..1549778 100644 (file)
@@ -1930,6 +1930,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 *);
index d39abad..14e6cf8 100644 (file)
@@ -4,6 +4,8 @@
 
 #include <asm/dasd.h>
 
+struct gendisk;
+
 extern int dasd_biodasdinfo(struct gendisk *disk, dasd_information2_t *info);
 
 #endif
index add30c3..1d7c4f7 100644 (file)
@@ -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 */