Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jianpeng Ma and committed by
Ilya Dryomov
e36d571d a43137f7

+1 -5
+1 -5
fs/ceph/file.c
··· 136 136 struct ceph_mds_client *mdsc = fsc->mdsc; 137 137 struct ceph_mds_request *req; 138 138 struct ceph_file_info *cf = file->private_data; 139 - struct inode *parent_inode = NULL; 140 139 int err; 141 140 int flags, fmode, wanted; 142 141 ··· 209 210 ihold(inode); 210 211 211 212 req->r_num_caps = 1; 212 - if (flags & O_CREAT) 213 - parent_inode = ceph_get_dentry_parent_inode(file->f_path.dentry); 214 - err = ceph_mdsc_do_request(mdsc, parent_inode, req); 215 - iput(parent_inode); 213 + err = ceph_mdsc_do_request(mdsc, NULL, req); 216 214 if (!err) 217 215 err = ceph_init_file(inode, file, req->r_fmode); 218 216 ceph_mdsc_put_request(req);