aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/blk_types.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-06-20 09:16:44 +0200
committerJens Axboe <axboe@kernel.dk>2020-06-24 09:16:02 -0600
commit621c1f42945e76015c3a585e7a9fe6e71665eba0 (patch)
treeb7e0b87fa25920b779c319cb13785b61cde16603 /include/linux/blk_types.h
parentblock: reduce ifdef CONFIG_BLOCK madness in headers (diff)
downloadwireguard-linux-621c1f42945e76015c3a585e7a9fe6e71665eba0.tar.xz
wireguard-linux-621c1f42945e76015c3a585e7a9fe6e71665eba0.zip
block: move struct block_device to blk_types.h
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>
Diffstat (limited to 'include/linux/blk_types.h')
-rw-r--r--include/linux/blk_types.h39
1 files changed, 38 insertions, 1 deletions
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index ccb895f911b1..a602132cbe32 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.