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
155155 unsigned open_partitions; /* number of open partitions */
156156
157157 struct backing_dev_info *bdi;
158+ struct kobject queue_kobj; /* the queue/ directory */
158159 struct kobject *slave_dir;
159160 #ifdef CONFIG_BLOCK_HOLDER_DEPRECATED
160161 struct list_head slave_bdevs;
@@ -430,10 +431,7 @@ struct request_queue { · 269 unmodified lines
430431
431432 struct gendisk *disk;
432433
433− /*
434− * queue kobject
435− */
436− struct kobject kobj;
434+ refcount_t refs;
437435
438436 /*
439437 * mq queue kobject