aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_meter.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2016-12-26 19:29:04 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2016-12-26 19:29:04 +0000
commit8b590e95069ab9c3de3c9da4cae3ff62583c8ac0 (patch)
treed1f66eac8f423e2da84e0a2930b461f7ec0d2f18 /sys/vm/vm_meter.c
parent5c36b2e8cb3baa1375b2ba0ef7c68a0dd820c0f7 (diff)
downloadsrc-8b590e95069ab9c3de3c9da4cae3ff62583c8ac0.tar.gz
src-8b590e95069ab9c3de3c9da4cae3ff62583c8ac0.zip
Remove redundancy in vmtotal().
There are two instances of inlined unlocks + continue in vmtotal() switch statements, which are ordinary expressed with break from the switch case and code after the switch. Also, the combination of continue and break statement is redundand. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week
Notes
Notes: svn path=/head/; revision=310616
Diffstat (limited to 'sys/vm/vm_meter.c')
-rw-r--r--sys/vm/vm_meter.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c
index 941059ab6ce9..379dd8fde45c 100644
--- a/sys/vm/vm_meter.c
+++ b/sys/vm/vm_meter.c
@@ -121,15 +121,10 @@ vmtotal(SYSCTL_HANDLER_ARGS)
*/
sx_slock(&allproc_lock);
FOREACH_PROC_IN_SYSTEM(p) {
- if (p->p_flag & P_SYSTEM)
+ if ((p->p_flag & P_SYSTEM) != 0)
continue;
PROC_LOCK(p);
- switch (p->p_state) {
- case PRS_NEW:
- PROC_UNLOCK(p);
- continue;
- break;
- default:
+ if (p->p_state != PRS_NEW) {
FOREACH_THREAD_IN_PROC(p, td) {
thread_lock(td);
switch (td->td_state) {
@@ -146,15 +141,13 @@ vmtotal(SYSCTL_HANDLER_ARGS)
total.t_pw++;
}
break;
-
case TDS_CAN_RUN:
total.t_sw++;
break;
case TDS_RUNQ:
case TDS_RUNNING:
total.t_rq++;
- thread_unlock(td);
- continue;
+ break;
default:
break;
}