Lines Matching refs:res

155 	struct hast_snmp_resource *res;  in free_resources()  local
157 while ((res = TAILQ_FIRST(&resources)) != NULL) { in free_resources()
158 TAILQ_REMOVE(&resources, res, link); in free_resources()
159 free(res); in free_resources()
272 struct hast_snmp_resource *res; in update_resources() local
299 res = calloc(1, sizeof(*res)); in update_resources()
300 if (res == NULL) { in update_resources()
302 "resource", sizeof(*res)); in update_resources()
305 res->index = i + 1; in update_resources()
306 strncpy(res->name, str, sizeof(res->name) - 1); in update_resources()
311 res->role = str != NULL ? str2role(str) : HAST_ROLE_UNDEF; in update_resources()
314 strncpy(res->provname, str, sizeof(res->provname) - 1); in update_resources()
317 strncpy(res->localpath, str, in update_resources()
318 sizeof(res->localpath) - 1); in update_resources()
320 res->extentsize = nv_get_uint32(nvout, "extentsize%u", i); in update_resources()
321 res->keepdirty = nv_get_uint32(nvout, "keepdirty%u", i); in update_resources()
324 strncpy(res->remoteaddr, str, in update_resources()
325 sizeof(res->remoteaddr) - 1); in update_resources()
329 strncpy(res->sourceaddr, str, in update_resources()
330 sizeof(res->sourceaddr) - 1); in update_resources()
333 res->replication = str != NULL ? str2replication(str) : -1; in update_resources()
335 res->status = str != NULL ? str2status(str) : -1; in update_resources()
336 res->dirty = nv_get_uint64(nvout, "dirty%u", i); in update_resources()
337 res->reads = nv_get_uint64(nvout, "stat_read%u", i); in update_resources()
338 res->writes = nv_get_uint64(nvout, "stat_write%u", i); in update_resources()
339 res->deletes = nv_get_uint64(nvout, "stat_delete%u", i); in update_resources()
340 res->flushes = nv_get_uint64(nvout, "stat_flush%u", i); in update_resources()
341 res->activemap_updates = in update_resources()
343 res->read_errors = in update_resources()
345 res->write_errors = in update_resources()
347 res->delete_errors = in update_resources()
349 res->flush_errors = in update_resources()
351 res->workerpid = nv_get_int32(nvout, "workerpid%u", i); in update_resources()
352 res->local_queue = in update_resources()
354 res->send_queue = in update_resources()
356 res->recv_queue = in update_resources()
358 res->done_queue = in update_resources()
360 res->idle_queue = in update_resources()
362 TAILQ_INSERT_TAIL(&resources, res, link); in update_resources()
405 struct hast_snmp_resource *res; in op_hastResourceTable() local
416 res = NEXT_OBJECT_INT(&resources, &value->var, sub); in op_hastResourceTable()
417 if (res == NULL) in op_hastResourceTable()
420 value->var.subs[sub] = res->index; in op_hastResourceTable()
425 res = FIND_OBJECT_INT(&resources, &value->var, sub); in op_hastResourceTable()
426 if (res == NULL) in op_hastResourceTable()
430 res = FIND_OBJECT_INT(&resources, &value->var, sub); in op_hastResourceTable()
431 if (res == NULL) in op_hastResourceTable()
435 ret = set_role(res->name, value->v.integer); in op_hastResourceTable()
455 value->v.integer = res->index; in op_hastResourceTable()
458 ret = string_get(value, res->name, -1); in op_hastResourceTable()
461 value->v.integer = res->role; in op_hastResourceTable()
464 ret = string_get(value, res->provname, -1); in op_hastResourceTable()
467 ret = string_get(value, res->localpath, -1); in op_hastResourceTable()
470 value->v.integer = res->extentsize; in op_hastResourceTable()
473 value->v.integer = res->keepdirty; in op_hastResourceTable()
476 ret = string_get(value, res->remoteaddr, -1); in op_hastResourceTable()
479 ret = string_get(value, res->sourceaddr, -1); in op_hastResourceTable()
482 value->v.integer = res->replication; in op_hastResourceTable()
485 value->v.integer = res->status; in op_hastResourceTable()
488 value->v.counter64 = res->dirty; in op_hastResourceTable()
491 value->v.counter64 = res->reads; in op_hastResourceTable()
494 value->v.counter64 = res->writes; in op_hastResourceTable()
497 value->v.counter64 = res->deletes; in op_hastResourceTable()
500 value->v.counter64 = res->flushes; in op_hastResourceTable()
503 value->v.counter64 = res->activemap_updates; in op_hastResourceTable()
506 value->v.counter64 = res->read_errors; in op_hastResourceTable()
509 value->v.counter64 = res->write_errors; in op_hastResourceTable()
512 value->v.counter64 = res->delete_errors; in op_hastResourceTable()
515 value->v.counter64 = res->flush_errors; in op_hastResourceTable()
518 value->v.integer = res->workerpid; in op_hastResourceTable()
521 value->v.uint32 = res->local_queue; in op_hastResourceTable()
524 value->v.uint32 = res->send_queue; in op_hastResourceTable()
527 value->v.uint32 = res->recv_queue; in op_hastResourceTable()
530 value->v.uint32 = res->done_queue; in op_hastResourceTable()
533 value->v.uint32 = res->idle_queue; in op_hastResourceTable()