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_ktrace.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sys/kern/kern_ktrace.c') 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; -- cgit v1.1