/* parse remote buffers to local buffers and prepare the latter */
lnbs = (len >> PAGE_SHIFT) + 1;
- OBD_ALLOC(lnb, sizeof(*lnb) * lnbs);
+ OBD_ALLOC_PTR_ARRAY(lnb, lnbs);
if (lnb == NULL)
GOTO(unlock, rc = -ENOMEM);
buf_put:
dt_bufs_put(env, mo, lnb, nr_local);
free:
- OBD_FREE(lnb, sizeof(*lnb) * lnbs);
+ OBD_FREE_PTR_ARRAY(lnb, lnbs);
unlock:
dt_read_unlock(env, mo);
lu_object_put(env, &mo->do_lu);