Touch the dir cap for the lease's mds even if we use the lease to traverse.
This makes the trim_caps() behave better because it keeps the dentry and
session cap LRUs in sync.
Signed-off-by: Sage Weil <sage@newdream.net>
if (s->cap_ttl > now &&
s->cap_gen == dn->lease_gen) {
*target = dn->inode;
+ // touch this mds's dir cap too, even though we don't _explicitly_ use it here, to
+ // make trim_caps() behave.
+ try_touch_cap(dir, dn->lease_mds);
touch_dn(dn);
goto done;
}
// move to back of LRU
cap->session->caps.push_back(&cap->cap_item);
}
+ void try_touch_cap(Inode *inode, int mds) {
+ if (caps.count(mds))
+ touch_cap[mds];
+ }
bool caps_issued_mask(unsigned mask) {
int c = exporting_issued | snap_caps;
if ((c & mask) == mask)