Commit 8b10fe68 authored by Jeff Layton's avatar Jeff Layton Committed by Eric Biggers

fscrypt: drop unused inode argument from fscrypt_fname_alloc_buffer

Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Link: https://lore.kernel.org/r/20200810142139.487631-1-jlayton@kernel.orgSigned-off-by: default avatarEric Biggers <ebiggers@google.com>
parent f4d51dff
...@@ -260,8 +260,6 @@ bool fscrypt_fname_encrypted_size(const struct inode *inode, u32 orig_len, ...@@ -260,8 +260,6 @@ bool fscrypt_fname_encrypted_size(const struct inode *inode, u32 orig_len,
/** /**
* fscrypt_fname_alloc_buffer() - allocate a buffer for presented filenames * fscrypt_fname_alloc_buffer() - allocate a buffer for presented filenames
* @inode: inode of the parent directory (for regular filenames)
* or of the symlink (for symlink targets)
* @max_encrypted_len: maximum length of encrypted filenames the buffer will be * @max_encrypted_len: maximum length of encrypted filenames the buffer will be
* used to present * used to present
* @crypto_str: (output) buffer to allocate * @crypto_str: (output) buffer to allocate
...@@ -271,8 +269,7 @@ bool fscrypt_fname_encrypted_size(const struct inode *inode, u32 orig_len, ...@@ -271,8 +269,7 @@ bool fscrypt_fname_encrypted_size(const struct inode *inode, u32 orig_len,
* *
* Return: 0 on success, -errno on failure * Return: 0 on success, -errno on failure
*/ */
int fscrypt_fname_alloc_buffer(const struct inode *inode, int fscrypt_fname_alloc_buffer(u32 max_encrypted_len,
u32 max_encrypted_len,
struct fscrypt_str *crypto_str) struct fscrypt_str *crypto_str)
{ {
const u32 max_encoded_len = BASE64_CHARS(FSCRYPT_NOKEY_NAME_MAX); const u32 max_encoded_len = BASE64_CHARS(FSCRYPT_NOKEY_NAME_MAX);
......
...@@ -319,7 +319,7 @@ const char *fscrypt_get_symlink(struct inode *inode, const void *caddr, ...@@ -319,7 +319,7 @@ const char *fscrypt_get_symlink(struct inode *inode, const void *caddr,
if (cstr.len + sizeof(*sd) - 1 > max_size) if (cstr.len + sizeof(*sd) - 1 > max_size)
return ERR_PTR(-EUCLEAN); return ERR_PTR(-EUCLEAN);
err = fscrypt_fname_alloc_buffer(inode, cstr.len, &pstr); err = fscrypt_fname_alloc_buffer(cstr.len, &pstr);
if (err) if (err)
return ERR_PTR(err); return ERR_PTR(err);
......
...@@ -148,7 +148,7 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx) ...@@ -148,7 +148,7 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx)
} }
if (IS_ENCRYPTED(inode)) { if (IS_ENCRYPTED(inode)) {
err = fscrypt_fname_alloc_buffer(inode, EXT4_NAME_LEN, &fstr); err = fscrypt_fname_alloc_buffer(EXT4_NAME_LEN, &fstr);
if (err < 0) if (err < 0)
return err; return err;
} }
......
...@@ -663,8 +663,7 @@ static struct stats dx_show_leaf(struct inode *dir, ...@@ -663,8 +663,7 @@ static struct stats dx_show_leaf(struct inode *dir,
/* Directory is encrypted */ /* Directory is encrypted */
res = fscrypt_fname_alloc_buffer( res = fscrypt_fname_alloc_buffer(
dir, len, len, &fname_crypto_str);
&fname_crypto_str);
if (res) if (res)
printk(KERN_WARNING "Error " printk(KERN_WARNING "Error "
"allocating crypto " "allocating crypto "
...@@ -1016,7 +1015,7 @@ static int htree_dirblock_to_tree(struct file *dir_file, ...@@ -1016,7 +1015,7 @@ static int htree_dirblock_to_tree(struct file *dir_file,
brelse(bh); brelse(bh);
return err; return err;
} }
err = fscrypt_fname_alloc_buffer(dir, EXT4_NAME_LEN, err = fscrypt_fname_alloc_buffer(EXT4_NAME_LEN,
&fname_crypto_str); &fname_crypto_str);
if (err < 0) { if (err < 0) {
brelse(bh); brelse(bh);
......
...@@ -1032,7 +1032,7 @@ static int f2fs_readdir(struct file *file, struct dir_context *ctx) ...@@ -1032,7 +1032,7 @@ static int f2fs_readdir(struct file *file, struct dir_context *ctx)
if (err) if (err)
goto out; goto out;
err = fscrypt_fname_alloc_buffer(inode, F2FS_NAME_LEN, &fstr); err = fscrypt_fname_alloc_buffer(F2FS_NAME_LEN, &fstr);
if (err < 0) if (err < 0)
goto out; goto out;
} }
......
...@@ -515,7 +515,7 @@ static int ubifs_readdir(struct file *file, struct dir_context *ctx) ...@@ -515,7 +515,7 @@ static int ubifs_readdir(struct file *file, struct dir_context *ctx)
if (err) if (err)
return err; return err;
err = fscrypt_fname_alloc_buffer(dir, UBIFS_MAX_NLEN, &fstr); err = fscrypt_fname_alloc_buffer(UBIFS_MAX_NLEN, &fstr);
if (err) if (err)
return err; return err;
......
...@@ -197,7 +197,7 @@ static inline void fscrypt_free_filename(struct fscrypt_name *fname) ...@@ -197,7 +197,7 @@ static inline void fscrypt_free_filename(struct fscrypt_name *fname)
kfree(fname->crypto_buf.name); kfree(fname->crypto_buf.name);
} }
int fscrypt_fname_alloc_buffer(const struct inode *inode, u32 max_encrypted_len, int fscrypt_fname_alloc_buffer(u32 max_encrypted_len,
struct fscrypt_str *crypto_str); struct fscrypt_str *crypto_str);
void fscrypt_fname_free_buffer(struct fscrypt_str *crypto_str); void fscrypt_fname_free_buffer(struct fscrypt_str *crypto_str);
int fscrypt_fname_disk_to_usr(const struct inode *inode, int fscrypt_fname_disk_to_usr(const struct inode *inode,
...@@ -428,8 +428,7 @@ static inline void fscrypt_free_filename(struct fscrypt_name *fname) ...@@ -428,8 +428,7 @@ static inline void fscrypt_free_filename(struct fscrypt_name *fname)
return; return;
} }
static inline int fscrypt_fname_alloc_buffer(const struct inode *inode, static inline int fscrypt_fname_alloc_buffer(u32 max_encrypted_len,
u32 max_encrypted_len,
struct fscrypt_str *crypto_str) struct fscrypt_str *crypto_str)
{ {
return -EOPNOTSUPP; return -EOPNOTSUPP;
......
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