summaryrefslogtreecommitdiff
path: root/block/bio.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-06-27 09:31:47 +0200
committerJens Axboe <axboe@kernel.dk>2020-06-29 09:09:08 -0600
commitdb9819c76c1fd48c30699381c94bba5c95dd467e (patch)
tree825e36ac36ed65f84cb81eef8218a7194182396a /block/bio.c
parent4ef2c5c2462d59024adfa090af763a33dcff2f1a (diff)
block: remove bio_disassociate_blkg
bio_disassociate_blkg has two callers, of which one immediately assigns a new value to >bi_blkg. Just open code the function in the two callers. Acked-by: Tejun Heo <tj@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bio.c')
-rw-r--r--block/bio.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/block/bio.c b/block/bio.c
index fb5533416fa6..8aef4460b32e 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -234,8 +234,12 @@ fallback:
void bio_uninit(struct bio *bio)
{
- bio_disassociate_blkg(bio);
-
+#ifdef CONFIG_BLK_CGROUP
+ if (bio->bi_blkg) {
+ blkg_put(bio->bi_blkg);
+ bio->bi_blkg = NULL;
+ }
+#endif
if (bio_integrity(bio))
bio_integrity_free(bio);
@@ -1626,21 +1630,6 @@ EXPORT_SYMBOL(bioset_init_from_src);
#ifdef CONFIG_BLK_CGROUP
/**
- * bio_disassociate_blkg - puts back the blkg reference if associated
- * @bio: target bio
- *
- * Helper to disassociate the blkg from @bio if a blkg is associated.
- */
-void bio_disassociate_blkg(struct bio *bio)
-{
- if (bio->bi_blkg) {
- blkg_put(bio->bi_blkg);
- bio->bi_blkg = NULL;
- }
-}
-EXPORT_SYMBOL_GPL(bio_disassociate_blkg);
-
-/**
* __bio_associate_blkg - associate a bio with the a blkg
* @bio: target bio
* @blkg: the blkg to associate
@@ -1656,8 +1645,8 @@ EXPORT_SYMBOL_GPL(bio_disassociate_blkg);
*/
static void __bio_associate_blkg(struct bio *bio, struct blkcg_gq *blkg)
{
- bio_disassociate_blkg(bio);
-
+ if (bio->bi_blkg)
+ blkg_put(bio->bi_blkg);
bio->bi_blkg = blkg_tryget_closest(blkg);
}