| 5258 | } |
| 5259 | |
| 5260 | void Client::kick_flushing_caps(Inode *in, MetaSession *session) |
| 5261 | { |
| 5262 | in->flags &= ~I_KICK_FLUSH; |
| 5263 | |
| 5264 | Cap *cap = in->auth_cap; |
| 5265 | ceph_assert(cap->session == session); |
| 5266 | |
| 5267 | ceph_tid_t last_snap_flush = 0; |
| 5268 | for (auto p = in->flushing_cap_tids.rbegin(); |
| 5269 | p != in->flushing_cap_tids.rend(); |
| 5270 | ++p) { |
| 5271 | if (!p->second) { |
| 5272 | last_snap_flush = p->first; |
| 5273 | break; |
| 5274 | } |
| 5275 | } |
| 5276 | |
| 5277 | int wanted = in->caps_wanted(); |
| 5278 | int used = get_caps_used(in) | in->caps_dirty(); |
| 5279 | auto it = in->cap_snaps.begin(); |
| 5280 | for (auto& p : in->flushing_cap_tids) { |
| 5281 | if (p.second) { |
| 5282 | int msg_flags = p.first < last_snap_flush ? MClientCaps::FLAG_PENDING_CAPSNAP : 0; |
| 5283 | send_cap(in, session, cap, msg_flags, used, wanted, (cap->issued | cap->implemented), |
| 5284 | p.second, p.first); |
| 5285 | } else { |
| 5286 | ceph_assert(it != in->cap_snaps.end()); |
| 5287 | ceph_assert(it->second.flush_tid == p.first); |
| 5288 | send_flush_snap(in, session, it->first, it->second); |
| 5289 | ++it; |
| 5290 | } |
| 5291 | } |
| 5292 | } |
| 5293 | |
| 5294 | void Client::kick_flushing_caps(MetaSession *session) |
| 5295 | { |
nothing calls this directly
no test coverage detected