From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: <ntfs3@lists.linux.dev>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
<linux-fsdevel@vger.kernel.org>
Subject: [PATCH 01/11] fs/ntfs3: Use bh_read to simplify code
Date: Wed, 15 Feb 2023 17:34:13 +0400 [thread overview]
Message-ID: <878105e3-d075-4d4e-5c47-3f22f95e23c8@paragon-software.com> (raw)
In-Reply-To: <d7c91201-5e09-5c06-3283-7887f5a5b7f1@paragon-software.com>
The duplicating code is replaced by a generic function bh_read()
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
---
fs/ntfs3/file.c | 10 ++--------
fs/ntfs3/inode.c | 1 +
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c
index d294cd975688..d37df7376543 100644
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -223,16 +223,10 @@ static int ntfs_zero_range(struct inode *inode,
u64 vbo, u64 vbo_to)
set_buffer_uptodate(bh);
if (!buffer_uptodate(bh)) {
- lock_buffer(bh);
- bh->b_end_io = end_buffer_read_sync;
- get_bh(bh);
- submit_bh(REQ_OP_READ, bh);
-
- wait_on_buffer(bh);
- if (!buffer_uptodate(bh)) {
+ err = bh_read(bh, 0);
+ if (err < 0) {
unlock_page(page);
put_page(page);
- err = -EIO;
goto out;
}
}
diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c
index e80e94325467..5e06299591ed 100644
--- a/fs/ntfs3/inode.c
+++ b/fs/ntfs3/inode.c
@@ -648,6 +648,7 @@ static noinline int ntfs_get_block_vbo(struct inode
*inode, u64 vbo,
bh->b_size = block_size;
off = vbo & (PAGE_SIZE - 1);
set_bh_page(bh, page, off);
+
err = bh_read(bh, 0);
if (err < 0)
goto out;
--
2.34.1
next prev parent reply other threads:[~2023-02-15 13:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-15 13:33 [PATCH 00/11] fs/ntfs3: Bugfix and refactoring Konstantin Komarov
2023-02-15 13:34 ` Konstantin Komarov [this message]
2023-02-15 13:34 ` [PATCH 02/11] fs/ntfs3: Remove noacsrules Konstantin Komarov
2023-02-15 13:35 ` [PATCH 03/11] fs/ntfs3: Fix ntfs_create_inode() Konstantin Komarov
2023-02-15 13:36 ` [PATCH 04/11] fs/ntfs3: Optimization in ntfs_set_state() Konstantin Komarov
2023-02-15 13:36 ` [PATCH 05/11] fs/ntfs3: Undo endian changes Konstantin Komarov
2023-02-15 13:37 ` [PATCH 06/11] fs/ntfs3: Undo critial modificatins to keep directory consistency Konstantin Komarov
2023-02-15 13:38 ` [PATCH 07/11] fs/ntfs3: Remove field sbi->used.bitmap.set_tail Konstantin Komarov
2023-02-15 13:38 ` [PATCH 08/11] fs/ntfs3: Changed ntfs_get_acl() to use dentry Konstantin Komarov
2023-02-15 13:39 ` [PATCH 09/11] fs/ntfs3: Code formatting and refactoring Konstantin Komarov
2023-02-15 13:39 ` [PATCH 10/11] fs/ntfs3: Add missed "nocase" in ntfs_show_options Konstantin Komarov
2023-02-15 13:40 ` [PATCH 11/11] fs/ntfs3: Print details about mount fails Konstantin Komarov
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=878105e3-d075-4d4e-5c47-3f22f95e23c8@paragon-software.com \
--to=almaz.alexandrovich@paragon-software.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ntfs3@lists.linux.dev \
/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).