@@ -263,14 +263,6 @@ static struct blkcg_gq *blkg_alloc(struct blkcg *blkcg, struct gendisk *disk,
263
263
return NULL ;
264
264
}
265
265
266
- static void blkg_update_hint (struct blkcg * blkcg , struct blkcg_gq * blkg )
267
- {
268
- lockdep_assert_held (& blkg -> q -> queue_lock );
269
-
270
- if (blkcg != & blkcg_root && blkg != rcu_dereference (blkcg -> blkg_hint ))
271
- rcu_assign_pointer (blkcg -> blkg_hint , blkg );
272
- }
273
-
274
266
/*
275
267
* If @new_blkg is %NULL, this function tries to allocate a new one as
276
268
* necessary using %GFP_NOWAIT. @new_blkg is always consumed on return.
@@ -383,7 +375,9 @@ static struct blkcg_gq *blkg_lookup_create(struct blkcg *blkcg,
383
375
spin_lock_irqsave (& q -> queue_lock , flags );
384
376
blkg = blkg_lookup (blkcg , q );
385
377
if (blkg ) {
386
- blkg_update_hint (blkcg , blkg );
378
+ if (blkcg != & blkcg_root &&
379
+ blkg != rcu_dereference (blkcg -> blkg_hint ))
380
+ rcu_assign_pointer (blkcg -> blkg_hint , blkg );
387
381
goto found ;
388
382
}
389
383
@@ -680,10 +674,8 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
680
674
}
681
675
682
676
blkg = blkg_lookup (blkcg , q );
683
- if (blkg ) {
684
- blkg_update_hint (blkcg , blkg );
677
+ if (blkg )
685
678
goto success ;
686
- }
687
679
688
680
/*
689
681
* Create blkgs walking down from blkcg_root to @blkcg, so that all
@@ -727,7 +719,6 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
727
719
728
720
blkg = blkg_lookup (pos , q );
729
721
if (blkg ) {
730
- blkg_update_hint (pos , blkg );
731
722
blkg_free (new_blkg );
732
723
} else {
733
724
blkg = blkg_create (pos , disk , new_blkg );
0 commit comments