Lines Matching refs:disk

300  * @disk: gendisk the new blkg is associated with
305 static struct blkcg_gq *blkg_alloc(struct blkcg *blkcg, struct gendisk *disk,
312 blkg = kzalloc_node(sizeof(*blkg), gfp_mask, disk->queue->node);
320 if (!blk_get_queue(disk->queue))
323 blkg->q = disk->queue;
342 if (!blkcg_policy_enabled(disk->queue, pol))
346 pd = pol->pd_alloc_fn(disk, blkcg, gfp_mask);
361 blk_put_queue(disk->queue);
375 static struct blkcg_gq *blkg_create(struct blkcg *blkcg, struct gendisk *disk,
381 lockdep_assert_held(&disk->queue->queue_lock);
384 if (blk_queue_dying(disk->queue)) {
397 new_blkg = blkg_alloc(blkcg, disk, GFP_NOWAIT | __GFP_NOWARN);
407 blkg->parent = blkg_lookup(blkcg_parent(blkcg), disk->queue);
425 ret = radix_tree_insert(&blkcg->blkg_tree, disk->queue->id, blkg);
428 list_add(&blkg->q_node, &disk->queue->blkg_list);
461 * @disk: gendisk of interest
463 * Lookup blkg for the @blkcg - @disk pair. If it doesn't exist, try to
466 * should be called under RCU read lock and takes @disk->queue->queue_lock.
472 struct gendisk *disk)
474 struct request_queue *q = disk->queue;
514 blkg = blkg_create(pos, disk, NULL);
575 static void blkg_destroy_all(struct gendisk *disk)
577 struct request_queue *q = disk->queue;
665 if (!blkg->q->disk)
667 return bdi_dev_name(blkg->q->disk->bdi);
816 struct gendisk *disk;
825 disk = ctx->bdev->bd_disk;
826 q = disk->queue;
865 new_blkg = blkg_alloc(pos, disk, GFP_KERNEL);
889 blkg = blkg_create(pos, disk, new_blkg);
1064 * with disk level statistics.
1412 int blkcg_init_disk(struct gendisk *disk)
1414 struct request_queue *q = disk->queue;
1422 new_blkg = blkg_alloc(&blkcg_root, disk, GFP_KERNEL);
1431 blkg = blkg_create(&blkcg_root, disk, new_blkg);
1440 ret = blk_ioprio_init(disk);
1444 ret = blk_throtl_init(disk);
1451 blk_ioprio_exit(disk);
1453 blkg_destroy_all(disk);
1462 void blkcg_exit_disk(struct gendisk *disk)
1464 blkg_destroy_all(disk);
1465 blk_throtl_exit(disk);
1498 * @disk: gendisk of interest
1501 * Activate @pol on @disk. Requires %GFP_KERNEL context. @disk goes through
1504 * Activation happens with @disk bypassed, so nobody would be accessing blkgs
1512 int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol)
1514 struct request_queue *q = disk->queue;
1539 pd = pol->pd_alloc_fn(disk, blkg->blkcg,
1557 pd_prealloc = pol->pd_alloc_fn(disk, blkg->blkcg,
1620 * @disk: gendisk of interest
1623 * Deactivate @pol on @disk. Follows the same synchronization rules as
1626 void blkcg_deactivate_policy(struct gendisk *disk,
1629 struct request_queue *q = disk->queue;
1913 struct gendisk *disk = current->throttle_disk;
1918 if (!disk)
1928 blkg = blkg_lookup(blkcg, disk->queue);
1937 put_disk(disk);
1945 * @disk: disk to throttle
1960 void blkcg_schedule_throttle(struct gendisk *disk, bool use_memdelay)
1965 if (current->throttle_disk != disk) {
1966 if (test_bit(GD_DEAD, &disk->state))
1968 get_device(disk_to_dev(disk));
1972 current->throttle_disk = disk;