summaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-12-26 21:22:15 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-12-26 21:22:15 +0000
commitc5af0812e5d7d60d182addc4594c42baf2e8b591 (patch)
treef3b7e8064fa2dac88f6df9c7c5bda683a4ee96fe /sys/ufs
parentfa70810cdbb843b66175fff83a47dc871a8c2780 (diff)
Use list and queue macros where applicable to make the code easier to read;
no change in compiler assembly output.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ext2fs/ext2fs_vfsops.c4
-rw-r--r--sys/ufs/ufs/ufs_ihash.c10
-rw-r--r--sys/ufs/ufs/ufs_quota.c8
3 files changed, 10 insertions, 12 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c
index fbb13d1458f..be2943cbf10 100644
--- a/sys/ufs/ext2fs/ext2fs_vfsops.c
+++ b/sys/ufs/ext2fs/ext2fs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_vfsops.c,v 1.34 2004/06/21 23:50:38 tholo Exp $ */
+/* $OpenBSD: ext2fs_vfsops.c,v 1.35 2004/12/26 21:22:14 miod Exp $ */
/* $NetBSD: ext2fs_vfsops.c,v 1.1 1997/06/11 09:34:07 bouyer Exp $ */
/*
@@ -747,7 +747,7 @@ ext2fs_sync_vnode(struct vnode *vp, void *args)
ip = VTOI(vp);
if (vp->v_type == VNON ||
((ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0 &&
- vp->v_dirtyblkhd.lh_first == NULL) ||
+ LIST_EMPTY(&vp->v_dirtyblkhd)) ||
esa->waitfor == MNT_LAZY) {
simple_unlock(&vp->v_interlock);
return (0);
diff --git a/sys/ufs/ufs/ufs_ihash.c b/sys/ufs/ufs/ufs_ihash.c
index 03473a9db32..d2af1808f18 100644
--- a/sys/ufs/ufs/ufs_ihash.c
+++ b/sys/ufs/ufs/ufs_ihash.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ufs_ihash.c,v 1.9 2003/06/02 23:28:23 millert Exp $ */
+/* $OpenBSD: ufs_ihash.c,v 1.10 2004/12/26 21:22:14 miod Exp $ */
/* $NetBSD: ufs_ihash.c,v 1.3 1996/02/09 22:36:04 christos Exp $ */
/*
@@ -73,7 +73,7 @@ ufs_ihashlookup(dev, inum)
struct inode *ip;
simple_lock(&ufs_ihash_slock);
- for (ip = INOHASH(dev, inum)->lh_first; ip; ip = ip->i_hash.le_next)
+ LIST_FOREACH(ip, INOHASH(dev, inum), i_hash)
if (inum == ip->i_number && dev == ip->i_dev)
break;
simple_unlock(&ufs_ihash_slock);
@@ -97,7 +97,7 @@ ufs_ihashget(dev, inum)
struct vnode *vp;
loop:
simple_lock(&ufs_ihash_slock);
- for (ip = INOHASH(dev, inum)->lh_first; ip; ip = ip->i_hash.le_next) {
+ LIST_FOREACH(ip, INOHASH(dev, inum), i_hash) {
if (inum == ip->i_number && dev == ip->i_dev) {
vp = ITOV(ip);
simple_lock(&vp->v_interlock);
@@ -106,7 +106,6 @@ loop:
goto loop;
return (vp);
}
-
}
simple_unlock(&ufs_ihash_slock);
return (NULL);
@@ -130,8 +129,7 @@ ufs_ihashins(ip)
simple_lock(&ufs_ihash_slock);
- for (curip = INOHASH(dev, inum)->lh_first; curip;
- curip = curip->i_hash.le_next) {
+ LIST_FOREACH(curip, INOHASH(dev, inum), i_hash) {
if (inum == curip->i_number && dev == curip->i_dev) {
simple_unlock(&ufs_ihash_slock);
lockmgr(&ip->i_lock, LK_RELEASE, (struct simplelock *)0, p);
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c
index 1659cfd306e..cc5b8324324 100644
--- a/sys/ufs/ufs/ufs_quota.c
+++ b/sys/ufs/ufs/ufs_quota.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ufs_quota.c,v 1.17 2004/06/21 23:50:38 tholo Exp $ */
+/* $OpenBSD: ufs_quota.c,v 1.18 2004/12/26 21:22:14 miod Exp $ */
/* $NetBSD: ufs_quota.c,v 1.8 1996/02/09 22:36:09 christos Exp $ */
/*
@@ -852,7 +852,7 @@ dqget(vp, id, ump, type, dqp)
* Check the cache first.
*/
dqh = DQHASH(dqvp, id);
- for (dq = dqh->lh_first; dq; dq = dq->dq_hash.le_next) {
+ LIST_FOREACH(dq, dqh, dq_hash) {
if (dq->dq_id != id ||
dq->dq_vp != dqvp)
continue;
@@ -869,7 +869,7 @@ dqget(vp, id, ump, type, dqp)
/*
* Not in cache, allocate a new one.
*/
- if (dqfreelist.tqh_first == NODQUOT &&
+ if (TAILQ_FIRST(&dqfreelist) == NODQUOT &&
numdquot < MAXQUOTAS * desiredvnodes)
desireddquot += DQUOTINC;
if (numdquot < desireddquot) {
@@ -877,7 +877,7 @@ dqget(vp, id, ump, type, dqp)
bzero((char *)dq, sizeof *dq);
numdquot++;
} else {
- if ((dq = dqfreelist.tqh_first) == NULL) {
+ if ((dq = TAILQ_FIRST(&dqfreelist)) == NULL) {
tablefull("dquot");
*dqp = NODQUOT;
return (EUSERS);