]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
fscrypt: drop unused inode argument from fscrypt_fname_alloc_buffer
authorJeff Layton <jlayton@kernel.org>
Mon, 10 Aug 2020 14:21:39 +0000 (10:21 -0400)
committerEric Biggers <ebiggers@google.com>
Mon, 7 Sep 2020 22:27:42 +0000 (15:27 -0700)
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://lore.kernel.org/r/20200810142139.487631-1-jlayton@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
fs/crypto/fname.c
fs/crypto/hooks.c
fs/ext4/dir.c
fs/ext4/namei.c
fs/f2fs/dir.c
fs/ubifs/dir.c
include/linux/fscrypt.h

index 011830f84d8d46930db7660ab158eea6156b93ec..47bcfddb278bab072c516878a517c21f27939fd5 100644 (file)
@@ -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
- * @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
  *                    used to present
  * @crypto_str: (output) buffer to allocate
@@ -271,8 +269,7 @@ bool fscrypt_fname_encrypted_size(const struct inode *inode, u32 orig_len,
  *
  * Return: 0 on success, -errno on failure
  */
-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)
 {
        const u32 max_encoded_len = BASE64_CHARS(FSCRYPT_NOKEY_NAME_MAX);
index 09fb8aa0f2e930ac65c5c23349ac1bac5a504029..491b252843eb97f26cf2273899427c43676a34ea 100644 (file)
@@ -319,7 +319,7 @@ const char *fscrypt_get_symlink(struct inode *inode, const void *caddr,
        if (cstr.len + sizeof(*sd) - 1 > max_size)
                return ERR_PTR(-EUCLEAN);
 
-       err = fscrypt_fname_alloc_buffer(inode, cstr.len, &pstr);
+       err = fscrypt_fname_alloc_buffer(cstr.len, &pstr);
        if (err)
                return ERR_PTR(err);
 
index 1d82336b1cd4504bc7b5b4d9cccc3fc70dff52f6..efe77cffc3222be8d8876094d340a412df5fbf22 100644 (file)
@@ -148,7 +148,7 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx)
        }
 
        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)
                        return err;
        }
index 153a9fbe1dd06948dd76fa1041c086342d802a19..0d74615fcce3a317881eaefbf1d029d8745b0bcf 100644 (file)
@@ -663,8 +663,7 @@ static struct stats dx_show_leaf(struct inode *dir,
 
                                        /* Directory is encrypted */
                                        res = fscrypt_fname_alloc_buffer(
-                                               dir, len,
-                                               &fname_crypto_str);
+                                               len, &fname_crypto_str);
                                        if (res)
                                                printk(KERN_WARNING "Error "
                                                        "allocating crypto "
@@ -1016,8 +1015,8 @@ static int htree_dirblock_to_tree(struct file *dir_file,
                        brelse(bh);
                        return err;
                }
-               err = fscrypt_fname_alloc_buffer(dir, EXT4_NAME_LEN,
-                                                    &fname_crypto_str);
+               err = fscrypt_fname_alloc_buffer(EXT4_NAME_LEN,
+                                                &fname_crypto_str);
                if (err < 0) {
                        brelse(bh);
                        return err;
index 069f498af1e38f642c944e13af59e8792c1955eb..b2530b9507bd9ff659aa33de8493d57654a714bc 100644 (file)
@@ -1032,7 +1032,7 @@ static int f2fs_readdir(struct file *file, struct dir_context *ctx)
                if (err)
                        goto out;
 
-               err = fscrypt_fname_alloc_buffer(inode, F2FS_NAME_LEN, &fstr);
+               err = fscrypt_fname_alloc_buffer(F2FS_NAME_LEN, &fstr);
                if (err < 0)
                        goto out;
        }
index 9d042942d8b298cbbc4afb6000e40bad1022ca4d..a9c1f5a9c9bddbafb919ac9f41c78dcb1d6c2f67 100644 (file)
@@ -515,7 +515,7 @@ static int ubifs_readdir(struct file *file, struct dir_context *ctx)
                if (err)
                        return err;
 
-               err = fscrypt_fname_alloc_buffer(dir, UBIFS_MAX_NLEN, &fstr);
+               err = fscrypt_fname_alloc_buffer(UBIFS_MAX_NLEN, &fstr);
                if (err)
                        return err;
 
index 991ff8575d0e7545df889a5388c5916a3d069b44..eaf16eb557887452de30a65d33c6182c1bf02224 100644 (file)
@@ -197,7 +197,7 @@ static inline void fscrypt_free_filename(struct fscrypt_name *fname)
        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);
 void fscrypt_fname_free_buffer(struct fscrypt_str *crypto_str);
 int fscrypt_fname_disk_to_usr(const struct inode *inode,
@@ -428,8 +428,7 @@ static inline void fscrypt_free_filename(struct fscrypt_name *fname)
        return;
 }
 
-static inline int fscrypt_fname_alloc_buffer(const struct inode *inode,
-                                            u32 max_encrypted_len,
+static inline int fscrypt_fname_alloc_buffer(u32 max_encrypted_len,
                                             struct fscrypt_str *crypto_str)
 {
        return -EOPNOTSUPP;