]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit917f9c7de66510aa65033a74ed0b884110565b73
tree5bde8e0c94404ca413aecf30e0dc3675ea943df3
parent1fdf5882475e3a0830214556838f0604d6f60408
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