ext4: factor out ext4_xattr_credits_for_new_inode()
authorEric Biggers <ebiggers@google.com>
Thu, 17 Sep 2020 04:11:25 +0000 (21:11 -0700)
committerEric Biggers <ebiggers@google.com>
Tue, 22 Sep 2020 13:48:32 +0000 (06:48 -0700)
commit177cc0e71008b7a0737bf55c88538d0b9e6e9191
tree5bde8e0c94404ca413aecf30e0dc3675ea943df3
parenta992b20cd4ee360dbbe6f69339cb07146e4304d6
ext4: factor out ext4_xattr_credits_for_new_inode()

To compute a new inode's xattr credits, we need to know whether the
inode will be encrypted or not.  When we switch to use the new helper
function fscrypt_prepare_new_inode(), we won't find out whether the
inode will be encrypted until slightly later than is currently the case.
That will require moving the code block that computes the xattr credits.

To make this easier and reduce the length of __ext4_new_inode(), move
this code block into a new function ext4_xattr_credits_for_new_inode().

Link: https://lore.kernel.org/r/20200917041136.178600-3-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
fs/ext4/ialloc.c