From 8fca18de89986d6275d0502af100b97274c4bab5 Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 16 Nov 1999 10:56:05 +0000 Subject: This is a partial commit of the patch from PR 14914: Alot of the code in sys/kern directly accesses the *Q_HEAD and *Q_ENTRY structures for list operations. This patch makes all list operations in sys/kern use the queue(3) macros, rather than directly accessing the *Q_{HEAD,ENTRY} structures. This batch of changes compile to the same object files. Reviewed by: phk Submitted by: Jake Burkholder PR: 14914 --- sys/kern/kern_resource.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'sys/kern/kern_resource.c') diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 2fd11ab..fde934e 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -97,8 +97,7 @@ getpriority(curp, uap) pg = curp->p_pgrp; else if ((pg = pgfind(uap->who)) == NULL) break; - for (p = pg->pg_members.lh_first; p != 0; - p = p->p_pglist.le_next) { + LIST_FOREACH(p, &pg->pg_members, p_pglist) { if (p->p_nice < low) low = p->p_nice; } @@ -108,7 +107,7 @@ getpriority(curp, uap) case PRIO_USER: if (uap->who == 0) uap->who = curp->p_ucred->cr_uid; - for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) + LIST_FOREACH(p, &allproc, p_list) if (p->p_ucred->cr_uid == uap->who && p->p_nice < low) low = p->p_nice; @@ -159,8 +158,7 @@ setpriority(curp, uap) pg = curp->p_pgrp; else if ((pg = pgfind(uap->who)) == NULL) break; - for (p = pg->pg_members.lh_first; p != 0; - p = p->p_pglist.le_next) { + LIST_FOREACH(p, &pg->pg_members, p_pglist) { error = donice(curp, p, uap->prio); found++; } @@ -170,7 +168,7 @@ setpriority(curp, uap) case PRIO_USER: if (uap->who == 0) uap->who = curp->p_ucred->cr_uid; - for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) + LIST_FOREACH(p, &allproc, p_list) if (p->p_ucred->cr_uid == uap->who) { error = donice(curp, p, uap->prio); found++; -- cgit v1.1