tgd->tgd_grant_compat_disable) || left == 0 || exp->exp_failed)
RETURN(0);
- if (want > 0x7fffffff) {
- CERROR("%s: client %s/%p requesting > 2GB grant %llu\n",
- obd->obd_name, exp->exp_client_uuid.uuid, exp, want);
+ if (want > OBD_MAX_GRANT) {
+ CERROR("%s: client %s/%p requesting > max (%lu), %llu\n",
+ obd->obd_name, exp->exp_client_uuid.uuid, exp,
+ OBD_MAX_GRANT, want);
RETURN(0);
}
* client would like to have by more than grants for 2 full
* RPCs
*/
+ if (want + chunk <= ted->ted_grant)
+ RETURN(0);
if (ted->ted_grant + grant > want + chunk)
grant = want + chunk - ted->ted_grant;
void tgt_grant_discard(struct obd_export *exp)
{
struct obd_device *obd = exp->exp_obd;
- struct tg_grants_data *tgd = &obd->u.obt.obt_lut->lut_tgd;
+ struct lu_target *lut = class_exp2tgt(exp);
struct tg_export_data *ted = &exp->exp_target_data;
+ struct tg_grants_data *tgd;
+
+ if (!lut)
+ return;
+ tgd = &lut->lut_tgd;
spin_lock(&tgd->tgd_grant_lock);
LASSERTF(tgd->tgd_tot_granted >= ted->ted_grant,
"%s: tot_granted %llu cli %s/%p ted_grant %ld\n",