- /* dump datastore into logic-n */
- buf = g_try_malloc(ds->num_units * ds->ds_unitsize +
- DATASTORE_CHUNKSIZE);
- if (!buf) {
- sr_err("%s: buf malloc failed", __func__);
- return SR_ERR_MALLOC;
- }
-
- bufcnt = 0;
- for (d = ds->chunklist; d; d = d->next) {
- memcpy(buf + bufcnt, d->data,
- DATASTORE_CHUNKSIZE);
- bufcnt += DATASTORE_CHUNKSIZE;
- }