diff options
author | Sage Weil <sage@newdream.net> | 2009-01-16 11:15:47 -0800 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2009-01-16 11:15:47 -0800 |
commit | 9a2c7e92d9773b40e15a1330684e587ea3c89871 (patch) | |
tree | 66f116df7fa6f4eeb70a85d67a90e618ef3cab00 /src/mds/CDentry.h | |
parent | b025d4f85627c0e0f948aae6fc278fefa8625b88 (diff) | |
download | ceph-9a2c7e92d9773b40e15a1330684e587ea3c89871.tar.gz |
mds: get_linkage() should return projected if xlocked by self
Also, move set_xlocks_done() to _below_ set_trace_dist, in case some
other request comes in and xlocks the dentry.
Allow read_projected in XLOCK state too. Note that other requests
_still_ won't be able to re-xlock or rdlock until the prior request
set xlock done.
Diffstat (limited to 'src/mds/CDentry.h')
-rw-r--r-- | src/mds/CDentry.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mds/CDentry.h b/src/mds/CDentry.h index b3db9b93dea..67c2b5753c0 100644 --- a/src/mds/CDentry.h +++ b/src/mds/CDentry.h @@ -207,11 +207,12 @@ public: return get_projected_linkage()->inode; } - bool use_projected(int client) { - return lock.can_read_projected(client); + bool use_projected(int client, Mutation *mut) { + return lock.can_read_projected(client) || + lock.get_xlocked_by() == mut; } - linkage_t *get_linkage(int client) { - return use_projected(client) ? get_projected_linkage() : get_linkage(); + linkage_t *get_linkage(int client, Mutation *mut) { + return use_projected(client, mut) ? get_projected_linkage() : get_linkage(); } // ref counts: pin ourselves in the LRU when we're pinned. |