Merge tag 'for-5.15/block-2021-08-30' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / include / linux / genhd.h
index b47e297..c68d83c 100644 (file)
@@ -149,7 +149,6 @@ struct gendisk {
        unsigned long state;
 #define GD_NEED_PART_SCAN              0
 #define GD_READ_ONLY                   1
-#define GD_QUEUE_REF                   2
 
        struct mutex open_mutex;        /* open/close mutex */
        unsigned open_partitions;       /* number of open partitions */
@@ -215,11 +214,11 @@ static inline dev_t disk_devt(struct gendisk *disk)
 void disk_uevent(struct gendisk *disk, enum kobject_action action);
 
 /* block/genhd.c */
-extern void device_add_disk(struct device *parent, struct gendisk *disk,
-                           const struct attribute_group **groups);
-static inline void add_disk(struct gendisk *disk)
+int device_add_disk(struct device *parent, struct gendisk *disk,
+               const struct attribute_group **groups);
+static inline int add_disk(struct gendisk *disk)
 {
-       device_add_disk(NULL, disk, NULL);
+       return device_add_disk(NULL, disk, NULL);
 }
 extern void del_gendisk(struct gendisk *gp);
 
@@ -259,26 +258,10 @@ static inline sector_t get_capacity(struct gendisk *disk)
 int bdev_disk_changed(struct gendisk *disk, bool invalidate);
 void blk_drop_partitions(struct gendisk *disk);
 
-extern struct gendisk *__alloc_disk_node(int minors, int node_id);
+struct gendisk *__alloc_disk_node(struct request_queue *q, int node_id,
+               struct lock_class_key *lkclass);
 extern void put_disk(struct gendisk *disk);
-
-#define alloc_disk_node(minors, node_id)                               \
-({                                                                     \
-       static struct lock_class_key __key;                             \
-       const char *__name;                                             \
-       struct gendisk *__disk;                                         \
-                                                                       \
-       __name = "(gendisk_completion)"#minors"("#node_id")";           \
-                                                                       \
-       __disk = __alloc_disk_node(minors, node_id);                    \
-                                                                       \
-       if (__disk)                                                     \
-               lockdep_init_map(&__disk->lockdep_map, __name, &__key, 0); \
-                                                                       \
-       __disk;                                                         \
-})
-
-#define alloc_disk(minors) alloc_disk_node(minors, NUMA_NO_NODE)
+struct gendisk *__blk_alloc_disk(int node, struct lock_class_key *lkclass);
 
 /**
  * blk_alloc_disk - allocate a gendisk structure
@@ -291,15 +274,10 @@ extern void put_disk(struct gendisk *disk);
  */
 #define blk_alloc_disk(node_id)                                                \
 ({                                                                     \
-       struct gendisk *__disk = __blk_alloc_disk(node_id);             \
        static struct lock_class_key __key;                             \
                                                                        \
-       if (__disk)                                                     \
-               lockdep_init_map(&__disk->lockdep_map,                  \
-                       "(bio completion)", &__key, 0);                 \
-       __disk;                                                         \
+       __blk_alloc_disk(node_id, &__key);                              \
 })
-struct gendisk *__blk_alloc_disk(int node);
 void blk_cleanup_disk(struct gendisk *disk);
 
 int __register_blkdev(unsigned int major, const char *name,