]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mds: introduce Server::rdlock_two_paths_xlock_destdn()
authorYan, Zheng <zyan@redhat.com>
Thu, 12 Sep 2019 07:34:12 +0000 (15:34 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 12 Dec 2019 18:04:11 +0000 (02:04 +0800)
commit246f647566095c173e5e0e54661696cea230f96e
treed6a2336c7ea5562786e4760da6a4d2fa85554e99
parentc1d7f93d7bd06d773b8035359548c0c9216398e3
mds: introduce Server::rdlock_two_paths_xlock_destdn()

The helper function is for requests that operate on two paths. It
ensures that the two paths get locks in proper order. The rule is:

 1. Lock directory inodes or dentries according to which trees they
    are under. Lock objects under fs root before objects under mdsdir.
 2. Lock directory inodes or dentries according to their depth, in
    ascending order.
 3. Lock directory inodes or dentries according to inode numbers or
    dentries' parent inode numbers, in ascending order.
 4. Lock dentries in the same directory in order of their keys.
 5. Lock non-directory inodes according to inode numbers, in ascending
    order.

This patch also makes handle_client_link() and handle_client_rename()
to use this helper function.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/Locker.cc
src/mds/MDCache.cc
src/mds/Mutation.cc
src/mds/Mutation.h
src/mds/Server.cc
src/mds/Server.h
src/mds/StrayManager.cc