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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/nfs/export.h
          +++ new/usr/src/uts/common/nfs/export.h
↓ open down ↓ 465 lines elided ↑ open up ↑
 466  466          /* support for generic n-ary trees */
 467  467          struct treenode *tree_parent;
 468  468          struct treenode *tree_child_first;
 469  469          struct treenode *tree_sibling; /* next sibling */
 470  470          /* private, nfs specific part */
 471  471          struct exportinfo  *tree_exi;
 472  472          struct exp_visible *tree_vis;
 473  473  } treenode_t;
 474  474  
 475  475  /*
      476 + * Now that we have links to chase, we can get the zone rootvp just from
      477 + * an export.  No current-zone-context needed.
      478 + */
      479 +#define EXI_TO_ZONEROOTVP(exi) ((exi)->exi_ne->exi_root->exi_vp)
      480 +
      481 +/*
 476  482   * TREE_ROOT checks if the node corresponds to a filesystem root or
 477  483   * the zone's root directory.
 478  484   * TREE_EXPORTED checks if the node is explicitly shared
 479  485   */
 480  486  
 481  487  #define TREE_ROOT(t) \
 482  488          ((t)->tree_exi != NULL && \
 483  489          (((t)->tree_exi->exi_vp->v_flag & VROOT) || \
 484      -        VN_CMP((t)->tree_exi->exi_zone->zone_rootvp, (t)->tree_exi->exi_vp)))
      490 +        VN_CMP(EXI_TO_ZONEROOTVP((t)->tree_exi), (t)->tree_exi->exi_vp)))
 485  491  
 486  492  #define TREE_EXPORTED(t) \
 487  493          ((t)->tree_exi && !PSEUDO((t)->tree_exi))
 488  494  
 489  495  #define EXPTABLESIZE   256
 490  496  
 491  497  struct exp_hash {
 492  498          struct exportinfo       *prev;  /* ptr to the previous exportinfo */
 493  499          struct exportinfo       *next;  /* ptr to the next exportinfo */
 494  500          struct exportinfo       **bckt; /* backpointer to the hash bucket */
↓ open down ↓ 21 lines elided ↑ open up ↑
 516  522          struct exportdata       exi_export;
 517  523          fsid_t                  exi_fsid;
 518  524          struct fid              exi_fid;
 519  525          struct exp_hash         fid_hash;
 520  526          struct exp_hash         path_hash;
 521  527          struct treenode         *exi_tree;
 522  528          fhandle_t               exi_fh;
 523  529          krwlock_t               exi_cache_lock;
 524  530          kmutex_t                exi_lock;
 525  531          uint_t                  exi_count;
      532 +        zoneid_t                exi_zoneid;
 526  533          vnode_t                 *exi_vp;
 527  534          vnode_t                 *exi_dvp;
 528  535          avl_tree_t              *exi_cache[AUTH_TABLESIZE];
 529  536          struct log_buffer       *exi_logbuffer;
 530  537          struct exp_visible      *exi_visible;
 531  538          struct charset_cache    *exi_charset;
 532  539          unsigned                exi_volatile_dev:1;
 533  540          unsigned                exi_moved:1;
 534  541          int                     exi_id;
 535  542          avl_node_t              exi_id_link;
 536  543          /*
 537      -         * Soft-reference/backpointer to the zone.  The ZSD callbacks we have
 538      -         * invoke cleanup code that crosses into OTHER cleanup functions that
 539      -         * may assume same-zone context and attempt to find their own ZSD,
 540      -         * using "curzone" when in fact "curzone" is global when called from
 541      -         * NFS's ZSD cleanup (see lm_unexport->nlm_unexport for an example).
 542      -         *
 543      -         * During ZSD shutdown or destroy callbacks, the zone structure
 544      -         * does not have its mutex held, and it has just-enough references
 545      -         * to not free from underneath us.  This field is not a proper
 546      -         * referenced-held zone pointer, and only ZSD callbacks should use
 547      -         * it.
      544 +         * Soft-reference/backpointer to zone's nfs_export_t.
      545 +         * This allows us access to the zone's rootvp (stored in
      546 +         * exi_ne->exi_root->exi_vp) even if the current thread isn't in
      547 +         * same-zone context.
 548  548           */
 549      -        struct zone             *exi_zone;
      549 +        struct nfs_export       *exi_ne;
 550  550  #ifdef VOLATILE_FH_TEST
 551  551          uint32_t                exi_volatile_id;
 552  552          struct ex_vol_rename    *exi_vol_rename;
 553  553          kmutex_t                exi_vol_rename_lock;
 554  554  #endif /* VOLATILE_FH_TEST -- keep last! */
 555  555  };
 556      -#define exi_zoneid exi_zone->zone_id
 557  556  
 558  557  typedef struct exportinfo exportinfo_t;
 559  558  typedef struct exportdata exportdata_t;
 560  559  typedef struct secinfo secinfo_t;
 561  560  
 562  561  /*
 563  562   * exp_visible is a visible list per filesystem. It is for filesystems
 564  563   * that may need a limited view of its contents. A pseudo export and
 565  564   * a real export at the mount point (VROOT) which has a subtree shared
 566  565   * has a visible list.
↓ open down ↓ 101 lines elided ↑ open up ↑
 668  667          struct exportinfo *exptable_path_hash[PKP_HASH_SIZE];
 669  668          struct exportinfo *exptable[EXPTABLESIZE];
 670  669  
 671  670          /*
 672  671           * Read/Write lock that protects the exportinfo list.  This lock
 673  672           * must be held when searching or modifiying the exportinfo list.
 674  673           */
 675  674          krwlock_t exported_lock;
 676  675  
 677  676          /* "public" and default (root) location for public filehandle */
 678      -        struct exportinfo *exi_public, *exi_root;
      677 +        struct exportinfo *exi_public;
      678 +        struct exportinfo *exi_root;
 679  679          /* For checking default public file handle */
 680  680          fid_t exi_rootfid;
 681  681          /* For comparing V2 filehandles */
 682  682          fhandle_t nullfh2;
 683  683  
 684  684          /* The change attribute value of the root of nfs pseudo namespace */
 685  685          timespec_t ns_root_change;
 686  686  } nfs_export_t;
 687  687  
 688  688  /*
↓ open down ↓ 60 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX