Lines Matching refs:q
54 struct request_queue *q; in blk_mq_hw_sysfs_show() local
59 q = hctx->queue; in blk_mq_hw_sysfs_show()
64 mutex_lock(&q->sysfs_lock); in blk_mq_hw_sysfs_show()
66 mutex_unlock(&q->sysfs_lock); in blk_mq_hw_sysfs_show()
160 struct request_queue *q = hctx->queue; in blk_mq_register_hctx() local
167 ret = kobject_add(&hctx->kobj, q->mq_kobj, "%u", hctx->queue_num); in blk_mq_register_hctx()
192 void blk_mq_sysfs_deinit(struct request_queue *q) in blk_mq_sysfs_deinit() argument
198 ctx = per_cpu_ptr(q->queue_ctx, cpu); in blk_mq_sysfs_deinit()
201 kobject_put(q->mq_kobj); in blk_mq_sysfs_deinit()
204 void blk_mq_sysfs_init(struct request_queue *q) in blk_mq_sysfs_init() argument
209 kobject_init(q->mq_kobj, &blk_mq_ktype); in blk_mq_sysfs_init()
212 ctx = per_cpu_ptr(q->queue_ctx, cpu); in blk_mq_sysfs_init()
214 kobject_get(q->mq_kobj); in blk_mq_sysfs_init()
221 struct request_queue *q = disk->queue; in blk_mq_sysfs_register() local
226 lockdep_assert_held(&q->sysfs_dir_lock); in blk_mq_sysfs_register()
228 ret = kobject_add(q->mq_kobj, &disk_to_dev(disk)->kobj, "mq"); in blk_mq_sysfs_register()
232 kobject_uevent(q->mq_kobj, KOBJ_ADD); in blk_mq_sysfs_register()
234 queue_for_each_hw_ctx(q, hctx, i) { in blk_mq_sysfs_register()
240 q->mq_sysfs_init_done = true; in blk_mq_sysfs_register()
246 queue_for_each_hw_ctx(q, hctx, j) { in blk_mq_sysfs_register()
251 kobject_uevent(q->mq_kobj, KOBJ_REMOVE); in blk_mq_sysfs_register()
252 kobject_del(q->mq_kobj); in blk_mq_sysfs_register()
258 struct request_queue *q = disk->queue; in blk_mq_sysfs_unregister() local
262 lockdep_assert_held(&q->sysfs_dir_lock); in blk_mq_sysfs_unregister()
264 queue_for_each_hw_ctx(q, hctx, i) in blk_mq_sysfs_unregister()
267 kobject_uevent(q->mq_kobj, KOBJ_REMOVE); in blk_mq_sysfs_unregister()
268 kobject_del(q->mq_kobj); in blk_mq_sysfs_unregister()
270 q->mq_sysfs_init_done = false; in blk_mq_sysfs_unregister()
273 void blk_mq_sysfs_unregister_hctxs(struct request_queue *q) in blk_mq_sysfs_unregister_hctxs() argument
278 mutex_lock(&q->sysfs_dir_lock); in blk_mq_sysfs_unregister_hctxs()
279 if (!q->mq_sysfs_init_done) in blk_mq_sysfs_unregister_hctxs()
282 queue_for_each_hw_ctx(q, hctx, i) in blk_mq_sysfs_unregister_hctxs()
286 mutex_unlock(&q->sysfs_dir_lock); in blk_mq_sysfs_unregister_hctxs()
289 int blk_mq_sysfs_register_hctxs(struct request_queue *q) in blk_mq_sysfs_register_hctxs() argument
295 mutex_lock(&q->sysfs_dir_lock); in blk_mq_sysfs_register_hctxs()
296 if (!q->mq_sysfs_init_done) in blk_mq_sysfs_register_hctxs()
299 queue_for_each_hw_ctx(q, hctx, i) { in blk_mq_sysfs_register_hctxs()
306 mutex_unlock(&q->sysfs_dir_lock); in blk_mq_sysfs_register_hctxs()