summaryrefslogtreecommitdiffstats
path: root/fs/crypto
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2018-01-11 23:30:13 -0500
committerTheodore Ts'o <tytso@mit.edu>2018-01-11 23:30:13 -0500
commit3d204e24d452f96704f5feb83f6b7654245defc9 (patch)
tree680d6fad2a6f7a7d6638e828b8ea2542beea4509 /fs/crypto
parent2f46a2bc2694877332f9c1ff47acb7fa117e168a (diff)
fscrypt: remove 'ci' parameter from fscrypt_put_encryption_info()
fscrypt_put_encryption_info() is only called when evicting an inode, so the 'struct fscrypt_info *ci' parameter is always NULL, and there cannot be races with other threads. This was cruft left over from the broken key revocation code. Remove the unused parameter and the cmpxchg(). Also remove the #ifdefs around the fscrypt_put_encryption_info() calls, since fscrypt_notsupp.h defines a no-op stub for it. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/crypto')
-rw-r--r--fs/crypto/keyinfo.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/fs/crypto/keyinfo.c b/fs/crypto/keyinfo.c
index c115eac4b4cf..05f5ee1f0705 100644
--- a/fs/crypto/keyinfo.c
+++ b/fs/crypto/keyinfo.c
@@ -355,19 +355,9 @@ out:
355} 355}
356EXPORT_SYMBOL(fscrypt_get_encryption_info); 356EXPORT_SYMBOL(fscrypt_get_encryption_info);
357 357
358void fscrypt_put_encryption_info(struct inode *inode, struct fscrypt_info *ci) 358void fscrypt_put_encryption_info(struct inode *inode)
359{ 359{
360 struct fscrypt_info *prev; 360 put_crypt_info(inode->i_crypt_info);
361 361 inode->i_crypt_info = NULL;
362 if (ci == NULL)
363 ci = READ_ONCE(inode->i_crypt_info);
364 if (ci == NULL)
365 return;
366
367 prev = cmpxchg(&inode->i_crypt_info, ci, NULL);
368 if (prev != ci)
369 return;
370
371 put_crypt_info(ci);
372} 362}
373EXPORT_SYMBOL(fscrypt_put_encryption_info); 363EXPORT_SYMBOL(fscrypt_put_encryption_info);