diff options
author | Sage Weil <sage@newdream.net> | 2010-11-06 15:58:32 +0100 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-11-06 15:58:32 +0100 |
commit | a74054d11d9827e4f552b07a82d9a3ec4461e0a4 (patch) | |
tree | 6f98825f8ecd934fe63c696484a137a925f83efc /src/mds/ScatterLock.h | |
parent | mds: preserve stale state on import; some cleanup (diff) | |
download | ceph-a74054d11d9827e4f552b07a82d9a3ec4461e0a4.tar.xz ceph-a74054d11d9827e4f552b07a82d9a3ec4461e0a4.zip |
mds: simplify stale semantics a bit
is_stale() => next MIX is MIX_STALE. Stale flag is then cleared. Then we
special case the import to preserve stale-ness.
TODO: add_replica_inode likely has this same problem.
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'src/mds/ScatterLock.h')
-rw-r--r-- | src/mds/ScatterLock.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mds/ScatterLock.h b/src/mds/ScatterLock.h index d9ffada083f..f52bd1425cb 100644 --- a/src/mds/ScatterLock.h +++ b/src/mds/ScatterLock.h @@ -164,15 +164,18 @@ public: } } void apply_stale() { - if (state == LOCK_MIX_STALE) - set_stale(); - else if (is_stale() && state == LOCK_MIX) + if (state == LOCK_MIX && is_stale()) { state = LOCK_MIX_STALE; + clear_stale(); + } } - void set_and_apply_stale() { - set_stale(); - if (state == LOCK_MIX) + void set_or_apply_stale() { + if (state == LOCK_MIX) { state = LOCK_MIX_STALE; + clear_stale(); + } else { + set_stale(); + } } void set_last_scatter(utime_t t) { more()->last_scatter = t; } |