_ll_drop_pins();
- mount_cond.wait(lock, [this] {
- if (unsafe_sync_write > 0) {
- ldout(cct, 0) << unsafe_sync_write << " unsafe_sync_writes, waiting"
- << dendl;
- }
- return unsafe_sync_write <= 0;
- });
-
if (cct->_conf->client_oc) {
// flush/release all buffered data
std::list<InodeRef> anchor;
*/
void Client::_sync_write_commit(Inode *in)
{
- ceph_assert(unsafe_sync_write > 0);
- unsafe_sync_write--;
-
put_cap_ref(in, CEPH_CAP_FILE_BUFFER);
-
- ldout(cct, 15) << __func__ << " unsafe_sync_write = " << unsafe_sync_write << dendl;
- if (unsafe_sync_write == 0 && is_unmounting()) {
- ldout(cct, 10) << __func__ << " -- no more unsafe writes, unmount can proceed" << dendl;
- mount_cond.notify_all();
- }
}
int Client::write(int fd, const char *buf, loff_t size, loff_t offset)
// simple, non-atomic sync write
C_SaferCond onfinish("Client::_write flock");
- unsafe_sync_write++;
get_cap_ref(in, CEPH_CAP_FILE_BUFFER); // released by onsafe callback
filer->write_trunc(in->ino, &in->layout, in->snaprealm->get_snap_context(),
C_SaferCond onfinish("Client::_punch_hole flock");
- unsafe_sync_write++;
get_cap_ref(in, CEPH_CAP_FILE_BUFFER);
_invalidate_inode_cache(in, offset, length);