void *wait_handle;
int total_size = 0;
unsigned int qcids[MAXQUOTAS] = { oa->o_uid, oa->o_gid };
- int rec_pending[MAXQUOTAS] = { 0, 0 };
+ int rec_pending[MAXQUOTAS] = { 0, 0 }, quota_pages = 0;
ENTRY;
LASSERT(oti != NULL);
if (rc != 0)
GOTO(cleanup, rc);
- /* we try to get enough quota to write here, and let ldiskfs
- * decide if it is out of quota or not b=14783 */
- lquota_chkquota(filter_quota_interface_ref, obd, qcids, rec_pending,
- niocount, oti, LQUOTA_FLAGS_BLK, (void *)inode,
- obj->ioo_bufcnt);
-
iobuf = filter_iobuf_get(&obd->u.filter, oti);
if (IS_ERR(iobuf))
GOTO(cleanup, rc = PTR_ERR(iobuf));
loff_t this_size;
__u32 flags = lnb->flags;
- /* If overwriting an existing block, we don't need a grant */
- if (!(flags & OBD_BRW_GRANTED) && lnb->rc == -ENOSPC &&
- filter_range_is_mapped(inode, lnb->offset, lnb->len))
- lnb->rc = 0;
+ if (filter_range_is_mapped(inode, lnb->offset, lnb->len)) {
+ /* If overwriting an existing block,
+ * we don't need a grant */
+ if (!(flags & OBD_BRW_GRANTED) && lnb->rc == -ENOSPC)
+ lnb->rc = 0;
+ } else {
+ quota_pages++;
+ }
if (lnb->rc) { /* ENOSPC, network RPC error, etc. */
CDEBUG(D_INODE, "Skipping [%d] == %d\n", i, lnb->rc);
iobuf->dr_ignore_quota = 1;
}
+ /* we try to get enough quota to write here, and let ldiskfs
+ * decide if it is out of quota or not b=14783 */
+ lquota_chkquota(filter_quota_interface_ref, obd, qcids, rec_pending,
+ quota_pages, oti, LQUOTA_FLAGS_BLK, (void *)inode,
+ obj->ioo_bufcnt);
+
+
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
cleanup_phase = 2;