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
This commit is contained in:
parent
483cf17093
commit
02ea7af4a5
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user