Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ext4: rename ext4_block_zero_page_range() to ext4_block_zero_range()

Rename ext4_block_zero_page_range() to ext4_block_zero_range() since the
"page" naming is no longer appropriate for current context. Also change
its signature to take an inode pointer instead of an address_space. This
aligns with the caller ext4_block_zero_eof() and
ext4_zero_partial_blocks().

Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20260327102939.1095257-5-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

authored by

Zhang Yi and committed by
Theodore Ts'o
ad11526d 3b312a6f

+14 -19
+14 -19
fs/ext4/inode.c
··· 4170 4170 } 4171 4171 4172 4172 /* 4173 - * ext4_block_zero_page_range() zeros out a mapping of length 'length' 4174 - * starting from file offset 'from'. The range to be zero'd must 4175 - * be contained with in one block. If the specified range exceeds 4176 - * the end of the block it will be shortened to end of the block 4177 - * that corresponds to 'from' 4173 + * Zeros out a mapping of length 'length' starting from file offset 4174 + * 'from'. The range to be zero'd must be contained with in one block. 4175 + * If the specified range exceeds the end of the block it will be 4176 + * shortened to end of the block that corresponds to 'from'. 4178 4177 */ 4179 - static int ext4_block_zero_page_range(handle_t *handle, 4180 - struct address_space *mapping, loff_t from, loff_t length, 4181 - bool *did_zero) 4178 + static int ext4_block_zero_range(handle_t *handle, struct inode *inode, 4179 + loff_t from, loff_t length, bool *did_zero) 4182 4180 { 4183 - struct inode *inode = mapping->host; 4184 4181 unsigned blocksize = inode->i_sb->s_blocksize; 4185 4182 unsigned int max = blocksize - (from & (blocksize - 1)); 4186 4183 ··· 4222 4225 if (length > blocksize - offset) 4223 4226 length = blocksize - offset; 4224 4227 4225 - return ext4_block_zero_page_range(handle, inode->i_mapping, from, 4226 - length, NULL); 4228 + return ext4_block_zero_range(handle, inode, from, length, NULL); 4227 4229 } 4228 4230 4229 4231 int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode, 4230 4232 loff_t lstart, loff_t length) 4231 4233 { 4232 4234 struct super_block *sb = inode->i_sb; 4233 - struct address_space *mapping = inode->i_mapping; 4234 4235 unsigned partial_start, partial_end; 4235 4236 ext4_fsblk_t start, end; 4236 4237 loff_t byte_end = (lstart + length - 1); ··· 4243 4248 /* Handle partial zero within the single block */ 4244 4249 if (start == end && 4245 4250 (partial_start || (partial_end != sb->s_blocksize - 1))) { 4246 - err = ext4_block_zero_page_range(handle, mapping, 4247 - lstart, length, NULL); 4251 + err = ext4_block_zero_range(handle, inode, lstart, 4252 + length, NULL); 4248 4253 return err; 4249 4254 } 4250 4255 /* Handle partial zero out on the start of the range */ 4251 4256 if (partial_start) { 4252 - err = ext4_block_zero_page_range(handle, mapping, lstart, 4253 - sb->s_blocksize, NULL); 4257 + err = ext4_block_zero_range(handle, inode, lstart, 4258 + sb->s_blocksize, NULL); 4254 4259 if (err) 4255 4260 return err; 4256 4261 } 4257 4262 /* Handle partial zero out on the end of the range */ 4258 4263 if (partial_end != sb->s_blocksize - 1) 4259 - err = ext4_block_zero_page_range(handle, mapping, 4260 - byte_end - partial_end, 4261 - partial_end + 1, NULL); 4264 + err = ext4_block_zero_range(handle, inode, 4265 + byte_end - partial_end, 4266 + partial_end + 1, NULL); 4262 4267 return err; 4263 4268 } 4264 4269