diff options
author | Eric Biggers <ebiggers@google.com> | 2023-04-06 20:12:45 +0200 |
---|---|---|
committer | Eric Biggers <ebiggers@google.com> | 2023-04-06 20:16:39 +0200 |
commit | 83e57e47906ce0e99bd61c70fae514e69960d274 (patch) | |
tree | 3b242cfea96fa9f37838c357109d9884ad0b65ec /fs/crypto/keysetup.c | |
parent | fscrypt: use WARN_ON_ONCE instead of WARN_ON (diff) | |
download | linux-83e57e47906ce0e99bd61c70fae514e69960d274.tar.xz linux-83e57e47906ce0e99bd61c70fae514e69960d274.zip |
fscrypt: optimize fscrypt_initialize()
fscrypt_initialize() is a "one-time init" function that is called
whenever the key is set up for any inode on any filesystem. Make it
implement "one-time init" more efficiently by not taking a global mutex
in the "already initialized case" and doing fewer pointer dereferences.
Link: https://lore.kernel.org/r/20230406181245.36091-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'fs/crypto/keysetup.c')
-rw-r--r-- | fs/crypto/keysetup.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/crypto/keysetup.c b/fs/crypto/keysetup.c index 84cdae306328..361f41ef46c7 100644 --- a/fs/crypto/keysetup.c +++ b/fs/crypto/keysetup.c @@ -560,7 +560,7 @@ fscrypt_setup_encryption_info(struct inode *inode, struct fscrypt_master_key *mk = NULL; int res; - res = fscrypt_initialize(inode->i_sb->s_cop->flags); + res = fscrypt_initialize(inode->i_sb); if (res) return res; |