aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-05-07 21:24:47 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-11-03 15:21:11 -0500
commit48eddfd5ca591d2bd97594afd58cffa6b5a48ef4 (patch)
tree97eada0ec16e98c46a101c8b407a4b47c506a215 /drivers/staging/lustre
parentmove d_rcu from overlapping d_child to overlapping d_alias (diff)
downloadlinux-dev-48eddfd5ca591d2bd97594afd58cffa6b5a48ef4.tar.xz
linux-dev-48eddfd5ca591d2bd97594afd58cffa6b5a48ef4.zip
lustre: switch ll_intent_file_open() to struct dentry *
... because fake struct file is wrong. ll_prep_inode() in there is an atrocity - despite passing a pointer to inode by address, it actually only uses the value when that value is non-NULL, as it will be here. Oh, and ->d_parent of anything is never NULL. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/staging/lustre')
-rw-r--r--drivers/staging/lustre/lustre/llite/file.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
index c99b74117152..382b53a8ce62 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -394,21 +394,19 @@ int ll_file_release(struct inode *inode, struct file *file)
return rc;
}
-static int ll_intent_file_open(struct file *file, void *lmm,
+static int ll_intent_file_open(struct dentry *dentry, void *lmm,
int lmmsize, struct lookup_intent *itp)
{
- struct ll_sb_info *sbi = ll_i2sbi(file->f_dentry->d_inode);
- struct dentry *parent = file->f_dentry->d_parent;
- const char *name = file->f_dentry->d_name.name;
- const int len = file->f_dentry->d_name.len;
+ struct inode *inode = dentry->d_inode;
+ struct ll_sb_info *sbi = ll_i2sbi(inode);
+ struct dentry *parent = dentry->d_parent;
+ const char *name = dentry->d_name.name;
+ const int len = dentry->d_name.len;
struct md_op_data *op_data;
struct ptlrpc_request *req;
__u32 opc = LUSTRE_OPC_ANY;
int rc;
- if (!parent)
- return -ENOENT;
-
/* Usually we come here only for NFSD, and we want open lock.
But we can also get here with pre 2.6.15 patchless kernels, and in
that case that lock is also ok */
@@ -425,7 +423,7 @@ static int ll_intent_file_open(struct file *file, void *lmm,
}
op_data = ll_prep_md_op_data(NULL, parent->d_inode,
- file->f_dentry->d_inode, name, len,
+ inode, name, len,
O_RDWR, opc, NULL);
if (IS_ERR(op_data))
return PTR_ERR(op_data);
@@ -441,7 +439,7 @@ static int ll_intent_file_open(struct file *file, void *lmm,
if (!it_disposition(itp, DISP_OPEN_OPEN) ||
it_open_error(DISP_OPEN_OPEN, itp))
goto out;
- ll_release_openhandle(file->f_dentry, itp);
+ ll_release_openhandle(dentry, itp);
goto out;
}
@@ -456,10 +454,9 @@ static int ll_intent_file_open(struct file *file, void *lmm,
goto out;
}
- rc = ll_prep_inode(&file->f_dentry->d_inode, req, NULL, itp);
+ rc = ll_prep_inode(&inode, req, NULL, itp);
if (!rc && itp->d.lustre.it_lock_mode)
- ll_set_lock_data(sbi->ll_md_exp, file->f_dentry->d_inode,
- itp, NULL);
+ ll_set_lock_data(sbi->ll_md_exp, inode, itp, NULL);
out:
ptlrpc_req_finished(req);
@@ -652,7 +649,7 @@ restart:
result in a deadlock */
mutex_unlock(&lli->lli_och_mutex);
it->it_create_mode |= M_CHECK_STALE;
- rc = ll_intent_file_open(file, NULL, 0, it);
+ rc = ll_intent_file_open(file->f_path.dentry, NULL, 0, it);
it->it_create_mode &= ~M_CHECK_STALE;
if (rc)
goto out_openerr;
@@ -1371,7 +1368,7 @@ int ll_lov_setstripe_ea_info(struct inode *inode, struct file *file,
}
ll_inode_size_lock(inode);
- rc = ll_intent_file_open(file, lum, lum_size, &oit);
+ rc = ll_intent_file_open(file->f_path.dentry, lum, lum_size, &oit);
if (rc)
goto out_unlock;
rc = oit.d.lustre.it_status;