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 <kris...@suse.de>
---
 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



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to