Commit bd243a4b authored by Josef "Jeff" Sipek's avatar Josef "Jeff" Sipek Committed by Linus Torvalds

[PATCH] ecryptfs: change uses of f_{dentry, vfsmnt} to use f_path

Change all the uses of f_{dentry,vfsmnt} to f_path.{dentry,mnt} in the
ecryptfs filesystem.
Signed-off-by: default avatarJosef "Jeff" Sipek <jsipek@cs.sunysb.edu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e6a00296
...@@ -76,7 +76,7 @@ static loff_t ecryptfs_llseek(struct file *file, loff_t offset, int origin) ...@@ -76,7 +76,7 @@ static loff_t ecryptfs_llseek(struct file *file, loff_t offset, int origin)
} }
ecryptfs_printk(KERN_DEBUG, "new_end_pos = [0x%.16x]\n", new_end_pos); ecryptfs_printk(KERN_DEBUG, "new_end_pos = [0x%.16x]\n", new_end_pos);
if (expanding_file) { if (expanding_file) {
rc = ecryptfs_truncate(file->f_dentry, new_end_pos); rc = ecryptfs_truncate(file->f_path.dentry, new_end_pos);
if (rc) { if (rc) {
rv = rc; rv = rc;
ecryptfs_printk(KERN_ERR, "Error on attempt to " ecryptfs_printk(KERN_ERR, "Error on attempt to "
...@@ -117,8 +117,8 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb, ...@@ -117,8 +117,8 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb,
if (-EIOCBQUEUED == rc) if (-EIOCBQUEUED == rc)
rc = wait_on_sync_kiocb(iocb); rc = wait_on_sync_kiocb(iocb);
if (rc >= 0) { if (rc >= 0) {
lower_dentry = ecryptfs_dentry_to_lower(file->f_dentry); lower_dentry = ecryptfs_dentry_to_lower(file->f_path.dentry);
lower_vfsmount = ecryptfs_dentry_to_lower_mnt(file->f_dentry); lower_vfsmount = ecryptfs_dentry_to_lower_mnt(file->f_path.dentry);
touch_atime(lower_vfsmount, lower_dentry); touch_atime(lower_vfsmount, lower_dentry);
} }
return rc; return rc;
...@@ -177,10 +177,10 @@ static int ecryptfs_readdir(struct file *file, void *dirent, filldir_t filldir) ...@@ -177,10 +177,10 @@ static int ecryptfs_readdir(struct file *file, void *dirent, filldir_t filldir)
lower_file = ecryptfs_file_to_lower(file); lower_file = ecryptfs_file_to_lower(file);
lower_file->f_pos = file->f_pos; lower_file->f_pos = file->f_pos;
inode = file->f_dentry->d_inode; inode = file->f_path.dentry->d_inode;
memset(&buf, 0, sizeof(buf)); memset(&buf, 0, sizeof(buf));
buf.dirent = dirent; buf.dirent = dirent;
buf.dentry = file->f_dentry; buf.dentry = file->f_path.dentry;
buf.filldir = filldir; buf.filldir = filldir;
retry: retry:
buf.filldir_called = 0; buf.filldir_called = 0;
...@@ -193,7 +193,7 @@ static int ecryptfs_readdir(struct file *file, void *dirent, filldir_t filldir) ...@@ -193,7 +193,7 @@ static int ecryptfs_readdir(struct file *file, void *dirent, filldir_t filldir)
goto retry; goto retry;
file->f_pos = lower_file->f_pos; file->f_pos = lower_file->f_pos;
if (rc >= 0) if (rc >= 0)
fsstack_copy_attr_atime(inode, lower_file->f_dentry->d_inode); fsstack_copy_attr_atime(inode, lower_file->f_path.dentry->d_inode);
return rc; return rc;
} }
...@@ -240,7 +240,7 @@ static int ecryptfs_open(struct inode *inode, struct file *file) ...@@ -240,7 +240,7 @@ static int ecryptfs_open(struct inode *inode, struct file *file)
int rc = 0; int rc = 0;
struct ecryptfs_crypt_stat *crypt_stat = NULL; struct ecryptfs_crypt_stat *crypt_stat = NULL;
struct ecryptfs_mount_crypt_stat *mount_crypt_stat; struct ecryptfs_mount_crypt_stat *mount_crypt_stat;
struct dentry *ecryptfs_dentry = file->f_dentry; struct dentry *ecryptfs_dentry = file->f_path.dentry;
/* Private value of ecryptfs_dentry allocated in /* Private value of ecryptfs_dentry allocated in
* ecryptfs_lookup() */ * ecryptfs_lookup() */
struct dentry *lower_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry); struct dentry *lower_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry);
......
...@@ -155,7 +155,7 @@ static int grow_file(struct dentry *ecryptfs_dentry, struct file *lower_file, ...@@ -155,7 +155,7 @@ static int grow_file(struct dentry *ecryptfs_dentry, struct file *lower_file,
struct ecryptfs_file_info tmp_file_info; struct ecryptfs_file_info tmp_file_info;
memset(&fake_file, 0, sizeof(fake_file)); memset(&fake_file, 0, sizeof(fake_file));
fake_file.f_dentry = ecryptfs_dentry; fake_file.f_path.dentry = ecryptfs_dentry;
memset(&tmp_file_info, 0, sizeof(tmp_file_info)); memset(&tmp_file_info, 0, sizeof(tmp_file_info));
ecryptfs_set_file_private(&fake_file, &tmp_file_info); ecryptfs_set_file_private(&fake_file, &tmp_file_info);
ecryptfs_set_file_lower(&fake_file, lower_file); ecryptfs_set_file_lower(&fake_file, lower_file);
...@@ -754,7 +754,7 @@ int ecryptfs_truncate(struct dentry *dentry, loff_t new_length) ...@@ -754,7 +754,7 @@ int ecryptfs_truncate(struct dentry *dentry, loff_t new_length)
* the file in the underlying filesystem so that the * the file in the underlying filesystem so that the
* truncation has an effect there as well. */ * truncation has an effect there as well. */
memset(&fake_ecryptfs_file, 0, sizeof(fake_ecryptfs_file)); memset(&fake_ecryptfs_file, 0, sizeof(fake_ecryptfs_file));
fake_ecryptfs_file.f_dentry = dentry; fake_ecryptfs_file.f_path.dentry = dentry;
/* Released at out_free: label */ /* Released at out_free: label */
ecryptfs_set_file_private(&fake_ecryptfs_file, ecryptfs_set_file_private(&fake_ecryptfs_file,
kmem_cache_alloc(ecryptfs_file_info_cache, kmem_cache_alloc(ecryptfs_file_info_cache,
......
...@@ -51,7 +51,7 @@ static struct page *ecryptfs_get1page(struct file *file, int index) ...@@ -51,7 +51,7 @@ static struct page *ecryptfs_get1page(struct file *file, int index)
struct inode *inode; struct inode *inode;
struct address_space *mapping; struct address_space *mapping;
dentry = file->f_dentry; dentry = file->f_path.dentry;
inode = dentry->d_inode; inode = dentry->d_inode;
mapping = inode->i_mapping; mapping = inode->i_mapping;
page = read_cache_page(mapping, index, page = read_cache_page(mapping, index,
...@@ -84,7 +84,7 @@ int write_zeros(struct file *file, pgoff_t index, int start, int num_zeros); ...@@ -84,7 +84,7 @@ int write_zeros(struct file *file, pgoff_t index, int start, int num_zeros);
int ecryptfs_fill_zeros(struct file *file, loff_t new_length) int ecryptfs_fill_zeros(struct file *file, loff_t new_length)
{ {
int rc = 0; int rc = 0;
struct dentry *dentry = file->f_dentry; struct dentry *dentry = file->f_path.dentry;
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
pgoff_t old_end_page_index = 0; pgoff_t old_end_page_index = 0;
pgoff_t index = old_end_page_index; pgoff_t index = old_end_page_index;
...@@ -218,7 +218,7 @@ int ecryptfs_do_readpage(struct file *file, struct page *page, ...@@ -218,7 +218,7 @@ int ecryptfs_do_readpage(struct file *file, struct page *page,
char *lower_page_data; char *lower_page_data;
const struct address_space_operations *lower_a_ops; const struct address_space_operations *lower_a_ops;
dentry = file->f_dentry; dentry = file->f_path.dentry;
lower_file = ecryptfs_file_to_lower(file); lower_file = ecryptfs_file_to_lower(file);
lower_dentry = ecryptfs_dentry_to_lower(dentry); lower_dentry = ecryptfs_dentry_to_lower(dentry);
inode = dentry->d_inode; inode = dentry->d_inode;
...@@ -275,9 +275,9 @@ static int ecryptfs_readpage(struct file *file, struct page *page) ...@@ -275,9 +275,9 @@ static int ecryptfs_readpage(struct file *file, struct page *page)
int rc = 0; int rc = 0;
struct ecryptfs_crypt_stat *crypt_stat; struct ecryptfs_crypt_stat *crypt_stat;
BUG_ON(!(file && file->f_dentry && file->f_dentry->d_inode)); BUG_ON(!(file && file->f_path.dentry && file->f_path.dentry->d_inode));
crypt_stat = crypt_stat = &ecryptfs_inode_to_private(file->f_path.dentry->d_inode)
&ecryptfs_inode_to_private(file->f_dentry->d_inode)->crypt_stat; ->crypt_stat;
if (!crypt_stat if (!crypt_stat
|| !ECRYPTFS_CHECK_FLAG(crypt_stat->flags, ECRYPTFS_ENCRYPTED) || !ECRYPTFS_CHECK_FLAG(crypt_stat->flags, ECRYPTFS_ENCRYPTED)
|| ECRYPTFS_CHECK_FLAG(crypt_stat->flags, ECRYPTFS_NEW_FILE)) { || ECRYPTFS_CHECK_FLAG(crypt_stat->flags, ECRYPTFS_NEW_FILE)) {
...@@ -638,8 +638,8 @@ static int ecryptfs_commit_write(struct file *file, struct page *page, ...@@ -638,8 +638,8 @@ static int ecryptfs_commit_write(struct file *file, struct page *page,
lower_inode = ecryptfs_inode_to_lower(inode); lower_inode = ecryptfs_inode_to_lower(inode);
lower_file = ecryptfs_file_to_lower(file); lower_file = ecryptfs_file_to_lower(file);
mutex_lock(&lower_inode->i_mutex); mutex_lock(&lower_inode->i_mutex);
crypt_stat = crypt_stat = &ecryptfs_inode_to_private(file->f_path.dentry->d_inode)
&ecryptfs_inode_to_private(file->f_dentry->d_inode)->crypt_stat; ->crypt_stat;
if (ECRYPTFS_CHECK_FLAG(crypt_stat->flags, ECRYPTFS_NEW_FILE)) { if (ECRYPTFS_CHECK_FLAG(crypt_stat->flags, ECRYPTFS_NEW_FILE)) {
ecryptfs_printk(KERN_DEBUG, "ECRYPTFS_NEW_FILE flag set in " ecryptfs_printk(KERN_DEBUG, "ECRYPTFS_NEW_FILE flag set in "
"crypt_stat at memory location [%p]\n", crypt_stat); "crypt_stat at memory location [%p]\n", crypt_stat);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment