mirror of
https://github.com/torvalds/linux.git
synced 2025-08-15 22:21:42 +02:00
ext4: get rid of ppath in ext4_ext_insert_extent()
The use of path and ppath is now very confusing, so to make the code more readable, pass path between functions uniformly, and get rid of ppath. To get rid of the ppath in ext4_ext_insert_extent(), the following is done here: * Free the extents path when an error is encountered. * Its caller needs to update ppath if it uses ppath. * Free path when npath is used, free npath when it is not used. * The got_allocated_blocks label in ext4_ext_map_blocks() does not update err now, so err is updated to 0 if the err returned by ext4_ext_search_right() is greater than 0 and is about to enter got_allocated_blocks. No functional changes. Signed-off-by: Baokun Li <libaokun1@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> Tested-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> Link: https://patch.msgid.link/20240822023545.1994557-15-libaokun@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
parent
a000bc8678
commit
f7d1331f16
4 changed files with 61 additions and 47 deletions
|
@ -1803,12 +1803,12 @@ static int ext4_fc_replay_add_range(struct super_block *sb,
|
|||
if (ext4_ext_is_unwritten(ex))
|
||||
ext4_ext_mark_unwritten(&newex);
|
||||
down_write(&EXT4_I(inode)->i_data_sem);
|
||||
ret = ext4_ext_insert_extent(
|
||||
NULL, inode, &path, &newex, 0);
|
||||
path = ext4_ext_insert_extent(NULL, inode,
|
||||
path, &newex, 0);
|
||||
up_write((&EXT4_I(inode)->i_data_sem));
|
||||
ext4_free_ext_path(path);
|
||||
if (ret)
|
||||
if (IS_ERR(path))
|
||||
goto out;
|
||||
ext4_free_ext_path(path);
|
||||
goto next;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue