diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-16 12:05:38 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-29 04:57:25 -0400 |
commit | 0747fdb2bd59d9404ae2345cbddd7d837c5c4648 (patch) | |
tree | 5f44e37709f8d986df086e4417dc2b5da91cca4a /fs | |
parent | cb5e05d1a6786dfd393cf4825d626817df01c2c3 (diff) |
ecryptfs: switch ecryptfs_decode_and_decrypt_filename() from dentry to sb
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ecryptfs/crypto.c | 5 | ||||
-rw-r--r-- | fs/ecryptfs/ecryptfs_kernel.h | 2 | ||||
-rw-r--r-- | fs/ecryptfs/file.c | 9 | ||||
-rw-r--r-- | fs/ecryptfs/inode.c | 2 |
4 files changed, 8 insertions, 10 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index f71ec125290d..cfa109a4d5a2 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c | |||
@@ -2243,12 +2243,11 @@ out: | |||
2243 | */ | 2243 | */ |
2244 | int ecryptfs_decode_and_decrypt_filename(char **plaintext_name, | 2244 | int ecryptfs_decode_and_decrypt_filename(char **plaintext_name, |
2245 | size_t *plaintext_name_size, | 2245 | size_t *plaintext_name_size, |
2246 | struct dentry *ecryptfs_dir_dentry, | 2246 | struct super_block *sb, |
2247 | const char *name, size_t name_size) | 2247 | const char *name, size_t name_size) |
2248 | { | 2248 | { |
2249 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat = | 2249 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat = |
2250 | &ecryptfs_superblock_to_private( | 2250 | &ecryptfs_superblock_to_private(sb)->mount_crypt_stat; |
2251 | ecryptfs_dir_dentry->d_sb)->mount_crypt_stat; | ||
2252 | char *decoded_name; | 2251 | char *decoded_name; |
2253 | size_t decoded_name_size; | 2252 | size_t decoded_name_size; |
2254 | size_t packet_size; | 2253 | size_t packet_size; |
diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h index f622a733f7ad..df19d34a033b 100644 --- a/fs/ecryptfs/ecryptfs_kernel.h +++ b/fs/ecryptfs/ecryptfs_kernel.h | |||
@@ -575,7 +575,7 @@ int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry, | |||
575 | struct inode *ecryptfs_inode); | 575 | struct inode *ecryptfs_inode); |
576 | int ecryptfs_decode_and_decrypt_filename(char **decrypted_name, | 576 | int ecryptfs_decode_and_decrypt_filename(char **decrypted_name, |
577 | size_t *decrypted_name_size, | 577 | size_t *decrypted_name_size, |
578 | struct dentry *ecryptfs_dentry, | 578 | struct super_block *sb, |
579 | const char *name, size_t name_size); | 579 | const char *name, size_t name_size); |
580 | int ecryptfs_fill_zeros(struct file *file, loff_t new_length); | 580 | int ecryptfs_fill_zeros(struct file *file, loff_t new_length); |
581 | int ecryptfs_encrypt_and_encode_filename( | 581 | int ecryptfs_encrypt_and_encode_filename( |
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c index 9aa05e08060b..24f1105fda3a 100644 --- a/fs/ecryptfs/file.c +++ b/fs/ecryptfs/file.c | |||
@@ -70,7 +70,7 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb, | |||
70 | struct ecryptfs_getdents_callback { | 70 | struct ecryptfs_getdents_callback { |
71 | struct dir_context ctx; | 71 | struct dir_context ctx; |
72 | struct dir_context *caller; | 72 | struct dir_context *caller; |
73 | struct dentry *dentry; | 73 | struct super_block *sb; |
74 | int filldir_called; | 74 | int filldir_called; |
75 | int entries_written; | 75 | int entries_written; |
76 | }; | 76 | }; |
@@ -88,7 +88,7 @@ ecryptfs_filldir(void *dirent, const char *lower_name, int lower_namelen, | |||
88 | 88 | ||
89 | buf->filldir_called++; | 89 | buf->filldir_called++; |
90 | rc = ecryptfs_decode_and_decrypt_filename(&name, &name_size, | 90 | rc = ecryptfs_decode_and_decrypt_filename(&name, &name_size, |
91 | buf->dentry, lower_name, | 91 | buf->sb, lower_name, |
92 | lower_namelen); | 92 | lower_namelen); |
93 | if (rc) { | 93 | if (rc) { |
94 | printk(KERN_ERR "%s: Error attempting to decode and decrypt " | 94 | printk(KERN_ERR "%s: Error attempting to decode and decrypt " |
@@ -114,15 +114,14 @@ static int ecryptfs_readdir(struct file *file, struct dir_context *ctx) | |||
114 | { | 114 | { |
115 | int rc; | 115 | int rc; |
116 | struct file *lower_file; | 116 | struct file *lower_file; |
117 | struct inode *inode; | 117 | struct inode *inode = file_inode(file); |
118 | struct ecryptfs_getdents_callback buf = { | 118 | struct ecryptfs_getdents_callback buf = { |
119 | .ctx.actor = ecryptfs_filldir, | 119 | .ctx.actor = ecryptfs_filldir, |
120 | .caller = ctx, | 120 | .caller = ctx, |
121 | .dentry = file->f_path.dentry | 121 | .sb = inode->i_sb, |
122 | }; | 122 | }; |
123 | lower_file = ecryptfs_file_to_lower(file); | 123 | lower_file = ecryptfs_file_to_lower(file); |
124 | lower_file->f_pos = ctx->pos; | 124 | lower_file->f_pos = ctx->pos; |
125 | inode = file_inode(file); | ||
126 | rc = iterate_dir(lower_file, &buf.ctx); | 125 | rc = iterate_dir(lower_file, &buf.ctx); |
127 | ctx->pos = buf.ctx.pos; | 126 | ctx->pos = buf.ctx.pos; |
128 | if (rc < 0) | 127 | if (rc < 0) |
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 5eab400e2590..a2f2bb2c256d 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
@@ -679,7 +679,7 @@ static int ecryptfs_readlink_lower(struct dentry *dentry, char **buf, | |||
679 | set_fs(old_fs); | 679 | set_fs(old_fs); |
680 | if (rc < 0) | 680 | if (rc < 0) |
681 | goto out; | 681 | goto out; |
682 | rc = ecryptfs_decode_and_decrypt_filename(buf, bufsiz, dentry, | 682 | rc = ecryptfs_decode_and_decrypt_filename(buf, bufsiz, dentry->d_sb, |
683 | lower_buf, rc); | 683 | lower_buf, rc); |
684 | out: | 684 | out: |
685 | kfree(lower_buf); | 685 | kfree(lower_buf); |