in->clear_dirty_parent();
+ in->state_clear(CInode::STATE_NEEDSRECOVER);
+
in->authlock.clear_gather();
in->linklock.clear_gather();
in->dirfragtreelock.clear_gather();
}
if (cap->is_importing())
in->remove_client_cap(q->first);
+ else
+ cap->clear_clientwriteable();
}
in->put(CInode::PIN_IMPORTINGCAPS);
}
const map<client_t,Capability::Export> &export_map,
map<client_t,Capability::Import> &import_map)
{
+ const auto& client_ranges = in->get_projected_inode()->client_ranges;
+ auto r = client_ranges.cbegin();
+ bool needs_recover = false;
+
for (auto& it : export_map) {
dout(10) << "for client." << it.first << " on " << *in << dendl;
cap->mark_importing();
}
+ if (auth_cap) {
+ while (r != client_ranges.cend() && r->first < it.first) {
+ needs_recover = true;
+ ++r;
+ }
+ if (r != client_ranges.cend() && r->first == it.first) {
+ cap->mark_clientwriteable();
+ ++r;
+ }
+ }
+
// Always ask exporter mds to send cap export messages for auth caps.
// For non-auth caps, ask exporter mds to send cap export messages to
// clients who haven't opened sessions. The cap export messages will
}
}
+ if (auth_cap) {
+ if (r != client_ranges.cend())
+ needs_recover = true;
+ if (needs_recover)
+ in->state_set(CInode::STATE_NEEDSRECOVER);
+ }
+
if (peer >= 0) {
in->replica_caps_wanted = 0;
in->put(CInode::PIN_IMPORTINGCAPS);