From: Chi Zhiling <chizhiling@163.com>
To: cem@kernel.org, djwong@kernel.org, brauner@kernel.org
Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org,
Chi Zhiling <chizhiling@kylinos.cn>
Subject: [PATCH] iomap: Rename iomap_last_written_block to iomap_first_unchanged_block
Date: Thu, 27 Mar 2025 13:57:06 +0800 [thread overview]
Message-ID: <20250327055706.3668207-1-chizhiling@163.com> (raw)
From: Chi Zhiling <chizhiling@kylinos.cn>
This renames iomap_last_written_block() to iomap_first_unchanged_block()
to better reflect its actual behavior of finding the first unmodified
block after partial writes, improving code readability.
Signed-off-by: Chi Zhiling <chizhiling@kylinos.cn>
---
fs/xfs/xfs_iomap.c | 2 +-
include/linux/iomap.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 5dd0922fe2d1..d4b0358015ab 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -1277,7 +1277,7 @@ xfs_buffered_write_iomap_end(
return 0;
/* Nothing to do if we've written the entire delalloc extent */
- start_byte = iomap_last_written_block(inode, offset, written);
+ start_byte = iomap_first_unchanged_block(inode, offset, written);
end_byte = round_up(offset + length, i_blocksize(inode));
if (start_byte >= end_byte)
return 0;
diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index 2de7a5e7d67d..88d0da23426c 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -308,7 +308,7 @@ static inline const struct iomap *iomap_iter_srcmap(const struct iomap_iter *i)
* If nothing was written, round @pos down to point at the first block in
* the range, else round up to include the partially written block.
*/
-static inline loff_t iomap_last_written_block(struct inode *inode, loff_t pos,
+static inline loff_t iomap_first_unchanged_block(struct inode *inode, loff_t pos,
ssize_t written)
{
if (unlikely(!written))
--
2.43.0
next reply other threads:[~2025-03-27 5:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-27 5:57 Chi Zhiling [this message]
2025-03-27 10:35 ` Christoph Hellwig
2025-03-27 11:46 ` Chi Zhiling
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=20250327055706.3668207-1-chizhiling@163.com \
--to=chizhiling@163.com \
--cc=brauner@kernel.org \
--cc=cem@kernel.org \
--cc=chizhiling@kylinos.cn \
--cc=djwong@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@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
all inboxes | Powered by JetHome®