diff options
author | phk <phk@FreeBSD.org> | 1999-11-16 16:28:58 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-11-16 16:28:58 +0000 |
commit | ec4e24bd526aa8ffb6e20b093113ee415769c159 (patch) | |
tree | b7a1ee1fe863a0610766302fc19cec04808b654f /sys/kern/kern_lockf.c | |
parent | f70f7d4cf02e8f20b01f3ca353ec7b587ebf64a1 (diff) | |
download | FreeBSD-src-ec4e24bd526aa8ffb6e20b093113ee415769c159.zip FreeBSD-src-ec4e24bd526aa8ffb6e20b093113ee415769c159.tar.gz |
Commit the remaining part of PR14914:
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.
Reviewed by: phk
Submitted by: Jake Burkholder <jake@checker.org>
PR: 14914
Diffstat (limited to 'sys/kern/kern_lockf.c')
-rw-r--r-- | sys/kern/kern_lockf.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c index 27bb5c4..86855ea 100644 --- a/sys/kern/kern_lockf.c +++ b/sys/kern/kern_lockf.c @@ -362,8 +362,8 @@ lf_setlock(lock) overlap->lf_type == F_WRLCK) { lf_wakelock(overlap); } else { - while ((ltmp = overlap->lf_blkhd.tqh_first) != - NOLOCKF) { + while (!TAILQ_EMPTY(&overlap->lf_blkhd)) { + ltmp = TAILQ_FIRST(&overlap->lf_blkhd); TAILQ_REMOVE(&overlap->lf_blkhd, ltmp, lf_block); TAILQ_INSERT_TAIL(&lock->lf_blkhd, @@ -721,7 +721,8 @@ lf_wakelock(listhead) { register struct lockf *wakelock; - while ((wakelock = listhead->lf_blkhd.tqh_first) != NOLOCKF) { + while (!TAILQ_EMPTY(&listhead->lf_blkhd)) { + wakelock = TAILQ_FIRST(&listhead->lf_blkhd); TAILQ_REMOVE(&listhead->lf_blkhd, wakelock, lf_block); wakelock->lf_next = NOLOCKF; #ifdef LOCKF_DEBUG @@ -756,8 +757,8 @@ lf_print(tag, lock) lock->lf_type == F_WRLCK ? "exclusive" : lock->lf_type == F_UNLCK ? "unlock" : "unknown", (long)lock->lf_start, (long)lock->lf_end); - if (lock->lf_blkhd.tqh_first) - printf(" block %p\n", (void *)lock->lf_blkhd.tqh_first); + if (!TAILQ_EMPTY(&lock->lf_blkhd)) + printf(" block %p\n", (void *)TAILQ_FIRST(&lock->lf_blkhd)); else printf("\n"); } @@ -786,8 +787,7 @@ lf_printlist(tag, lock) lf->lf_type == F_WRLCK ? "exclusive" : lf->lf_type == F_UNLCK ? "unlock" : "unknown", (long)lf->lf_start, (long)lf->lf_end); - for (blk = lf->lf_blkhd.tqh_first; blk; - blk = blk->lf_block.tqe_next) { + TAILQ_FOREACH(blk, &lf->lf_blkhd, lf_block) { printf("\n\t\tlock request %p for ", (void *)blk); if (blk->lf_flags & F_POSIX) printf("proc %ld", @@ -801,7 +801,7 @@ lf_printlist(tag, lock) blk->lf_type == F_UNLCK ? "unlock" : "unknown", (long)blk->lf_start, (long)blk->lf_end); - if (blk->lf_blkhd.tqh_first) + if (!TAILQ_EMPTY(&blk->lf_blkhd)) panic("lf_printlist: bad list"); } printf("\n"); |