fscrypt: remove fscrypt_fname_usr_to_disk()
fscrypt_fname_usr_to_disk() sounded very generic but was actually only used to encrypt symlinks. Remove it now that all filesystems have been switched over to fscrypt_encrypt_symlink(). Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
parent
7ac4756a24
commit
f9550c24c2
3 changed files with 0 additions and 38 deletions
|
@ -310,35 +310,6 @@ int fscrypt_fname_disk_to_usr(struct inode *inode,
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(fscrypt_fname_disk_to_usr);
|
EXPORT_SYMBOL(fscrypt_fname_disk_to_usr);
|
||||||
|
|
||||||
/**
|
|
||||||
* fscrypt_fname_usr_to_disk() - converts a filename from user space to disk
|
|
||||||
* space
|
|
||||||
*
|
|
||||||
* The caller must have allocated sufficient memory for the @oname string.
|
|
||||||
*
|
|
||||||
* Return: 0 on success, -errno on failure
|
|
||||||
*/
|
|
||||||
int fscrypt_fname_usr_to_disk(struct inode *inode,
|
|
||||||
const struct qstr *iname,
|
|
||||||
struct fscrypt_str *oname)
|
|
||||||
{
|
|
||||||
if (fscrypt_is_dot_dotdot(iname)) {
|
|
||||||
oname->name[0] = '.';
|
|
||||||
oname->name[iname->len - 1] = '.';
|
|
||||||
oname->len = iname->len;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (inode->i_crypt_info)
|
|
||||||
return fname_encrypt(inode, iname, oname);
|
|
||||||
/*
|
|
||||||
* Without a proper key, a user is not allowed to modify the filenames
|
|
||||||
* in a directory. Consequently, a user space name cannot be mapped to
|
|
||||||
* a disk-space name
|
|
||||||
*/
|
|
||||||
return -ENOKEY;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(fscrypt_fname_usr_to_disk);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fscrypt_setup_filename() - prepare to search a possibly encrypted directory
|
* fscrypt_setup_filename() - prepare to search a possibly encrypted directory
|
||||||
* @dir: the directory that will be searched
|
* @dir: the directory that will be searched
|
||||||
|
|
|
@ -158,13 +158,6 @@ static inline int fscrypt_fname_disk_to_usr(struct inode *inode,
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int fscrypt_fname_usr_to_disk(struct inode *inode,
|
|
||||||
const struct qstr *iname,
|
|
||||||
struct fscrypt_str *oname)
|
|
||||||
{
|
|
||||||
return -EOPNOTSUPP;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool fscrypt_match_name(const struct fscrypt_name *fname,
|
static inline bool fscrypt_match_name(const struct fscrypt_name *fname,
|
||||||
const u8 *de_name, u32 de_name_len)
|
const u8 *de_name, u32 de_name_len)
|
||||||
{
|
{
|
||||||
|
|
|
@ -112,8 +112,6 @@ extern int fscrypt_fname_alloc_buffer(const struct inode *, u32,
|
||||||
extern void fscrypt_fname_free_buffer(struct fscrypt_str *);
|
extern void fscrypt_fname_free_buffer(struct fscrypt_str *);
|
||||||
extern int fscrypt_fname_disk_to_usr(struct inode *, u32, u32,
|
extern int fscrypt_fname_disk_to_usr(struct inode *, u32, u32,
|
||||||
const struct fscrypt_str *, struct fscrypt_str *);
|
const struct fscrypt_str *, struct fscrypt_str *);
|
||||||
extern int fscrypt_fname_usr_to_disk(struct inode *, const struct qstr *,
|
|
||||||
struct fscrypt_str *);
|
|
||||||
|
|
||||||
#define FSCRYPT_FNAME_MAX_UNDIGESTED_SIZE 32
|
#define FSCRYPT_FNAME_MAX_UNDIGESTED_SIZE 32
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue