pga->flag &= ~OBD_BRW_FROM_GRANT;
atomic_long_dec(&obd_dirty_pages);
cli->cl_dirty_pages--;
- if (pga->flag & OBD_BRW_NOCACHE) {
- pga->flag &= ~OBD_BRW_NOCACHE;
- atomic_long_dec(&obd_dirty_transit_pages);
- cli->cl_dirty_transit--;
- }
EXIT;
}
*/
static int osc_enter_cache_try(struct client_obd *cli,
struct osc_async_page *oap,
- int bytes, int transient)
+ int bytes)
{
int rc;
if (atomic_long_add_return(1, &obd_dirty_pages) <=
obd_max_dirty_pages) {
osc_consume_write_grant(cli, &oap->oap_brw_page);
- if (transient) {
- cli->cl_dirty_transit++;
- atomic_long_inc(&obd_dirty_transit_pages);
- oap->oap_brw_flags |= OBD_BRW_NOCACHE;
- }
rc = 1;
goto out;
} else
/* Hopefully normal case - cache space and write credits available */
if (list_empty(&cli->cl_cache_waiters) &&
- osc_enter_cache_try(cli, oap, bytes, 0)) {
+ osc_enter_cache_try(cli, oap, bytes)) {
OSC_DUMP_GRANT(D_CACHE, cli, "granted from cache\n");
GOTO(out, rc = 0);
}
if (rc != -EDQUOT)
break;
- if (osc_enter_cache_try(cli, oap, bytes, 0)) {
+ if (osc_enter_cache_try(cli, oap, bytes)) {
rc = 0;
break;
}
ocw->ocw_rc = -EDQUOT;
- if (osc_enter_cache_try(cli, ocw->ocw_oap, ocw->ocw_grant, 0))
+ if (osc_enter_cache_try(cli, ocw->ocw_oap, ocw->ocw_grant))
ocw->ocw_rc = 0;
if (ocw->ocw_rc == 0 ||
/* it doesn't need any grant to dirty this page */
spin_lock(&cli->cl_loi_list_lock);
- rc = osc_enter_cache_try(cli, oap, grants, 0);
+ rc = osc_enter_cache_try(cli, oap, grants);
if (rc == 0) { /* try failed */
grants = 0;
need_release = 1;