Skip to content

Commit 09355d9

Browse files
riteshharjanitytso
authored andcommitted
ext4: remove redundant max inline_size check in ext4_da_write_inline_data_begin()
ext4_prepare_inline_data() already checks for ext4_get_max_inline_size() and returns -ENOSPC. So there is no need to check it twice within ext4_da_write_inline_data_begin(). This patch removes the extra check. It also makes it more clean. No functionality change in this patch. Signed-off-by: Ritesh Harjani <[email protected]> Reviewed-by: Jan Kara <[email protected]> Link: https://lore.kernel.org/r/cdd1654128d5105550c65fd13ca5da53b2162cc4.1642416995.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 897026a commit 09355d9

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

fs/ext4/inline.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ int ext4_da_write_inline_data_begin(struct address_space *mapping,
911911
struct page **pagep,
912912
void **fsdata)
913913
{
914-
int ret, inline_size;
914+
int ret;
915915
handle_t *handle;
916916
struct page *page;
917917
struct ext4_iloc iloc;
@@ -928,14 +928,9 @@ int ext4_da_write_inline_data_begin(struct address_space *mapping,
928928
goto out;
929929
}
930930

931-
inline_size = ext4_get_max_inline_size(inode);
932-
933-
ret = -ENOSPC;
934-
if (inline_size >= pos + len) {
935-
ret = ext4_prepare_inline_data(handle, inode, pos + len);
936-
if (ret && ret != -ENOSPC)
937-
goto out_journal;
938-
}
931+
ret = ext4_prepare_inline_data(handle, inode, pos + len);
932+
if (ret && ret != -ENOSPC)
933+
goto out_journal;
939934

940935
/*
941936
* We cannot recurse into the filesystem as the transaction

0 commit comments

Comments
 (0)