mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
ext4: factor out ext4_free_ext_path()
Factor out ext4_free_ext_path() to free extent path. As after previous patch 'ext4_ext_drop_refs()' is only used in 'extents.c', so make it static. Signed-off-by: Ye Bin <yebin10@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20220924021211.3831551-3-yebin10@huawei.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
@@ -32,8 +32,7 @@ get_ext_path(struct inode *inode, ext4_lblk_t lblock,
|
||||
if (IS_ERR(path))
|
||||
return PTR_ERR(path);
|
||||
if (path[ext_depth(inode)].p_ext == NULL) {
|
||||
ext4_ext_drop_refs(path);
|
||||
kfree(path);
|
||||
ext4_free_ext_path(path);
|
||||
*ppath = NULL;
|
||||
return -ENODATA;
|
||||
}
|
||||
@@ -106,8 +105,7 @@ mext_check_coverage(struct inode *inode, ext4_lblk_t from, ext4_lblk_t count,
|
||||
}
|
||||
ret = 1;
|
||||
out:
|
||||
ext4_ext_drop_refs(path);
|
||||
kfree(path);
|
||||
ext4_free_ext_path(path);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -691,8 +689,7 @@ out:
|
||||
ext4_discard_preallocations(donor_inode, 0);
|
||||
}
|
||||
|
||||
ext4_ext_drop_refs(path);
|
||||
kfree(path);
|
||||
ext4_free_ext_path(path);
|
||||
ext4_double_up_write_data_sem(orig_inode, donor_inode);
|
||||
unlock_two_nondirectories(orig_inode, donor_inode);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user