fscrypt: move fscrypt_is_dot_dotdot() to fs/crypto/fname.c
authorEric Biggers <ebiggers@google.com>
Fri, 5 Jan 2018 18:44:59 +0000 (10:44 -0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sun, 8 Apr 2018 09:40:09 +0000 (02:40 -0700)
Only fs/crypto/fname.c cares about treating the "." and ".." filenames
specially with regards to encryption, so move fscrypt_is_dot_dotdot()
from fscrypt.h to there.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/crypto/fname.c
include/linux/fscrypt.h

index 305541bcd108389695c5c20e37350d76936abb2d..b8c5061553b1c167e83a225ef3e0d11fb81be51d 100644 (file)
 #include <linux/ratelimit.h>
 #include "fscrypt_private.h"
 
+static inline bool fscrypt_is_dot_dotdot(const struct qstr *str)
+{
+       if (str->len == 1 && str->name[0] == '.')
+               return true;
+
+       if (str->len == 2 && str->name[0] == '.' && str->name[1] == '.')
+               return true;
+
+       return false;
+}
+
 /**
  * fname_encrypt() - encrypt a filename
  *
index 2e4dce0365cf0466b54a3553fa47fc936262f966..3045fc49d3ca01b1fc441724cbed8db1c33c4d4c 100644 (file)
@@ -57,17 +57,6 @@ struct fscrypt_name {
 /* Maximum value for the third parameter of fscrypt_operations.set_context(). */
 #define FSCRYPT_SET_CONTEXT_MAX_SIZE   28
 
-static inline bool fscrypt_is_dot_dotdot(const struct qstr *str)
-{
-       if (str->len == 1 && str->name[0] == '.')
-               return true;
-
-       if (str->len == 2 && str->name[0] == '.' && str->name[1] == '.')
-               return true;
-
-       return false;
-}
-
 #if __FS_HAS_ENCRYPTION
 #include <linux/fscrypt_supp.h>
 #else