ecryptfs_encrypt_and_encode_filename(): drop unused argument
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 22 Feb 2016 23:14:25 +0000 (18:14 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 22 Feb 2016 23:14:25 +0000 (18:14 -0500)
the last time it was getting something other than NULL as
crypt_stat had been back in 2009...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ecryptfs/crypto.c
fs/ecryptfs/ecryptfs_kernel.h
fs/ecryptfs/inode.c

index 80d6901493cf5e0867cd2572885cc16f66ff59c5..87dbdd4881abfa16793c78de2b971c2775c461c2 100644 (file)
@@ -1499,16 +1499,14 @@ out:
  */
 static int
 ecryptfs_encrypt_filename(struct ecryptfs_filename *filename,
-                         struct ecryptfs_crypt_stat *crypt_stat,
                          struct ecryptfs_mount_crypt_stat *mount_crypt_stat)
 {
        int rc = 0;
 
        filename->encrypted_filename = NULL;
        filename->encrypted_filename_size = 0;
-       if ((crypt_stat && (crypt_stat->flags & ECRYPTFS_ENCFN_USE_MOUNT_FNEK))
-           || (mount_crypt_stat && (mount_crypt_stat->flags
-                                    & ECRYPTFS_GLOBAL_ENCFN_USE_MOUNT_FNEK))) {
+       if (mount_crypt_stat && (mount_crypt_stat->flags
+                                    & ECRYPTFS_GLOBAL_ENCFN_USE_MOUNT_FNEK)) {
                size_t packet_size;
                size_t remaining_bytes;
 
@@ -1944,7 +1942,6 @@ out:
 int ecryptfs_encrypt_and_encode_filename(
        char **encoded_name,
        size_t *encoded_name_size,
-       struct ecryptfs_crypt_stat *crypt_stat,
        struct ecryptfs_mount_crypt_stat *mount_crypt_stat,
        const char *name, size_t name_size)
 {
@@ -1953,9 +1950,8 @@ int ecryptfs_encrypt_and_encode_filename(
 
        (*encoded_name) = NULL;
        (*encoded_name_size) = 0;
-       if ((crypt_stat && (crypt_stat->flags & ECRYPTFS_ENCRYPT_FILENAMES))
-           || (mount_crypt_stat && (mount_crypt_stat->flags
-                                    & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES))) {
+       if (mount_crypt_stat && (mount_crypt_stat->flags
+                                    & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES)) {
                struct ecryptfs_filename *filename;
 
                filename = kzalloc(sizeof(*filename), GFP_KERNEL);
@@ -1968,8 +1964,7 @@ int ecryptfs_encrypt_and_encode_filename(
                }
                filename->filename = (char *)name;
                filename->filename_size = name_size;
-               rc = ecryptfs_encrypt_filename(filename, crypt_stat,
-                                              mount_crypt_stat);
+               rc = ecryptfs_encrypt_filename(filename, mount_crypt_stat);
                if (rc) {
                        printk(KERN_ERR "%s: Error attempting to encrypt "
                               "filename; rc = [%d]\n", __func__, rc);
@@ -1980,11 +1975,9 @@ int ecryptfs_encrypt_and_encode_filename(
                        NULL, &encoded_name_no_prefix_size,
                        filename->encrypted_filename,
                        filename->encrypted_filename_size);
-               if ((crypt_stat && (crypt_stat->flags
-                                   & ECRYPTFS_ENCFN_USE_MOUNT_FNEK))
-                   || (mount_crypt_stat
+               if (mount_crypt_stat
                        && (mount_crypt_stat->flags
-                           & ECRYPTFS_GLOBAL_ENCFN_USE_MOUNT_FNEK)))
+                           & ECRYPTFS_GLOBAL_ENCFN_USE_MOUNT_FNEK))
                        (*encoded_name_size) =
                                (ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE
                                 + encoded_name_no_prefix_size);
@@ -2002,11 +1995,9 @@ int ecryptfs_encrypt_and_encode_filename(
                        kfree(filename);
                        goto out;
                }
-               if ((crypt_stat && (crypt_stat->flags
-                                   & ECRYPTFS_ENCFN_USE_MOUNT_FNEK))
-                   || (mount_crypt_stat
+               if (mount_crypt_stat
                        && (mount_crypt_stat->flags
-                           & ECRYPTFS_GLOBAL_ENCFN_USE_MOUNT_FNEK))) {
+                           & ECRYPTFS_GLOBAL_ENCFN_USE_MOUNT_FNEK)) {
                        memcpy((*encoded_name),
                               ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX,
                               ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE);
index 7b39260c7bbaa18fda583426a101a95124639dc5..67e16128c57246b614ff7821ef6026fedbc9dd82 100644 (file)
@@ -569,7 +569,6 @@ int ecryptfs_fill_zeros(struct file *file, loff_t new_length);
 int ecryptfs_encrypt_and_encode_filename(
        char **encoded_name,
        size_t *encoded_name_size,
-       struct ecryptfs_crypt_stat *crypt_stat,
        struct ecryptfs_mount_crypt_stat *mount_crypt_stat,
        const char *name, size_t name_size);
 struct dentry *ecryptfs_lower_dentry(struct dentry *this_dentry);
index 34bbf5d93f5728f6ecccdfb083cee41e01792d02..26651636cd1de69bd2812100e865b3a17c876966 100644 (file)
@@ -417,7 +417,7 @@ static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode,
        dput(lower_dentry);
        rc = ecryptfs_encrypt_and_encode_filename(
                &encrypted_and_encoded_name, &encrypted_and_encoded_name_size,
-               NULL, mount_crypt_stat, ecryptfs_dentry->d_name.name,
+               mount_crypt_stat, ecryptfs_dentry->d_name.name,
                ecryptfs_dentry->d_name.len);
        if (rc) {
                printk(KERN_ERR "%s: Error attempting to encrypt and encode "
@@ -498,7 +498,6 @@ static int ecryptfs_symlink(struct inode *dir, struct dentry *dentry,
                dir->i_sb)->mount_crypt_stat;
        rc = ecryptfs_encrypt_and_encode_filename(&encoded_symname,
                                                  &encoded_symlen,
-                                                 NULL,
                                                  mount_crypt_stat, symname,
                                                  strlen(symname));
        if (rc)