Lines Matching refs:tpl_id
332 static int stats_v1_blob_init_locked(struct statsblobv1 *sb, uint32_t tpl_id,
965 stats_tpl_fetch(int tpl_id, struct statsblob_tpl **tpl) argument
972 if (tpl_id < 0 || tpl_id >= (int)ntpl) {
975 *tpl = tpllist[tpl_id];
986 int i, tpl_id; local
988 tpl_id = -ESRCH;
997 tpl_id = i;
1001 tpl_id = i;
1007 return (tpl_id);
1011 stats_tpl_id2name(uint32_t tpl_id, char *buf, size_t len) argument
1018 if (tpl_id < ntpl) {
1019 if (buf != NULL && len > strlen(tpllist[tpl_id]->mb->tplname))
1020 strlcpy(buf, tpllist[tpl_id]->mb->tplname, len);
1158 int tpl_id; local
1203 tpl_id = ntpl++;
1205 tpllist[tpl_id] = (struct statsblob_tpl *)tpl;
1206 stats_tpl_update_hash(tpllist[tpl_id]);
1214 tpl_id = -ENOMEM;
1218 return (tpl_id);
1222 stats_v1_tpl_add_voistats(uint32_t tpl_id, int32_t voi_id, const char *voi_name, argument
1260 if (tpl_id < ntpl) {
1261 tpl_sb = (struct statsblobv1 *)tpllist[tpl_id]->sb;
1262 tpl_mb = tpllist[tpl_id]->mb;
1316 tpllist[tpl_id]->sb = (struct statsblob *)tpl_sb;
1374 stats_tpl_update_hash(tpllist[tpl_id]);
1385 stats_v1_blob_alloc(uint32_t tpl_id, uint32_t flags __unused) argument
1393 if (tpl_id < ntpl) {
1394 sb = stats_realloc(NULL, 0, tpllist[tpl_id]->sb->maxsz, 0);
1396 sb->maxsz = tpllist[tpl_id]->sb->maxsz;
1397 error = stats_v1_blob_init_locked(sb, tpl_id, 0);
1445 stats_v1_blob_init(struct statsblobv1 *sb, uint32_t tpl_id, uint32_t flags) argument
1452 if (sb == NULL || tpl_id >= ntpl) {
1455 error = stats_v1_blob_init_locked(sb, tpl_id, flags);
1463 stats_v1_blob_init_locked(struct statsblobv1 *sb, uint32_t tpl_id, argument
1469 error = (sb->maxsz >= tpllist[tpl_id]->sb->cursz) ? 0 : EOVERFLOW;
1471 ("sb %d instead of %d bytes", sb->maxsz, tpllist[tpl_id]->sb->cursz));
1474 memcpy(sb, tpllist[tpl_id]->sb, tpllist[tpl_id]->sb->cursz);
1476 sb->tplhash = tpllist[tpl_id]->mb->tplhash;