···609609 call_srcu(&set->tags_srcu, &tags->rcu_head, blk_mq_free_tags_callback);610610}611611612612-int blk_mq_tag_update_depth(struct blk_mq_hw_ctx *hctx,613613- struct blk_mq_tags **tagsptr, unsigned int tdepth)614614-{615615- struct blk_mq_tags *tags = *tagsptr;616616-617617- /*618618- * If we are allowed to grow beyond the original size, allocate619619- * a new set of tags before freeing the old one.620620- */621621- if (tdepth > tags->nr_tags) {622622- struct blk_mq_tag_set *set = hctx->queue->tag_set;623623- struct blk_mq_tags *new;624624-625625- new = blk_mq_alloc_map_and_rqs(set, hctx->queue_num, tdepth);626626- if (!new)627627- return -ENOMEM;628628-629629- blk_mq_free_map_and_rqs(set, *tagsptr, hctx->queue_num);630630- hctx->queue->elevator->et->tags[hctx->queue_num] = new;631631- *tagsptr = new;632632- } else {633633- /*634634- * Don't need (or can't) update reserved tags here, they635635- * remain static and should never need resizing.636636- */637637- sbitmap_queue_resize(&tags->bitmap_tags,638638- tdepth - tags->nr_reserved_tags);639639- }640640-641641- return 0;642642-}643643-644612void blk_mq_tag_resize_shared_tags(struct blk_mq_tag_set *set, unsigned int size)645613{646614 struct blk_mq_tags *tags = set->shared_tags;
-2
block/blk-mq.h
···184184void blk_mq_put_tag(struct blk_mq_tags *tags, struct blk_mq_ctx *ctx,185185 unsigned int tag);186186void blk_mq_put_tags(struct blk_mq_tags *tags, int *tag_array, int nr_tags);187187-int blk_mq_tag_update_depth(struct blk_mq_hw_ctx *hctx,188188- struct blk_mq_tags **tags, unsigned int depth);189187void blk_mq_tag_resize_shared_tags(struct blk_mq_tag_set *set,190188 unsigned int size);191189void blk_mq_tag_update_sched_shared_tags(struct request_queue *q);