aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/read_write.c
diff options
context:
space:
mode:
authorMichael Halcrow <mhalcrow@us.ibm.com>2007-10-16 04:28:08 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:12 -0400
commit0216f7f7921759211e48e8b940eae29f0fe43902 (patch)
tree44999b1dfb49944bfd83881c8d9e0cbe3a90e2b7 /fs/ecryptfs/read_write.c
parentda0102a10aed2244d8fc34f289e81e502622b81e (diff)
eCryptfs: replace encrypt, decrypt, and inode size write
Replace page encryption and decryption routines and inode size write routine with versions that utilize the read_write.c functions. Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ecryptfs/read_write.c')
-rw-r--r--fs/ecryptfs/read_write.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/ecryptfs/read_write.c b/fs/ecryptfs/read_write.c
index e59c94add127..ccd2599e0a4f 100644
--- a/fs/ecryptfs/read_write.c
+++ b/fs/ecryptfs/read_write.c
@@ -154,8 +154,8 @@ int ecryptfs_write(struct file *ecryptfs_file, char *data, loff_t offset,
154 /* Read in the page from the lower 154 /* Read in the page from the lower
155 * into the eCryptfs inode page cache, 155 * into the eCryptfs inode page cache,
156 * decrypting */ 156 * decrypting */
157 if ((rc = ecryptfs_decrypt_page(NULL, /* placeholder for git-bisect */ 157 rc = ecryptfs_decrypt_page(ecryptfs_page);
158 ecryptfs_page))) { 158 if (rc) {
159 printk(KERN_ERR "%s: Error decrypting " 159 printk(KERN_ERR "%s: Error decrypting "
160 "page; rc = [%d]\n", 160 "page; rc = [%d]\n",
161 __FUNCTION__, rc); 161 __FUNCTION__, rc);
@@ -178,7 +178,7 @@ int ecryptfs_write(struct file *ecryptfs_file, char *data, loff_t offset,
178 } 178 }
179 kunmap_atomic(ecryptfs_page_virt, KM_USER0); 179 kunmap_atomic(ecryptfs_page_virt, KM_USER0);
180 flush_dcache_page(ecryptfs_page); 180 flush_dcache_page(ecryptfs_page);
181 rc = ecryptfs_encrypt_page(NULL /* placeholder for git-bisect */); 181 rc = ecryptfs_encrypt_page(ecryptfs_page);
182 if (rc) { 182 if (rc) {
183 printk(KERN_ERR "%s: Error encrypting " 183 printk(KERN_ERR "%s: Error encrypting "
184 "page; rc = [%d]\n", __FUNCTION__, rc); 184 "page; rc = [%d]\n", __FUNCTION__, rc);
@@ -190,8 +190,8 @@ int ecryptfs_write(struct file *ecryptfs_file, char *data, loff_t offset,
190 } 190 }
191 if ((offset + size) > ecryptfs_file_size) { 191 if ((offset + size) > ecryptfs_file_size) {
192 i_size_write(ecryptfs_file->f_dentry->d_inode, (offset + size)); 192 i_size_write(ecryptfs_file->f_dentry->d_inode, (offset + size));
193 rc = ecryptfs_write_inode_size_to_metadata(NULL, NULL, NULL, 193 rc = ecryptfs_write_inode_size_to_metadata(
194 NULL, 0); /* placeholders for git-bisect */ 194 ecryptfs_file->f_dentry->d_inode);
195 if (rc) { 195 if (rc) {
196 printk(KERN_ERR "Problem with " 196 printk(KERN_ERR "Problem with "
197 "ecryptfs_write_inode_size_to_metadata; " 197 "ecryptfs_write_inode_size_to_metadata; "
@@ -338,7 +338,7 @@ int ecryptfs_read(char *data, loff_t offset, size_t size,
338 ecryptfs_page_idx, rc); 338 ecryptfs_page_idx, rc);
339 goto out; 339 goto out;
340 } 340 }
341 rc = ecryptfs_decrypt_page(NULL /* placeholder for git-bisect */, ecryptfs_page); 341 rc = ecryptfs_decrypt_page(ecryptfs_page);
342 if (rc) { 342 if (rc) {
343 printk(KERN_ERR "%s: Error decrypting " 343 printk(KERN_ERR "%s: Error decrypting "
344 "page; rc = [%d]\n", __FUNCTION__, rc); 344 "page; rc = [%d]\n", __FUNCTION__, rc);