| 395 | } |
| 396 | |
| 397 | void CInode::remove_need_snapflush(CInode *snapin, snapid_t snapid, client_t client) |
| 398 | { |
| 399 | dout(10) << __func__ << " client." << client << " snapid " << snapid << " on " << snapin << dendl; |
| 400 | auto it = client_need_snapflush.find(snapid); |
| 401 | if (it == client_need_snapflush.end()) { |
| 402 | dout(10) << " snapid not found" << dendl; |
| 403 | return; |
| 404 | } |
| 405 | size_t n = it->second.erase(client); |
| 406 | if (n == 0) { |
| 407 | dout(10) << " client not found" << dendl; |
| 408 | return; |
| 409 | } |
| 410 | if (it->second.empty()) { |
| 411 | client_need_snapflush.erase(it); |
| 412 | snapin->auth_unpin(this); |
| 413 | |
| 414 | if (client_need_snapflush.empty()) { |
| 415 | put(CInode::PIN_NEEDSNAPFLUSH); |
| 416 | auth_unpin(this); |
| 417 | } |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | pair<bool,bool> CInode::split_need_snapflush(CInode *cowin, CInode *in) |
| 422 | { |