diff options
author | Baokun Li <libaokun1@huawei.com> | 2024-08-22 04:35:31 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2024-09-04 04:12:17 +0200 |
commit | 0be4c0c2f17bd10ae16c852f02d51a6a7b318aca (patch) | |
tree | 3590435cd94a988aef4009dbbaa42b6b846b0fd7 /fs/ext4/move_extent.c | |
parent | ext4: propagate errors from ext4_find_extent() in ext4_insert_range() (diff) | |
download | linux-0be4c0c2f17bd10ae16c852f02d51a6a7b318aca.tar.xz linux-0be4c0c2f17bd10ae16c852f02d51a6a7b318aca.zip |
ext4: get rid of ppath in ext4_find_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.
Getting rid of ppath in ext4_find_extent() requires its caller to update
ppath. These ppaths will also be dropped later. 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-12-libaokun@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to '')
-rw-r--r-- | fs/ext4/move_extent.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c index 228b56f7d047..d3e61f1be046 100644 --- a/fs/ext4/move_extent.c +++ b/fs/ext4/move_extent.c @@ -26,16 +26,17 @@ static inline int get_ext_path(struct inode *inode, ext4_lblk_t lblock, struct ext4_ext_path **ppath) { - struct ext4_ext_path *path; + struct ext4_ext_path *path = *ppath; - path = ext4_find_extent(inode, lblock, ppath, EXT4_EX_NOCACHE); + *ppath = NULL; + path = ext4_find_extent(inode, lblock, path, EXT4_EX_NOCACHE); if (IS_ERR(path)) return PTR_ERR(path); if (path[ext_depth(inode)].p_ext == NULL) { ext4_free_ext_path(path); - *ppath = NULL; return -ENODATA; } + *ppath = path; return 0; } |