lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250327055706.3668207-1-chizhiling@163.com>
Date: Thu, 27 Mar 2025 13:57:06 +0800
From: Chi Zhiling <chizhiling@....com>
To: cem@...nel.org,
	djwong@...nel.org,
	brauner@...nel.org
Cc: linux-xfs@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	linux-fsdevel@...r.kernel.org,
	Chi Zhiling <chizhiling@...inos.cn>
Subject: [PATCH] iomap: Rename iomap_last_written_block to iomap_first_unchanged_block

From: Chi Zhiling <chizhiling@...inos.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@...inos.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ