summaryrefslogtreecommitdiffstats
path: root/sys/nfs
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2016-09-27 01:37:38 +0000
committerdlg <dlg@openbsd.org>2016-09-27 01:37:38 +0000
commitb78d9702d9d5bf5d9ee6b9126881a47c0fef6601 (patch)
treecce3c88a176d4f939f5967a6fb101a7d2dca50b8 /sys/nfs
parentThe gcc and libiberty regression tests seem to be broken since the (diff)
downloadwireguard-openbsd-b78d9702d9d5bf5d9ee6b9126881a47c0fef6601.tar.xz
wireguard-openbsd-b78d9702d9d5bf5d9ee6b9126881a47c0fef6601.zip
replace the use of RB macros with the RBT functions.
Diffstat (limited to 'sys/nfs')
-rw-r--r--sys/nfs/nfs_node.c20
-rw-r--r--sys/nfs/nfs_var.h3
-rw-r--r--sys/nfs/nfs_vfsops.c4
-rw-r--r--sys/nfs/nfsmount.h4
4 files changed, 19 insertions, 12 deletions
diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c
index 279cd736106..948ec70967a 100644
--- a/sys/nfs/nfs_node.c
+++ b/sys/nfs/nfs_node.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_node.c,v 1.64 2016/03/19 12:04:16 natano Exp $ */
+/* $OpenBSD: nfs_node.c,v 1.65 2016/09/27 01:37:38 dlg Exp $ */
/* $NetBSD: nfs_node.c,v 1.16 1996/02/18 11:53:42 fvdl Exp $ */
/*
@@ -72,8 +72,14 @@ nfsnode_cmp(const struct nfsnode *a, const struct nfsnode *b)
return (memcmp(a->n_fhp, b->n_fhp, a->n_fhsize));
}
-RB_PROTOTYPE(nfs_nodetree, nfsnode, n_entry, nfsnode_cmp);
-RB_GENERATE(nfs_nodetree, nfsnode, n_entry, nfsnode_cmp);
+RBT_PROTOTYPE(nfs_nodetree, nfsnode, n_entry, nfsnode_cmp);
+RBT_GENERATE(nfs_nodetree, nfsnode, n_entry, nfsnode_cmp);
+
+void
+nfs_ninit(struct nfsmount *nmp)
+{
+ RBT_INIT(nfs_nodetree, &nmp->nm_ntree);
+}
/*
* Look up a vnode/nfsnode by file handle and store the pointer in *npp.
@@ -95,7 +101,7 @@ loop:
rw_enter_write(&nfs_hashlock);
find.n_fhp = fh;
find.n_fhsize = fhsize;
- np = RB_FIND(nfs_nodetree, &nmp->nm_ntree, &find);
+ np = RBT_FIND(nfs_nodetree, &nmp->nm_ntree, &find);
if (np != NULL) {
rw_exit_write(&nfs_hashlock);
vp = NFSTOV(np);
@@ -124,7 +130,7 @@ loop:
return (error);
}
nvp->v_flag |= VLARVAL;
- np = RB_FIND(nfs_nodetree, &nmp->nm_ntree, &find);
+ np = RBT_FIND(nfs_nodetree, &nmp->nm_ntree, &find);
if (np != NULL) {
vgone(nvp);
rw_exit_write(&nfs_hashlock);
@@ -153,7 +159,7 @@ loop:
np->n_fhp = &np->n_fh;
bcopy(fh, np->n_fhp, fhsize);
np->n_fhsize = fhsize;
- np2 = RB_INSERT(nfs_nodetree, &nmp->nm_ntree, np);
+ np2 = RBT_INSERT(nfs_nodetree, &nmp->nm_ntree, np);
KASSERT(np2 == NULL);
np->n_accstamp = -1;
rw_exit(&nfs_hashlock);
@@ -234,7 +240,7 @@ nfs_reclaim(void *v)
#endif
nmp = VFSTONFS(vp->v_mount);
rw_enter_write(&nfs_hashlock);
- RB_REMOVE(nfs_nodetree, &nmp->nm_ntree, np);
+ RBT_REMOVE(nfs_nodetree, &nmp->nm_ntree, np);
rw_exit_write(&nfs_hashlock);
if (np->n_rcred)
diff --git a/sys/nfs/nfs_var.h b/sys/nfs/nfs_var.h
index e11818aa19a..f9588676208 100644
--- a/sys/nfs/nfs_var.h
+++ b/sys/nfs/nfs_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_var.h,v 1.61 2016/04/29 14:40:36 beck Exp $ */
+/* $OpenBSD: nfs_var.h,v 1.62 2016/09/27 01:37:38 dlg Exp $ */
/* $NetBSD: nfs_var.h,v 1.3 1996/02/18 11:53:54 fvdl Exp $ */
/*
@@ -56,6 +56,7 @@ int nfs_doio(struct buf *, struct proc *);
int nfs_boot_init(struct nfs_diskless *, struct proc *);
/* nfs_node.c */
+void nfs_ninit(struct nfsmount *);
int nfs_nget(struct mount *, nfsfh_t *, int, struct nfsnode **);
int nfs_inactive(void *);
int nfs_reclaim(void *);
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c
index ce4c66a873e..f644a0d7774 100644
--- a/sys/nfs/nfs_vfsops.c
+++ b/sys/nfs/nfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vfsops.c,v 1.110 2016/08/13 20:53:17 guenther Exp $ */
+/* $OpenBSD: nfs_vfsops.c,v 1.111 2016/09/27 01:37:38 dlg Exp $ */
/* $NetBSD: nfs_vfsops.c,v 1.46.4.1 1996/05/25 22:40:35 fvdl Exp $ */
/*
@@ -652,7 +652,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct mbuf *nam,
nmp->nm_nam = nam;
nfs_decode_args(nmp, argp, &mp->mnt_stat.mount_info.nfs_args);
- RB_INIT(&nmp->nm_ntree);
+ nfs_ninit(nmp);
TAILQ_INIT(&nmp->nm_reqsq);
timeout_set(&nmp->nm_rtimeout, nfs_timer, nmp);
diff --git a/sys/nfs/nfsmount.h b/sys/nfs/nfsmount.h
index aea7cd7ed40..b70bda58900 100644
--- a/sys/nfs/nfsmount.h
+++ b/sys/nfs/nfsmount.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfsmount.h,v 1.25 2012/09/10 11:10:59 jsing Exp $ */
+/* $OpenBSD: nfsmount.h,v 1.26 2016/09/27 01:37:38 dlg Exp $ */
/* $NetBSD: nfsmount.h,v 1.10 1996/02/18 11:54:03 fvdl Exp $ */
/*
@@ -45,7 +45,7 @@
* Holds NFS specific information for mount.
*/
struct nfsmount {
- RB_HEAD(nfs_nodetree, nfsnode)
+ RBT_HEAD(nfs_nodetree, nfsnode)
nm_ntree; /* filehandle/node tree */
TAILQ_HEAD(reqs, nfsreq)
nm_reqsq; /* request queue for this mount. */