History

block: untangle request_queue refcounting from sysfs

The kobject embedded into the request_queue is used for the queue directory in sysfs, but that is a child of the gendisks directory and is intimately tied to it. Move this kobject to the gendisk and use a refcount_t in the request_queue for the actual request_queue refcounting that is completely unrelated to the device model.

Christoph Hellwig committed 4 years ago

Commit 2bd85221 parent 40602998 files · +71 −87Browse files

Showing the changes to include/linux/blkdev.h (1 of 8 files). Show all

Unified · Split

include/linux/blkdev.h+2−4
@@ -155,6 +155,7 @@ struct gendisk { · 154 unmodified lines
155 unsigned open_partitions; /* number of open partitions */155 unsigned open_partitions; /* number of open partitions */
156 156
157 struct backing_dev_info *bdi;157 struct backing_dev_info *bdi;
158 struct kobject queue_kobj; /* the queue/ directory */
158 struct kobject *slave_dir;159 struct kobject *slave_dir;
159#ifdef CONFIG_BLOCK_HOLDER_DEPRECATED160#ifdef CONFIG_BLOCK_HOLDER_DEPRECATED
160 struct list_head slave_bdevs;161 struct list_head slave_bdevs;
@@ -430,10 +431,7 @@ struct request_queue { · 269 unmodified lines
430 431
431 struct gendisk *disk;432 struct gendisk *disk;
432 433
433 /*434 refcount_t refs;
434 * queue kobject
435 */
436 struct kobject kobj;
437 435
438 /*436 /*
439 * mq queue kobject437 * mq queue kobject