diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2016-02-22 18:14:25 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-02-22 18:14:25 -0500 |
| commit | 97c31606075b30d0c5d70e477f54bb3f222e048d (patch) | |
| tree | 5472634e7163a7b7dec7ce1272fd3f50e873e9fc /fs/ecryptfs | |
| parent | 6b719e53099f1bf1cd32dd1d6704c101a7506c46 (diff) | |
ecryptfs_encrypt_and_encode_filename(): drop unused argument
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>
Diffstat (limited to 'fs/ecryptfs')
| -rw-r--r-- | fs/ecryptfs/crypto.c | 27 | ||||
| -rw-r--r-- | fs/ecryptfs/ecryptfs_kernel.h | 1 | ||||
| -rw-r--r-- | fs/ecryptfs/inode.c | 3 |
3 files changed, 10 insertions, 21 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index 80d6901493cf..87dbdd4881ab 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c | |||
| @@ -1499,16 +1499,14 @@ out: | |||
| 1499 | */ | 1499 | */ |
| 1500 | static int | 1500 | static int |
| 1501 | ecryptfs_encrypt_filename(struct ecryptfs_filename *filename, | 1501 | ecryptfs_encrypt_filename(struct ecryptfs_filename *filename, |
| 1502 | struct ecryptfs_crypt_stat *crypt_stat, | ||
| 1503 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat) | 1502 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat) |
| 1504 | { | 1503 | { |
| 1505 | int rc = 0; | 1504 | int rc = 0; |
| 1506 | 1505 | ||
| 1507 | filename->encrypted_filename = NULL; | 1506 | filename->encrypted_filename = NULL; |
| 1508 | filename->encrypted_filename_size = 0; | 1507 | filename->encrypted_filename_size = 0; |
| 1509 | if ((crypt_stat && (crypt_stat->flags & ECRYPTFS_ENCFN_USE_MOUNT_FNEK)) | 1508 | if (mount_crypt_stat && (mount_crypt_stat->flags |
| 1510 | || (mount_crypt_stat && (mount_crypt_stat->flags | 1509 | & ECRYPTFS_GLOBAL_ENCFN_USE_MOUNT_FNEK)) { |
| 1511 | & ECRYPTFS_GLOBAL_ENCFN_USE_MOUNT_FNEK))) { | ||
| 1512 | size_t packet_size; | 1510 | size_t packet_size; |
| 1513 | size_t remaining_bytes; | 1511 | size_t remaining_bytes; |
| 1514 | 1512 | ||
| @@ -1944,7 +1942,6 @@ out: | |||
| 1944 | int ecryptfs_encrypt_and_encode_filename( | 1942 | int ecryptfs_encrypt_and_encode_filename( |
| 1945 | char **encoded_name, | 1943 | char **encoded_name, |
| 1946 | size_t *encoded_name_size, | 1944 | size_t *encoded_name_size, |
| 1947 | struct ecryptfs_crypt_stat *crypt_stat, | ||
| 1948 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat, | 1945 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat, |
| 1949 | const char *name, size_t name_size) | 1946 | const char *name, size_t name_size) |
| 1950 | { | 1947 | { |
| @@ -1953,9 +1950,8 @@ int ecryptfs_encrypt_and_encode_filename( | |||
| 1953 | 1950 | ||
| 1954 | (*encoded_name) = NULL; | 1951 | (*encoded_name) = NULL; |
| 1955 | (*encoded_name_size) = 0; | 1952 | (*encoded_name_size) = 0; |
| 1956 | if ((crypt_stat && (crypt_stat->flags & ECRYPTFS_ENCRYPT_FILENAMES)) | 1953 | if (mount_crypt_stat && (mount_crypt_stat->flags |
| 1957 | || (mount_crypt_stat && (mount_crypt_stat->flags | 1954 | & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES)) { |
| 1958 | & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES))) { | ||
| 1959 | struct ecryptfs_filename *filename; | 1955 | struct ecryptfs_filename *filename; |
| 1960 | 1956 | ||
| 1961 | filename = kzalloc(sizeof(*filename), GFP_KERNEL); | 1957 | filename = kzalloc(sizeof(*filename), GFP_KERNEL); |
| @@ -1968,8 +1964,7 @@ int ecryptfs_encrypt_and_encode_filename( | |||
| 1968 | } | 1964 | } |
| 1969 | filename->filename = (char *)name; | 1965 | filename->filename = (char *)name; |
| 1970 | filename->filename_size = name_size; | 1966 | filename->filename_size = name_size; |
| 1971 | rc = ecryptfs_encrypt_filename(filename, crypt_stat, | 1967 | rc = ecryptfs_encrypt_filename(filename, mount_crypt_stat); |
| 1972 | mount_crypt_stat); | ||
| 1973 | if (rc) { | 1968 | if (rc) { |
| 1974 | printk(KERN_ERR "%s: Error attempting to encrypt " | 1969 | printk(KERN_ERR "%s: Error attempting to encrypt " |
| 1975 | "filename; rc = [%d]\n", __func__, rc); | 1970 | "filename; rc = [%d]\n", __func__, rc); |
| @@ -1980,11 +1975,9 @@ int ecryptfs_encrypt_and_encode_filename( | |||
| 1980 | NULL, &encoded_name_no_prefix_size, | 1975 | NULL, &encoded_name_no_prefix_size, |
| 1981 | filename->encrypted_filename, | 1976 | filename->encrypted_filename, |
| 1982 | filename->encrypted_filename_size); | 1977 | filename->encrypted_filename_size); |
| 1983 | if ((crypt_stat && (crypt_stat->flags | 1978 | if (mount_crypt_stat |
| 1984 | & ECRYPTFS_ENCFN_USE_MOUNT_FNEK)) | ||
| 1985 | || (mount_crypt_stat | ||
| 1986 | && (mount_crypt_stat->flags | 1979 | && (mount_crypt_stat->flags |
| 1987 | & ECRYPTFS_GLOBAL_ENCFN_USE_MOUNT_FNEK))) | 1980 | & ECRYPTFS_GLOBAL_ENCFN_USE_MOUNT_FNEK)) |
| 1988 | (*encoded_name_size) = | 1981 | (*encoded_name_size) = |
| 1989 | (ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE | 1982 | (ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE |
| 1990 | + encoded_name_no_prefix_size); | 1983 | + encoded_name_no_prefix_size); |
| @@ -2002,11 +1995,9 @@ int ecryptfs_encrypt_and_encode_filename( | |||
| 2002 | kfree(filename); | 1995 | kfree(filename); |
| 2003 | goto out; | 1996 | goto out; |
| 2004 | } | 1997 | } |
| 2005 | if ((crypt_stat && (crypt_stat->flags | 1998 | if (mount_crypt_stat |
| 2006 | & ECRYPTFS_ENCFN_USE_MOUNT_FNEK)) | ||
| 2007 | || (mount_crypt_stat | ||
| 2008 | && (mount_crypt_stat->flags | 1999 | && (mount_crypt_stat->flags |
| 2009 | & ECRYPTFS_GLOBAL_ENCFN_USE_MOUNT_FNEK))) { | 2000 | & ECRYPTFS_GLOBAL_ENCFN_USE_MOUNT_FNEK)) { |
| 2010 | memcpy((*encoded_name), | 2001 | memcpy((*encoded_name), |
| 2011 | ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX, | 2002 | ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX, |
| 2012 | ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE); | 2003 | ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE); |
diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h index 7b39260c7bba..67e16128c572 100644 --- a/fs/ecryptfs/ecryptfs_kernel.h +++ b/fs/ecryptfs/ecryptfs_kernel.h | |||
| @@ -569,7 +569,6 @@ int ecryptfs_fill_zeros(struct file *file, loff_t new_length); | |||
| 569 | int ecryptfs_encrypt_and_encode_filename( | 569 | int ecryptfs_encrypt_and_encode_filename( |
| 570 | char **encoded_name, | 570 | char **encoded_name, |
| 571 | size_t *encoded_name_size, | 571 | size_t *encoded_name_size, |
| 572 | struct ecryptfs_crypt_stat *crypt_stat, | ||
| 573 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat, | 572 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat, |
| 574 | const char *name, size_t name_size); | 573 | const char *name, size_t name_size); |
| 575 | struct dentry *ecryptfs_lower_dentry(struct dentry *this_dentry); | 574 | struct dentry *ecryptfs_lower_dentry(struct dentry *this_dentry); |
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 34bbf5d93f57..26651636cd1d 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
| @@ -417,7 +417,7 @@ static struct dentry *ecryptfs_lookup(struct inode *ecryptfs_dir_inode, | |||
| 417 | dput(lower_dentry); | 417 | dput(lower_dentry); |
| 418 | rc = ecryptfs_encrypt_and_encode_filename( | 418 | rc = ecryptfs_encrypt_and_encode_filename( |
| 419 | &encrypted_and_encoded_name, &encrypted_and_encoded_name_size, | 419 | &encrypted_and_encoded_name, &encrypted_and_encoded_name_size, |
| 420 | NULL, mount_crypt_stat, ecryptfs_dentry->d_name.name, | 420 | mount_crypt_stat, ecryptfs_dentry->d_name.name, |
| 421 | ecryptfs_dentry->d_name.len); | 421 | ecryptfs_dentry->d_name.len); |
| 422 | if (rc) { | 422 | if (rc) { |
| 423 | printk(KERN_ERR "%s: Error attempting to encrypt and encode " | 423 | printk(KERN_ERR "%s: Error attempting to encrypt and encode " |
| @@ -498,7 +498,6 @@ static int ecryptfs_symlink(struct inode *dir, struct dentry *dentry, | |||
| 498 | dir->i_sb)->mount_crypt_stat; | 498 | dir->i_sb)->mount_crypt_stat; |
| 499 | rc = ecryptfs_encrypt_and_encode_filename(&encoded_symname, | 499 | rc = ecryptfs_encrypt_and_encode_filename(&encoded_symname, |
| 500 | &encoded_symlen, | 500 | &encoded_symlen, |
| 501 | NULL, | ||
| 502 | mount_crypt_stat, symname, | 501 | mount_crypt_stat, symname, |
| 503 | strlen(symname)); | 502 | strlen(symname)); |
| 504 | if (rc) | 503 | if (rc) |
