summaryrefslogtreecommitdiff
path: root/fs/ceph/export.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2017-01-31 18:28:26 +0300
committerIlya Dryomov <idryomov@gmail.com>2017-02-20 14:16:08 +0300
commit3dd69aabcef3d835446a9a1e11d2eab0e6e35e95 (patch)
treefbdf29895f376a78acc6538bc6c0f0fe05173ae9 /fs/ceph/export.c
parentbc2de10dc4da5036ada3381775bd966f0c21c603 (diff)
downloadlinux-3dd69aabcef3d835446a9a1e11d2eab0e6e35e95.tar.xz
ceph: add a new flag to indicate whether parent is locked
struct ceph_mds_request has an r_locked_dir pointer, which is set to indicate the parent inode and that its i_rwsem is locked. In some critical places, we need to be able to indicate the parent inode to the request handling code, even when its i_rwsem may not be locked. Most of the code that operates on r_locked_dir doesn't require that the i_rwsem be locked. We only really need it to handle manipulation of the dcache. The rest (filling of the inode, updating dentry leases, etc.) already has its own locking. Add a new r_req_flags bit that indicates whether the parent is locked when doing the request, and rename the pointer to "r_parent". For now, all the places that set r_parent also set this flag, but that will change in a later patch. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Yan, Zheng <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/export.c')
-rw-r--r--fs/ceph/export.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/export.c b/fs/ceph/export.c
index 180bbef760f2..e8f11fa565c5 100644
--- a/fs/ceph/export.c
+++ b/fs/ceph/export.c
@@ -207,7 +207,8 @@ static int ceph_get_name(struct dentry *parent, char *name,
req->r_inode = d_inode(child);
ihold(d_inode(child));
req->r_ino2 = ceph_vino(d_inode(parent));
- req->r_locked_dir = d_inode(parent);
+ req->r_parent = d_inode(parent);
+ set_bit(CEPH_MDS_R_PARENT_LOCKED, &req->r_req_flags);
req->r_num_caps = 2;
err = ceph_mdsc_do_request(mdsc, NULL, req);