diff options
author | phk <phk@FreeBSD.org> | 1999-11-16 10:56:05 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-11-16 10:56:05 +0000 |
commit | 8fca18de89986d6275d0502af100b97274c4bab5 (patch) | |
tree | d8a3cb26e484830479c8386ecba6b7d0157acc06 /sys/kern/kern_resource.c | |
parent | 520fff788fc8f2154247a6cff986abf634fdbb51 (diff) | |
download | FreeBSD-src-8fca18de89986d6275d0502af100b97274c4bab5.zip FreeBSD-src-8fca18de89986d6275d0502af100b97274c4bab5.tar.gz |
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 <jake@checker.org>
PR: 14914
Diffstat (limited to 'sys/kern/kern_resource.c')
-rw-r--r-- | sys/kern/kern_resource.c | 10 |
1 files changed, 4 insertions, 6 deletions
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++; |