OSDN Git Service

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:10:50 +0000 (02:10 -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 6eb4343..bce476d 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 b03cb23..f71d632 100644 (file)
@@ -53,17 +53,6 @@ struct fscrypt_name {
 #define fname_name(p)          ((p)->disk_name.name)
 #define fname_len(p)           ((p)->disk_name.len)
 
-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