fscrypt: new helper function - fscrypt_prepare_lookup()
authorEric Biggers <ebiggers@google.com>
Mon, 9 Oct 2017 19:15:43 +0000 (12:15 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 5 Jan 2018 00:17:34 +0000 (16:17 -0800)
commit91d09c0521325019f5fc9bdaf5d4d60e3dafc355
treed3c6ca8dfd94add42358e5c19b0f661d44ed24d0
parent9a24d618cb8a1d5862a681dfc9d9d84ae9fa9e6e
fscrypt: new helper function - fscrypt_prepare_lookup()

Introduce a helper function which prepares to look up the given dentry
in the given directory.  If the directory is encrypted, it handles
loading the directory's encryption key, setting the dentry's ->d_op to
fscrypt_d_ops, and setting DCACHE_ENCRYPTED_WITH_KEY if the directory's
encryption key is available.

Note: once all filesystems switch over to this, we'll be able to move
fscrypt_d_ops and fscrypt_set_encrypted_dentry() to fscrypt_private.h.

Acked-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/crypto/hooks.c
include/linux/fscrypt.h
include/linux/fscrypt_notsupp.h
include/linux/fscrypt_supp.h