提交 e36d571d 编写于 作者: J Jianpeng Ma 提交者: Ilya Dryomov

ceph: no need to get parent inode in ceph_open

parent inode is needed in creating new inode case.  For ceph_open,
the target inode already exists.
Signed-off-by: NJianpeng Ma <jianpeng.ma@intel.com>
Signed-off-by: NYan, Zheng <zyan@redhat.com>
上级 a43137f7
...@@ -136,7 +136,6 @@ int ceph_open(struct inode *inode, struct file *file) ...@@ -136,7 +136,6 @@ int ceph_open(struct inode *inode, struct file *file)
struct ceph_mds_client *mdsc = fsc->mdsc; struct ceph_mds_client *mdsc = fsc->mdsc;
struct ceph_mds_request *req; struct ceph_mds_request *req;
struct ceph_file_info *cf = file->private_data; struct ceph_file_info *cf = file->private_data;
struct inode *parent_inode = NULL;
int err; int err;
int flags, fmode, wanted; int flags, fmode, wanted;
...@@ -210,10 +209,7 @@ int ceph_open(struct inode *inode, struct file *file) ...@@ -210,10 +209,7 @@ int ceph_open(struct inode *inode, struct file *file)
ihold(inode); ihold(inode);
req->r_num_caps = 1; req->r_num_caps = 1;
if (flags & O_CREAT) err = ceph_mdsc_do_request(mdsc, NULL, req);
parent_inode = ceph_get_dentry_parent_inode(file->f_path.dentry);
err = ceph_mdsc_do_request(mdsc, parent_inode, req);
iput(parent_inode);
if (!err) if (!err)
err = ceph_init_file(inode, file, req->r_fmode); err = ceph_init_file(inode, file, req->r_fmode);
ceph_mdsc_put_request(req); ceph_mdsc_put_request(req);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册