Skip to content

Commit

Permalink
ceph: no need to get parent inode in ceph_open
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jianpeng Ma authored and Ilya Dryomov committed Sep 8, 2015
1 parent a43137f commit e36d571
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions fs/ceph/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ int ceph_open(struct inode *inode, struct file *file)
struct ceph_mds_client *mdsc = fsc->mdsc;
struct ceph_mds_request *req;
struct ceph_file_info *cf = file->private_data;
struct inode *parent_inode = NULL;
int err;
int flags, fmode, wanted;

Expand Down Expand Up @@ -210,10 +209,7 @@ int ceph_open(struct inode *inode, struct file *file)
ihold(inode);

req->r_num_caps = 1;
if (flags & O_CREAT)
parent_inode = ceph_get_dentry_parent_inode(file->f_path.dentry);
err = ceph_mdsc_do_request(mdsc, parent_inode, req);
iput(parent_inode);
err = ceph_mdsc_do_request(mdsc, NULL, req);
if (!err)
err = ceph_init_file(inode, file, req->r_fmode);
ceph_mdsc_put_request(req);
Expand Down

0 comments on commit e36d571

Please sign in to comment.