iomap: Rename iomap_last_written_block to iomap_first_unchanged_block
Subsystems (3)
PATCH 1/1 iomap: Rename iomap_last_written_block to iomap_first_unchanged_block
From: Chi Zhiling <[email protected]>
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.
--- fs/xfs/xfs_iomap.c | 2 +- include/linux/iomap.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
fs/xfs/xfs_iomap.c +1 -1
@@ -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 ;
include/linux/iomap.h +1 -1
@@ -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))
Signature · 1 line
2.43.0
Quoted 5 lines · Chi Zhiling
From: Chi Zhiling <[email protected]>
This renames
iomap_last_written_block()toiomap_first_unchanged_block()to better reflect its actual behavior of finding the first unmodified block after partial writes, improving code readability.
Does it? I it used in the context of a write operation where uncached is not exactly well define. I'm not a native speaker, but I don't see an improvement here (then again I picked the current name, so I might be biassed).
Quoted 1 line
+static inline
loff_tiomap_first_unchanged_block(struct inode *inode,loff_tpos,
Either way please avoid the overly long line.
Quoted 11 lines · Christoph Hellwig
Quoted 5 lines · Chi Zhiling
From: Chi Zhiling <[email protected]>
This renames
iomap_last_written_block()toiomap_first_unchanged_block()to better reflect its actual behavior of finding the first unmodified block after partial writes, improving code readability.Does it? I it used in the context of a write operation where uncached is not exactly well define. I'm not a native speaker, but I don't see an improvement here (then again I picked the current name, so I might be biassed).
Okay, actually 'last_written_block' also makes sense, it's just that it returns the end of the last written block, not the beginning
thanks,
Chi Zhiling