if (!prealloc_cf)
return -ENOMEM;
+retry_snap:
inode_lock(inode);
/* We can write back this queue in page reclaim */
goto out;
}
-retry_snap:
/* FIXME: not complete since it doesn't account for being at quota */
if (ceph_osdmap_flag(osdc, CEPH_OSDMAP_FULL)) {
err = -ENOSPC;
&prealloc_cf);
else
written = ceph_sync_write(iocb, &data, pos, snapc);
- if (written == -EOLDSNAPC) {
- dout("aio_write %p %llx.%llx %llu~%u"
- "got EOLDSNAPC, retrying\n",
- inode, ceph_vinop(inode),
- pos, (unsigned)count);
- inode_lock(inode);
- goto retry_snap;
- }
if (written > 0)
iov_iter_advance(from, written);
ceph_put_snap_context(snapc);
ceph_cap_string(got));
ceph_put_cap_refs(ci, got);
+ if (written == -EOLDSNAPC) {
+ dout("aio_write %p %llx.%llx %llu~%u" "got EOLDSNAPC, retrying\n",
+ inode, ceph_vinop(inode), pos, (unsigned)count);
+ goto retry_snap;
+ }
+
if (written >= 0) {
if (ceph_osdmap_flag(osdc, CEPH_OSDMAP_NEARFULL))
iocb->ki_flags |= IOCB_DSYNC;
-
written = generic_write_sync(iocb, written);
}