diff options
| author | Eric Biggers <ebiggers@google.com> | 2018-01-05 10:44:59 -0800 |
|---|---|---|
| committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-04-08 02:10:50 -0700 |
| commit | d9cadc11bdcf9907041dcaba204384c0ff552b81 (patch) | |
| tree | 9566017b97cc462c44fc20123edd9844304ad195 | |
| parent | e6fe930580cb0344a4fbd0b15bb8cda5e3986fee (diff) | |
fscrypt: move fscrypt_is_dot_dotdot() to fs/crypto/fname.c
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>
| -rw-r--r-- | fs/crypto/fname.c | 11 | ||||
| -rw-r--r-- | include/linux/fscrypt.h | 11 |
2 files changed, 11 insertions, 11 deletions
diff --git a/fs/crypto/fname.c b/fs/crypto/fname.c index 6eb434363ff2..bce476dc2c65 100644 --- a/fs/crypto/fname.c +++ b/fs/crypto/fname.c @@ -14,6 +14,17 @@ #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 * diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h index b03cb23728ea..f71d6326936e 100644 --- a/include/linux/fscrypt.h +++ b/include/linux/fscrypt.h @@ -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 |
