Now that we do more than just clear the DCACHE_NOKEY_NAME in fscrypt_handle_d_move, skip it entirely for volumes that don't need fscrypt, to save the extra cost. Note that fscrypt_handle_d_move is hopefully inlined back into __d_move, so the call cost is not significant, and theefore we do the check in the callee to avoid polluting the caller code with header guards. Signed-off-by: Gabriel Krisman Bertazi <krisman@xxxxxxx> --- include/linux/fscrypt.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h index c1e285053b3e..566362fdc3af 100644 --- a/include/linux/fscrypt.h +++ b/include/linux/fscrypt.h @@ -232,6 +232,10 @@ static inline bool fscrypt_needs_contents_encryption(const struct inode *inode) */ static inline void fscrypt_handle_d_move(struct dentry *dentry) { + /* Ignore volumes that don't care about fscrypt. */ + if (dentry->d_sb->s_cop) + return; + dentry->d_flags &= ~DCACHE_NOKEY_NAME; /* -- 2.43.0