this switches nfs from using the RB macros to RBT functions.

ok?

Index: nfs_node.c
===================================================================
RCS file: /cvs/src/sys/nfs/nfs_node.c,v
retrieving revision 1.64
diff -u -p -r1.64 nfs_node.c
--- nfs_node.c  19 Mar 2016 12:04:16 -0000      1.64
+++ nfs_node.c  26 Sep 2016 09:54:05 -0000
@@ -72,8 +72,14 @@ nfsnode_cmp(const struct nfsnode *a, con
        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)
Index: nfs_var.h
===================================================================
RCS file: /cvs/src/sys/nfs/nfs_var.h,v
retrieving revision 1.61
diff -u -p -r1.61 nfs_var.h
--- nfs_var.h   29 Apr 2016 14:40:36 -0000      1.61
+++ nfs_var.h   26 Sep 2016 09:54:05 -0000
@@ -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 *);
Index: nfs_vfsops.c
===================================================================
RCS file: /cvs/src/sys/nfs/nfs_vfsops.c,v
retrieving revision 1.110
diff -u -p -r1.110 nfs_vfsops.c
--- nfs_vfsops.c        13 Aug 2016 20:53:17 -0000      1.110
+++ nfs_vfsops.c        26 Sep 2016 09:54:05 -0000
@@ -652,7 +652,7 @@ mountnfs(struct nfs_args *argp, struct m
        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);
 
Index: nfsmount.h
===================================================================
RCS file: /cvs/src/sys/nfs/nfsmount.h,v
retrieving revision 1.25
diff -u -p -r1.25 nfsmount.h
--- nfsmount.h  10 Sep 2012 11:10:59 -0000      1.25
+++ nfsmount.h  26 Sep 2016 09:54:05 -0000
@@ -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. */

Reply via email to