PERFORCE change 74465 for review
John Baldwin
jhb at FreeBSD.org
Mon Apr 4 12:07:57 PDT 2005
http://perforce.freebsd.org/chv.cgi?CH=74465
Change 74465 by jhb at jhb_slimer on 2005/04/04 19:07:39
Tidy.
Affected files ...
.. //depot/projects/smpng/sys/vm/vm_meter.c#24 edit
Differences ...
==== //depot/projects/smpng/sys/vm/vm_meter.c#24 (text+ko) ====
@@ -255,22 +255,19 @@
static int
vcnt(SYSCTL_HANDLER_ARGS)
{
- int error = 0;
int count = *(int *)arg1;
+ int offset = (char *)arg1 - (char *)&cnt;
#ifdef SMP
int i;
- int offset = (char *)arg1 - (char *)&cnt;
for (i = 0; i < mp_ncpus; ++i) {
struct pcpu *pcpu = pcpu_find(i);
count += *(int *)((char *)&pcpu->pc_cnt + offset);
}
#else
- int offset = (char *)arg1 - (char *)&cnt;
count += *(int *)((char *)PCPU_PTR(cnt) + offset);
#endif
- error = SYSCTL_OUT(req, &count, sizeof(int));
- return(error);
+ return (SYSCTL_OUT(req, &count, sizeof(int)));
}
SYSCTL_PROC(_vm, VM_TOTAL, vmtotal, CTLTYPE_OPAQUE|CTLFLAG_RD,
More information about the p4-projects
mailing list