diff options
author | Jianpeng Ma <jianpeng.ma@intel.com> | 2015-08-17 22:25:35 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-09-08 16:14:29 -0400 |
commit | e36d571d70c7f46b20c28d81025fd5fc044a8e22 (patch) | |
tree | a2076e99960b221c536aef9ca4e7a64f2dd70be2 | |
parent | a43137f7b0f1467cf3005b6ff6574d978642d247 (diff) |
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: Jianpeng Ma <jianpeng.ma@intel.com>
Signed-off-by: Yan, Zheng <zyan@redhat.com>
-rw-r--r-- | fs/ceph/file.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 2ebcbd4c163b..90ec110b8400 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -136,7 +136,6 @@ int ceph_open(struct inode *inode, struct file *file) | |||
136 | struct ceph_mds_client *mdsc = fsc->mdsc; | 136 | struct ceph_mds_client *mdsc = fsc->mdsc; |
137 | struct ceph_mds_request *req; | 137 | struct ceph_mds_request *req; |
138 | struct ceph_file_info *cf = file->private_data; | 138 | struct ceph_file_info *cf = file->private_data; |
139 | struct inode *parent_inode = NULL; | ||
140 | int err; | 139 | int err; |
141 | int flags, fmode, wanted; | 140 | int flags, fmode, wanted; |
142 | 141 | ||
@@ -210,10 +209,7 @@ int ceph_open(struct inode *inode, struct file *file) | |||
210 | ihold(inode); | 209 | ihold(inode); |
211 | 210 | ||
212 | req->r_num_caps = 1; | 211 | req->r_num_caps = 1; |
213 | if (flags & O_CREAT) | 212 | err = ceph_mdsc_do_request(mdsc, NULL, req); |
214 | parent_inode = ceph_get_dentry_parent_inode(file->f_path.dentry); | ||
215 | err = ceph_mdsc_do_request(mdsc, parent_inode, req); | ||
216 | iput(parent_inode); | ||
217 | if (!err) | 213 | if (!err) |
218 | err = ceph_init_file(inode, file, req->r_fmode); | 214 | err = ceph_init_file(inode, file, req->r_fmode); |
219 | ceph_mdsc_put_request(req); | 215 | ceph_mdsc_put_request(req); |