* is thus inflated. We already significantly overestimate
* overhead, no need to add the extent tax in this case */
return val << (tgd->tgd_blockbits - COMPAT_BSIZE_SHIFT);
- /* client can deal with the block size, but does not support per-extent
- * grant accounting, inflate grant by 100% for such clients */
- return val << 1;
+ return val;
}
/* Companion of tgt_grant_inflate() */
{
if (tgd->tgd_blockbits > COMPAT_BSIZE_SHIFT)
return val >> (tgd->tgd_blockbits - COMPAT_BSIZE_SHIFT);
- return val >> 1;
+ return val;
}
/* Grant chunk is used as a unit for grant allocation. It should be inflated
if ((data == NULL && !(exp_grant_param_supp(exp))) ||
(data != NULL && !OCD_HAS_FLAG(data, GRANT_PARAM)))
- /* Try to grant enough space to send a full-size RPC */
- return tgt_grant_inflate(tgd, chunk);
+ /* Try to grant enough space to send 2 full-size RPCs */
+ return tgt_grant_inflate(tgd, chunk) << 1;
/* Try to return enough to send two full-size RPCs
* = 2 * (BRW_size + #extents_in_BRW * grant_tax) */
* \retval >= 0 amount of grant space allocated to the precreate request
* \retval -ENOSPC on failure
*/
-long tgt_grant_create(const struct lu_env *env, struct obd_export *exp, int *nr)
+long tgt_grant_create(const struct lu_env *env, struct obd_export *exp, s64 *nr)
{
struct lu_target *lut = exp->exp_obd->u.obt.obt_lut;
struct tg_grants_data *tgd = &lut->lut_tgd;