Skip to content

Commit bef5bc2

Browse files
author
Al Viro
committed
simplify access to ecryptfs inodes in ->readpage() and friends
we can get to them from page->mapping->host, no need to mess with file. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent f6d335c commit bef5bc2

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎fs/ecryptfs/mmap.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ ecryptfs_copy_up_encrypted_with_header(struct page *page,
198198
static int ecryptfs_readpage(struct file *file, struct page *page)
199199
{
200200
struct ecryptfs_crypt_stat *crypt_stat =
201-
&ecryptfs_inode_to_private(file->f_path.dentry->d_inode)->crypt_stat;
201+
&ecryptfs_inode_to_private(page->mapping->host)->crypt_stat;
202202
int rc = 0;
203203

204204
if (!crypt_stat
@@ -300,8 +300,7 @@ static int ecryptfs_write_begin(struct file *file,
300300

301301
if (!PageUptodate(page)) {
302302
struct ecryptfs_crypt_stat *crypt_stat =
303-
&ecryptfs_inode_to_private(
304-
file->f_path.dentry->d_inode)->crypt_stat;
303+
&ecryptfs_inode_to_private(mapping->host)->crypt_stat;
305304

306305
if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)
307306
|| (crypt_stat->flags & ECRYPTFS_NEW_FILE)) {
@@ -487,7 +486,7 @@ static int ecryptfs_write_end(struct file *file,
487486
unsigned to = from + copied;
488487
struct inode *ecryptfs_inode = mapping->host;
489488
struct ecryptfs_crypt_stat *crypt_stat =
490-
&ecryptfs_inode_to_private(file->f_path.dentry->d_inode)->crypt_stat;
489+
&ecryptfs_inode_to_private(ecryptfs_inode)->crypt_stat;
491490
int rc;
492491

493492
if (crypt_stat->flags & ECRYPTFS_NEW_FILE) {

0 commit comments

Comments
 (0)