Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 13589864 authored by Tejun Heo's avatar Tejun Heo Committed by Jens Axboe
Browse files

blkcg: __blkg_lookup_create() doesn't need radix preload



There's no point in calling radix_tree_preload() if preloading doesn't
use more permissible GFP mask.  Drop preloading from
__blkg_lookup_create().

While at it, drop sparse locking annotation which no longer applies.

v2: Vivek pointed out the odd preload usage.  Instead of updating,
    just drop it.

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarVivek Goyal <vgoyal@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 6d935928
Loading
Loading
Loading
Loading
+1 −9
Original line number Original line Diff line number Diff line
@@ -177,7 +177,6 @@ EXPORT_SYMBOL_GPL(blkg_lookup);


static struct blkcg_gq *__blkg_lookup_create(struct blkcg *blkcg,
static struct blkcg_gq *__blkg_lookup_create(struct blkcg *blkcg,
					     struct request_queue *q)
					     struct request_queue *q)
	__releases(q->queue_lock) __acquires(q->queue_lock)
{
{
	struct blkcg_gq *blkg;
	struct blkcg_gq *blkg;
	int ret;
	int ret;
@@ -203,10 +202,6 @@ static struct blkcg_gq *__blkg_lookup_create(struct blkcg *blkcg,
		goto err_put;
		goto err_put;


	/* insert */
	/* insert */
	ret = radix_tree_preload(GFP_ATOMIC);
	if (ret)
		goto err_free;

	spin_lock(&blkcg->lock);
	spin_lock(&blkcg->lock);
	ret = radix_tree_insert(&blkcg->blkg_tree, q->id, blkg);
	ret = radix_tree_insert(&blkcg->blkg_tree, q->id, blkg);
	if (likely(!ret)) {
	if (likely(!ret)) {
@@ -215,14 +210,11 @@ static struct blkcg_gq *__blkg_lookup_create(struct blkcg *blkcg,
	}
	}
	spin_unlock(&blkcg->lock);
	spin_unlock(&blkcg->lock);


	radix_tree_preload_end();

	if (!ret)
	if (!ret)
		return blkg;
		return blkg;
err_free:
	blkg_free(blkg);
err_put:
err_put:
	css_put(&blkcg->css);
	css_put(&blkcg->css);
	blkg_free(blkg);
	return ERR_PTR(ret);
	return ERR_PTR(ret);
}
}