summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_ktrace.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-11-16 10:56:05 +0000
committerphk <phk@FreeBSD.org>1999-11-16 10:56:05 +0000
commit8fca18de89986d6275d0502af100b97274c4bab5 (patch)
treed8a3cb26e484830479c8386ecba6b7d0157acc06 /sys/kern/kern_ktrace.c
parent520fff788fc8f2154247a6cff986abf634fdbb51 (diff)
downloadFreeBSD-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_ktrace.c')
-rw-r--r--sys/kern/kern_ktrace.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c
index a72e6d8..266ea31 100644
--- a/sys/kern/kern_ktrace.c
+++ b/sys/kern/kern_ktrace.c
@@ -292,7 +292,7 @@ ktrace(curp, uap)
* Clear all uses of the tracefile
*/
if (ops == KTROP_CLEARFILE) {
- for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) {
+ LIST_FOREACH(p, &allproc, p_list) {
if (p->p_tracep == vp) {
if (ktrcanset(curp, p)) {
p->p_tracep = NULL;
@@ -324,7 +324,7 @@ ktrace(curp, uap)
error = ESRCH;
goto done;
}
- for (p = pg->pg_members.lh_first; p != 0; p = p->p_pglist.le_next)
+ LIST_FOREACH(p, &pg->pg_members, p_pglist)
if (descend)
ret |= ktrsetchildren(curp, p, ops, facs, vp);
else
@@ -445,13 +445,13 @@ ktrsetchildren(curp, top, ops, facs, vp)
* otherwise do any siblings, and if done with this level,
* follow back up the tree (but not past top).
*/
- if (p->p_children.lh_first)
- p = p->p_children.lh_first;
+ if (!LIST_EMPTY(&p->p_children))
+ p = LIST_FIRST(&p->p_children);
else for (;;) {
if (p == top)
return (ret);
- if (p->p_sibling.le_next) {
- p = p->p_sibling.le_next;
+ if (LIST_NEXT(p, p_sibling)) {
+ p = LIST_NEXT(p, p_sibling);
break;
}
p = p->p_pptr;
@@ -497,7 +497,7 @@ ktrwrite(vp, kth)
*/
log(LOG_NOTICE, "ktrace write failed, errno %d, tracing stopped\n",
error);
- for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) {
+ LIST_FOREACH(p, &allproc, p_list) {
if (p->p_tracep == vp) {
p->p_tracep = NULL;
p->p_traceflag = 0;
OpenPOWER on IntegriCloud