Skip to content

Commit c20bc9c

Browse files
fs/ntfs3: Use bh_read to simplify code
The duplicating code is replaced by a generic function bh_read() Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
1 parent ec275bf commit c20bc9c

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

fs/ntfs3/file.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -223,16 +223,10 @@ static int ntfs_zero_range(struct inode *inode, u64 vbo, u64 vbo_to)
223223
set_buffer_uptodate(bh);
224224

225225
if (!buffer_uptodate(bh)) {
226-
lock_buffer(bh);
227-
bh->b_end_io = end_buffer_read_sync;
228-
get_bh(bh);
229-
submit_bh(REQ_OP_READ, bh);
230-
231-
wait_on_buffer(bh);
232-
if (!buffer_uptodate(bh)) {
226+
err = bh_read(bh, 0);
227+
if (err < 0) {
233228
unlock_page(page);
234229
put_page(page);
235-
err = -EIO;
236230
goto out;
237231
}
238232
}

fs/ntfs3/inode.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ static noinline int ntfs_get_block_vbo(struct inode *inode, u64 vbo,
648648
bh->b_size = block_size;
649649
off = vbo & (PAGE_SIZE - 1);
650650
set_bh_page(bh, page, off);
651+
651652
err = bh_read(bh, 0);
652653
if (err < 0)
653654
goto out;

0 commit comments

Comments
 (0)