diff options
author | Baokun Li <libaokun1@huawei.com> | 2024-08-22 10:35:45 +0800 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2024-09-03 22:14:16 -0400 |
commit | 5f48d4d9d8556ffa934537f0c000f9c3e108da66 (patch) | |
tree | 217f09fe24ebdf47082b06163f42097864dea6e8 /fs/ext4 | |
parent | 2352e3e461926b59f01c1e39fbb0494891cff997 (diff) | |
download | linux-5f48d4d9d8556ffa934537f0c000f9c3e108da66.tar.gz linux-5f48d4d9d8556ffa934537f0c000f9c3e108da66.tar.bz2 linux-5f48d4d9d8556ffa934537f0c000f9c3e108da66.zip |
ext4: save unnecessary indentation in ext4_ext_create_new_leaf()
Save an indentation level in ext4_ext_create_new_leaf() by removing
unnecessary 'else'. Besides, the variable 'ee_block' is declared to
avoid line breaks. No functional changes.
Suggested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20240822023545.1994557-26-libaokun@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/extents.c | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 29aaa7340b09..34e25eee6521 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -1403,6 +1403,7 @@ ext4_ext_create_new_leaf(handle_t *handle, struct inode *inode, { struct ext4_ext_path *curp; int depth, i, err = 0; + ext4_lblk_t ee_block = le32_to_cpu(newext->ee_block); repeat: i = depth = ext_depth(inode); @@ -1424,33 +1425,30 @@ repeat: goto errout; /* refill path */ - path = ext4_find_extent(inode, - (ext4_lblk_t)le32_to_cpu(newext->ee_block), - path, gb_flags); + path = ext4_find_extent(inode, ee_block, path, gb_flags); return path; - } else { - /* tree is full, time to grow in depth */ - err = ext4_ext_grow_indepth(handle, inode, mb_flags); - if (err) - goto errout; + } - /* refill path */ - path = ext4_find_extent(inode, - (ext4_lblk_t)le32_to_cpu(newext->ee_block), - path, gb_flags); - if (IS_ERR(path)) - return path; + /* tree is full, time to grow in depth */ + err = ext4_ext_grow_indepth(handle, inode, mb_flags); + if (err) + goto errout; - /* - * only first (depth 0 -> 1) produces free space; - * in all other cases we have to split the grown tree - */ - depth = ext_depth(inode); - if (path[depth].p_hdr->eh_entries == path[depth].p_hdr->eh_max) { - /* now we need to split */ - goto repeat; - } + /* refill path */ + path = ext4_find_extent(inode, ee_block, path, gb_flags); + if (IS_ERR(path)) + return path; + + /* + * only first (depth 0 -> 1) produces free space; + * in all other cases we have to split the grown tree + */ + depth = ext_depth(inode); + if (path[depth].p_hdr->eh_entries == path[depth].p_hdr->eh_max) { + /* now we need to split */ + goto repeat; } + return path; errout: |