Commit dcf0db9e authored by Eric Biggers's avatar Eric Biggers Committed by Theodore Ts'o

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: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent bb8179e5
...@@ -15,6 +15,17 @@ ...@@ -15,6 +15,17 @@
#include <linux/ratelimit.h> #include <linux/ratelimit.h>
#include "fscrypt_private.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 * fname_encrypt() - encrypt a filename
* *
......
...@@ -57,17 +57,6 @@ struct fscrypt_name { ...@@ -57,17 +57,6 @@ struct fscrypt_name {
/* Maximum value for the third parameter of fscrypt_operations.set_context(). */ /* Maximum value for the third parameter of fscrypt_operations.set_context(). */
#define FSCRYPT_SET_CONTEXT_MAX_SIZE 28 #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 #if __FS_HAS_ENCRYPTION
#include <linux/fscrypt_supp.h> #include <linux/fscrypt_supp.h>
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment