aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-05-21 11:02:14 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-05-21 18:31:28 -0400
commit02bd97997a07a89cb9311c7f00864cfc785c37f9 (patch)
treec962381bd79b8611bc4d3b3e369f2ce8fe3c6174 /fs/ecryptfs
parentbef5bc2464517cbbf8f85f09b5ade46904afec9a (diff)
switch ecryptfs_get_locked_page() to struct inode *
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ecryptfs')
-rw-r--r--fs/ecryptfs/ecryptfs_kernel.h2
-rw-r--r--fs/ecryptfs/mmap.c12
-rw-r--r--fs/ecryptfs/read_write.c8
3 files changed, 7 insertions, 15 deletions
diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h
index bfc2e0f78f00..84dd2f88d00a 100644
--- a/fs/ecryptfs/ecryptfs_kernel.h
+++ b/fs/ecryptfs/ecryptfs_kernel.h
@@ -739,7 +739,7 @@ int ecryptfs_read_lower_page_segment(struct page *page_for_ecryptfs,
739 pgoff_t page_index, 739 pgoff_t page_index,
740 size_t offset_in_page, size_t size, 740 size_t offset_in_page, size_t size,
741 struct inode *ecryptfs_inode); 741 struct inode *ecryptfs_inode);
742struct page *ecryptfs_get_locked_page(struct file *file, loff_t index); 742struct page *ecryptfs_get_locked_page(struct inode *inode, loff_t index);
743int ecryptfs_exorcise_daemon(struct ecryptfs_daemon *daemon); 743int ecryptfs_exorcise_daemon(struct ecryptfs_daemon *daemon);
744int ecryptfs_find_daemon_by_euid(struct ecryptfs_daemon **daemon, uid_t euid, 744int ecryptfs_find_daemon_by_euid(struct ecryptfs_daemon **daemon, uid_t euid,
745 struct user_namespace *user_ns); 745 struct user_namespace *user_ns);
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
index 14e81c26c3ed..b1d82756544b 100644
--- a/fs/ecryptfs/mmap.c
+++ b/fs/ecryptfs/mmap.c
@@ -44,17 +44,9 @@
44 * Returns locked and up-to-date page (if ok), with increased 44 * Returns locked and up-to-date page (if ok), with increased
45 * refcnt. 45 * refcnt.
46 */ 46 */
47struct page *ecryptfs_get_locked_page(struct file *file, loff_t index) 47struct page *ecryptfs_get_locked_page(struct inode *inode, loff_t index)
48{ 48{
49 struct dentry *dentry; 49 struct page *page = read_mapping_page(inode->i_mapping, index, NULL);
50 struct inode *inode;
51 struct address_space *mapping;
52 struct page *page;
53
54 dentry = file->f_path.dentry;
55 inode = dentry->d_inode;
56 mapping = inode->i_mapping;
57 page = read_mapping_page(mapping, index, (void *)file);
58 if (!IS_ERR(page)) 50 if (!IS_ERR(page))
59 lock_page(page); 51 lock_page(page);
60 return page; 52 return page;
diff --git a/fs/ecryptfs/read_write.c b/fs/ecryptfs/read_write.c
index 0cc4fafd6552..3cc17a96cf24 100644
--- a/fs/ecryptfs/read_write.c
+++ b/fs/ecryptfs/read_write.c
@@ -145,7 +145,7 @@ int ecryptfs_write(struct file *ecryptfs_file, char *data, loff_t offset,
145 if (num_bytes > total_remaining_zeros) 145 if (num_bytes > total_remaining_zeros)
146 num_bytes = total_remaining_zeros; 146 num_bytes = total_remaining_zeros;
147 } 147 }
148 ecryptfs_page = ecryptfs_get_locked_page(ecryptfs_file, 148 ecryptfs_page = ecryptfs_get_locked_page(ecryptfs_inode,
149 ecryptfs_page_idx); 149 ecryptfs_page_idx);
150 if (IS_ERR(ecryptfs_page)) { 150 if (IS_ERR(ecryptfs_page)) {
151 rc = PTR_ERR(ecryptfs_page); 151 rc = PTR_ERR(ecryptfs_page);
@@ -302,10 +302,10 @@ int ecryptfs_read_lower_page_segment(struct page *page_for_ecryptfs,
302int ecryptfs_read(char *data, loff_t offset, size_t size, 302int ecryptfs_read(char *data, loff_t offset, size_t size,
303 struct file *ecryptfs_file) 303 struct file *ecryptfs_file)
304{ 304{
305 struct inode *ecryptfs_inode = ecryptfs_file->f_dentry->d_inode;
305 struct page *ecryptfs_page; 306 struct page *ecryptfs_page;
306 char *ecryptfs_page_virt; 307 char *ecryptfs_page_virt;
307 loff_t ecryptfs_file_size = 308 loff_t ecryptfs_file_size = i_size_read(ecryptfs_inode);
308 i_size_read(ecryptfs_file->f_dentry->d_inode);
309 loff_t data_offset = 0; 309 loff_t data_offset = 0;
310 loff_t pos; 310 loff_t pos;
311 int rc = 0; 311 int rc = 0;
@@ -327,7 +327,7 @@ int ecryptfs_read(char *data, loff_t offset, size_t size,
327 327
328 if (num_bytes > total_remaining_bytes) 328 if (num_bytes > total_remaining_bytes)
329 num_bytes = total_remaining_bytes; 329 num_bytes = total_remaining_bytes;
330 ecryptfs_page = ecryptfs_get_locked_page(ecryptfs_file, 330 ecryptfs_page = ecryptfs_get_locked_page(ecryptfs_inode,
331 ecryptfs_page_idx); 331 ecryptfs_page_idx);
332 if (IS_ERR(ecryptfs_page)) { 332 if (IS_ERR(ecryptfs_page)) {
333 rc = PTR_ERR(ecryptfs_page); 333 rc = PTR_ERR(ecryptfs_page);