From: Shida Zhang <[email protected]>

Replace duplicate bio chaining logic with the common
bio_chain_and_submit helper function.

Signed-off-by: Shida Zhang <[email protected]>
---
 fs/ntfs3/fsntfs.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c
index c7a2f191254..35685ee4ed2 100644
--- a/fs/ntfs3/fsntfs.c
+++ b/fs/ntfs3/fsntfs.c
@@ -1514,11 +1514,7 @@ int ntfs_bio_pages(struct ntfs_sb_info *sbi, const 
struct runs_tree *run,
                len = ((u64)clen << cluster_bits) - off;
 new_bio:
                new = bio_alloc(bdev, nr_pages - page_idx, op, GFP_NOFS);
-               if (bio) {
-                       bio_chain(bio, new);
-                       submit_bio(bio);
-               }
-               bio = new;
+               bio = bio_chain_and_submit(bio, new);
                bio->bi_iter.bi_sector = lbo >> 9;
 
                while (len) {
@@ -1611,11 +1607,7 @@ int ntfs_bio_fill_1(struct ntfs_sb_info *sbi, const 
struct runs_tree *run)
                len = (u64)clen << cluster_bits;
 new_bio:
                new = bio_alloc(bdev, BIO_MAX_VECS, REQ_OP_WRITE, GFP_NOFS);
-               if (bio) {
-                       bio_chain(bio, new);
-                       submit_bio(bio);
-               }
-               bio = new;
+               bio = bio_chain_and_submit(bio, new);
                bio->bi_iter.bi_sector = lbo >> 9;
 
                for (;;) {
-- 
2.34.1


Reply via email to