Skip to content

Commit e36d571

Browse files
majianpengidryomov
authored andcommitted
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>
1 parent a43137f commit e36d571

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

fs/ceph/file.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ int ceph_open(struct inode *inode, struct file *file)
136136
struct ceph_mds_client *mdsc = fsc->mdsc;
137137
struct ceph_mds_request *req;
138138
struct ceph_file_info *cf = file->private_data;
139-
struct inode *parent_inode = NULL;
140139
int err;
141140
int flags, fmode, wanted;
142141

@@ -210,10 +209,7 @@ int ceph_open(struct inode *inode, struct file *file)
210209
ihold(inode);
211210

212211
req->r_num_caps = 1;
213-
if (flags & O_CREAT)
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);
212+
err = ceph_mdsc_do_request(mdsc, NULL, req);
217213
if (!err)
218214
err = ceph_init_file(inode, file, req->r_fmode);
219215
ceph_mdsc_put_request(req);

0 commit comments

Comments
 (0)