[BLKID_CHAIN_PARTS] = &partitions_drv
};
-static struct blkid_prval *blkid_probe_new_value(void);
static void blkid_probe_reset_values(blkid_probe pr);
static void blkid_probe_reset_buffer(blkid_probe pr);
chn->idx = -1;
}
-/*
-static struct blkid_prval *blkid_probe_copy_value(struct blkid_prval *src)
-{
- struct blkid_prval *dest = blkid_probe_new_value();
-
- if (!dest)
- return NULL;
-
- memcpy(dest, src, sizeof(struct blkid_prval));
-
- dest->data = malloc(src->len);
- if (!dest->data)
- return NULL;
-
- memcpy(dest->data, src->data, src->len);
-
- INIT_LIST_HEAD(&dest->prvals);
- return dest;
-}
-*/
-
/*
* Move chain values from probing result to @vals
*/
{
struct blkid_prval *v;
- v = blkid_probe_new_value();
+ v = calloc(1, sizeof(struct blkid_prval));
if (!v)
return NULL;
+ INIT_LIST_HEAD(&v->prvals);
v->name = name;
v->chain = pr->cur_chain;
list_add_tail(&v->prvals, &pr->values);
return v;
}
-static struct blkid_prval *blkid_probe_new_value(void)
-{
- struct blkid_prval *v = calloc(1, sizeof(struct blkid_prval));
- if (!v)
- return NULL;
-
- INIT_LIST_HEAD(&v->prvals);
-
- return v;
-}
-
/* Note that value data is always terminated by zero to keep things robust,
* this extra zero is not count to the value length. It's caller responsibility
* to set proper value length (for strings we count terminator to the length,