diff mbox series

block: remove redundant bio_uninit from simple direct io

Message ID 20210626104736.911941-1-yuyufen@huawei.com (mailing list archive)
State New, archived
Headers show
Series block: remove redundant bio_uninit from simple direct io | expand

Commit Message

Yufen Yu June 26, 2021, 10:47 a.m. UTC
Since bio_endio() will call bio_uninit() for us, we can remove
it from current code path.

Signed-off-by: Yufen Yu <yuyufen@huawei.com>
---
 fs/block_dev.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Jens Axboe June 27, 2021, 10:24 p.m. UTC | #1
On 6/26/21 4:47 AM, Yufen Yu wrote:
> Since bio_endio() will call bio_uninit() for us, we can remove
> it from current code path.

What about the error path?
Yufen Yu June 28, 2021, 1:18 a.m. UTC | #2
On 2021/6/28 6:24, Jens Axboe wrote:
> On 6/26/21 4:47 AM, Yufen Yu wrote:
>> Since bio_endio() will call bio_uninit() for us, we can remove
>> it from current code path.
> 
> What about the error path?
> 

Before calling submit_bio(), we don't need bio_uninit(). After
calling submit_bio(), any error path will call bio_endio() to
end the bio. So, I think we can remove it in current path.

Thanks
Yufen
diff mbox series

Patch

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 6cc4d4cfe0c2..7a63fc3ce8d9 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -299,8 +299,6 @@  __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter,
 	if (vecs != inline_vecs)
 		kfree(vecs);
 
-	bio_uninit(&bio);
-
 	return ret;
 }