Print this page
Revert exi_zone to exi_zoneid, and install exi_ne backpointer

@@ -163,13 +163,11 @@
         exi->exi_fid = *fid;
         exi->exi_vp = vp;
         VN_HOLD(exi->exi_vp);
         exi->exi_visible = vis_head;
         exi->exi_count = 1;
-        /* Caller will set exi_zone... */
-        /* XXX KEBE SAYS Uncomment me or fix in the caller */
-        /* exi->exi_zoneid = ne->ne_globals->nfs_zoneid; */
+        exi->exi_zoneid = ne->ne_globals->nfs_zoneid;
         exi->exi_volatile_dev = (vfssw[vp->v_vfsp->vfs_fstype].vsw_flag &
             VSW_VOLATILEDEV) ? 1 : 0;
         mutex_init(&exi->exi_lock, NULL, MUTEX_DEFAULT, NULL);
 
         /*

@@ -640,14 +638,15 @@
         struct exp_visible *visp;
         struct exp_visible *vis_head = NULL;
         struct vattr va;
         treenode_t *tree_head = NULL;
         timespec_t now;
-        nfs_export_t *ne = nfs_get_export();
+        nfs_export_t *ne;
 
+        ne = exip->exi_ne;
+        ASSERT3P(ne, ==, nfs_get_export());     /* curzone reality check */
         ASSERT(RW_WRITE_HELD(&ne->exported_lock));
-        ASSERT3P(curzone, ==, exip->exi_zone);
 
         gethrestime(&now);
 
         vp = exip->exi_vp;
         VN_HOLD(vp);

@@ -659,16 +658,17 @@
                 fid.fid_len = MAXFIDSZ;
                 error = vop_fid_pseudo(vp, &fid);
                 if (error)
                         break;
 
+                /* XXX KEBE ASKS DO WE NEED THIS?!? */
                 ASSERT3U(exip->exi_zoneid, ==, curzone->zone_id);
                 /*
                  * The root of the file system, or the zone's root for
                  * in-zone NFS service needs special handling
                  */
-                if (vp->v_flag & VROOT || VN_IS_CURZONEROOT(vp)) {
+                if (vp->v_flag & VROOT || vp == EXI_TO_ZONEROOTVP(exip)) {
                         if (!exportdir) {
                                 struct exportinfo *exi;
 
                                 /*
                                  * Check if this VROOT dir is already exported.

@@ -696,12 +696,10 @@
                                  * this as a pseudo export so that an NFS v4
                                  * client can do lookups in it.
                                  */
                                 new_exi = pseudo_exportfs(ne, vp, &fid,
                                     vis_head, NULL);
-                                /* XXX KEBE SAYS NUKE ME */
-                                new_exi->exi_zone = exip->exi_zone;
                                 vis_head = NULL;
                         }
 
                         if (VN_IS_CURZONEROOT(vp)) {
                                 /* at system root */

@@ -840,11 +838,12 @@
 {
         treenode_t *tnode, *old_nd;
         treenode_t *connect_point = NULL;
 
         ASSERT(RW_WRITE_HELD(&ne->exported_lock));
-        ASSERT(curzone == exip->exi_zone || curzone == global_zone);
+        ASSERT(curzone->zone_id == exip->exi_zoneid ||
+            curzone->zone_id == global_zone->zone_id);
 
         /*
          * exi_tree can be null for the zone root
          * which means we're already at the "top"
          * and there's nothing more to "climb".

@@ -1003,11 +1002,11 @@
         /*
          * An exported root vnode has a sub-dir shared if it has a visible
          * list.  i.e. if it does not have a visible list, then there is no
          * node in this filesystem leads to any other shared node.
          */
-        ASSERT3P(curzone, ==, exi->exi_zone);
+        ASSERT3P(curzone->zone_id, ==, exi->exi_zoneid);
         if (vp_is_exported &&
             ((vp->v_flag & VROOT) || VN_IS_CURZONEROOT(vp))) {
                 return (exi->exi_visible ? 1 : 0);
         }