From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 2/4] btrfs: Remove redundant bio_get/set from submit_dio_repair_bio
Date: Wed, 13 Dec 2017 10:25:38 +0200 [thread overview]
Message-ID: <1513153540-10737-3-git-send-email-nborisov@suse.com> (raw)
In-Reply-To: <1513153540-10737-1-git-send-email-nborisov@suse.com>
The bio that is passsed is the newly created repair bio which already
has a reference count of 1, which is going to be consumed by the
endio routine on successful submission. On error the handler also
calls bio_put.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/inode.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 9ad8c9321c8f..6d2fe773d479 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -7941,15 +7941,12 @@ static inline blk_status_t submit_dio_repair_bio(struct inode *inode,
BUG_ON(bio_op(bio) == REQ_OP_WRITE);
- bio_get(bio);
-
ret = btrfs_bio_wq_end_io(fs_info, bio, BTRFS_WQ_ENDIO_DIO_REPAIR);
if (ret)
- goto err;
+ return ret;
ret = btrfs_map_bio(fs_info, bio, mirror_num, 0);
-err:
- bio_put(bio);
+
return ret;
}
--
2.7.4
next prev parent reply other threads:[~2017-12-13 8:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-13 8:25 [PATCH 0/4] Cleanup of bio_get/set Nikolay Borisov
2017-12-13 8:25 ` [PATCH 1/4] btrfs: Remove redundant bio_get/set calls in compressed read/write paths Nikolay Borisov
2017-12-13 8:25 ` Nikolay Borisov [this message]
2017-12-13 8:25 ` [PATCH 3/4] btrfs: Remove redundan bio_get/bio_set pair from submit_one_bio Nikolay Borisov
2017-12-13 8:25 ` [PATCH 4/4] btrfs: Remove redundant pair of bio_get/set in __btrfs_submit_dio_bio Nikolay Borisov
2018-01-02 15:40 ` [PATCH 0/4] Cleanup of bio_get/set David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1513153540-10737-3-git-send-email-nborisov@suse.com \
--to=nborisov@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).