aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-02-05 16:36:05 -0500
committerYan, Zheng <zheng.z.yan@intel.com>2014-04-02 22:33:52 -0400
commit180061a58c17681dd236e5059ba57fe092dbe368 (patch)
tree8f5599c7a2eb11d61da593d908cc5d488b1db371
parent15289dc85b2d03d42d7e479476254be2b17c65d5 (diff)
ceph: avoid useless ceph_get_dentry_parent_inode() in ceph_rename()
This is just old_dir; no reason to abuse the dcache pointers. Reported-by: Al Viro <viro.zeniv.linux.org.uk> Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Yan, Zheng <zheng.z.yan@intel.com>
-rw-r--r--fs/ceph/dir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index e9918a0306d1..e07973718ebe 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -911,10 +911,11 @@ static int ceph_rename(struct inode *old_dir, struct dentry *old_dentry,
911 req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_RENAME, USE_AUTH_MDS); 911 req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_RENAME, USE_AUTH_MDS);
912 if (IS_ERR(req)) 912 if (IS_ERR(req))
913 return PTR_ERR(req); 913 return PTR_ERR(req);
914 ihold(old_dir);
914 req->r_dentry = dget(new_dentry); 915 req->r_dentry = dget(new_dentry);
915 req->r_num_caps = 2; 916 req->r_num_caps = 2;
916 req->r_old_dentry = dget(old_dentry); 917 req->r_old_dentry = dget(old_dentry);
917 req->r_old_dentry_dir = ceph_get_dentry_parent_inode(old_dentry); 918 req->r_old_dentry_dir = old_dir;
918 req->r_locked_dir = new_dir; 919 req->r_locked_dir = new_dir;
919 req->r_old_dentry_drop = CEPH_CAP_FILE_SHARED; 920 req->r_old_dentry_drop = CEPH_CAP_FILE_SHARED;
920 req->r_old_dentry_unless = CEPH_CAP_FILE_EXCL; 921 req->r_old_dentry_unless = CEPH_CAP_FILE_EXCL;