for (i = 0; i < fso[obj].fso_bufcnt; i++, n++) {
int tmp, bytes;
- /* should match code in osc_exit_cache() */
+ /* XXX: this is calculated with PAGE_SIZE on client */
bytes = rnb[n].len;
bytes += rnb[n].offset & (blocksize - 1);
tmp = (rnb[n].offset + rnb[n].len) & (blocksize - 1);
}
exp->exp_obd->u.filter.fo_tot_dirty -= used;
fed->fed_dirty -= used;
-
- if (fed->fed_dirty < 0 || fed->fed_grant < 0 || fed->fed_pending < 0) {
- CERROR("%s: cli %s/%p dirty %ld pend %ld grant %ld\n",
- exp->exp_obd->obd_name, exp->exp_client_uuid.uuid, exp,
- fed->fed_dirty, fed->fed_pending, fed->fed_grant);
- spin_unlock(&exp->exp_obd->obd_osfs_lock);
- LBUG();
- }
return rc;
}
static void osc_exit_cache(struct client_obd *cli, struct osc_async_page *oap,
int sent)
{
- int blocksize = cli->cl_import->imp_obd->obd_osfs.os_bsize ? : 4096;
ENTRY;
if (!(oap->oap_brw_flags & OBD_BRW_FROM_GRANT)) {
cli->cl_lost_grant += PAGE_SIZE;
CDEBUG(D_CACHE, "lost grant: %lu avail grant: %lu dirty: %lu\n",
cli->cl_lost_grant, cli->cl_avail_grant, cli->cl_dirty);
- } else if (PAGE_SIZE != blocksize && oap->oap_count != PAGE_SIZE) {
- /* For short writes we shouldn't count parts of pages that span
- * a whole block on the OST side, or our accounting goes wrong.
- * Should match the code in filter_grant_check. */
- int offset = (oap->oap_obj_off + oap->oap_page_off) & ~PAGE_MASK;
- int count = oap->oap_count + (offset & (blocksize - 1));
- int end = (offset + oap->oap_count) & (blocksize - 1);
- if (end)
- count += blocksize - end;
-
- cli->cl_lost_grant += PAGE_SIZE - count;
- CDEBUG(D_CACHE, "lost %lu grant: %lu avail: %lu dirty: %lu\n",
- PAGE_SIZE - count, cli->cl_lost_grant,
- cli->cl_avail_grant, cli->cl_dirty);
}
EXIT;