Changeset View
Changeset View
Standalone View
Standalone View
sys/net/vnet.h
Show First 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | array##_sysctl(SYSCTL_HANDLER_ARGS) \ | ||||
CTASSERT((sizeof(type) / sizeof(uint64_t)) == \ | CTASSERT((sizeof(type) / sizeof(uint64_t)) == \ | ||||
(sizeof(VNET(array)) / sizeof(counter_u64_t))); \ | (sizeof(VNET(array)) / sizeof(counter_u64_t))); \ | ||||
COUNTER_ARRAY_COPY(VNET(array), &s, sizeof(type) / sizeof(uint64_t));\ | COUNTER_ARRAY_COPY(VNET(array), &s, sizeof(type) / sizeof(uint64_t));\ | ||||
if (req->newptr) \ | if (req->newptr) \ | ||||
COUNTER_ARRAY_ZERO(VNET(array), \ | COUNTER_ARRAY_ZERO(VNET(array), \ | ||||
sizeof(type) / sizeof(uint64_t)); \ | sizeof(type) / sizeof(uint64_t)); \ | ||||
return (SYSCTL_OUT(req, &s, sizeof(type))); \ | return (SYSCTL_OUT(req, &s, sizeof(type))); \ | ||||
} \ | } \ | ||||
SYSCTL_PROC(parent, nbr, name, CTLFLAG_VNET | CTLTYPE_OPAQUE | CTLFLAG_RW, \ | SYSCTL_PROC(parent, nbr, name, \ | ||||
CTLFLAG_VNET | CTLTYPE_OPAQUE | CTLFLAG_RW | CTLFLAG_NEEDGIANT, \ | |||||
NULL, 0, array ## _sysctl, "I", desc) | NULL, 0, array ## _sysctl, "I", desc) | ||||
#endif /* SYSCTL_OID */ | #endif /* SYSCTL_OID */ | ||||
#ifdef VIMAGE | #ifdef VIMAGE | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/proc.h> /* for struct thread */ | #include <sys/proc.h> /* for struct thread */ | ||||
#include <sys/rwlock.h> | #include <sys/rwlock.h> | ||||
#include <sys/sx.h> | #include <sys/sx.h> | ||||
▲ Show 20 Lines • Show All 303 Lines • Show Last 20 Lines |