]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ceph: add a new flag to indicate whether parent is locked
authorJeff Layton <jlayton@redhat.com>
Tue, 31 Jan 2017 15:28:26 +0000 (10:28 -0500)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 20 Feb 2017 11:16:08 +0000 (12:16 +0100)
commit3dd69aabcef3d835446a9a1e11d2eab0e6e35e95
treefbdf29895f376a78acc6538bc6c0f0fe05173ae9
parentbc2de10dc4da5036ada3381775bd966f0c21c603
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>
fs/ceph/dir.c
fs/ceph/export.c
fs/ceph/file.c
fs/ceph/inode.c
fs/ceph/mds_client.c
fs/ceph/mds_client.h