Print this page
Be far more judicious in the use of curzone-using macros.

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/zone.h
          +++ new/usr/src/uts/common/sys/zone.h
↓ open down ↓ 926 lines elided ↑ open up ↑
 927  927          (ASSERT(ZONE_PATH_VISIBLE(path, zone)), \
 928  928          (path) + (zone)->zone_rootpathlen - 2)
 929  929  
 930  930  /*
 931  931   * Special processes visible in all zones.
 932  932   */
 933  933  #define ZONE_SPECIALPID(x)       ((x) == 0 || (x) == 1)
 934  934  
 935  935  /*
 936  936   * The root vnode of the current zone.
      937 + *
      938 + * NOTE: It may be necessary (initialization time for file sharing where an
      939 + * NGZ loads a file-sharing kernel module that does zsd initialization) to NOT
      940 + * use this macro. One should ASSERT() that curzone == active ZSD (an
      941 + * ASSERTion that's not always true at ZSD initialization time) during regular
      942 + * use of this macro.
 937  943   */
 938  944  #define ZONE_ROOTVP()   (curzone->zone_rootvp)
 939  945  
 940  946  /*
 941  947   * Since a zone's root isn't necessarily an actual filesystem boundary
 942  948   * (i.e. VROOT may not be set on zone->zone_rootvp) we need to not assume it.
 943  949   * This macro helps in checking if a vnode is the current zone's rootvp.
 944  950   * NOTE:  Using the VN_ prefix, even though it's defined here in zone.h.
      951 + * NOTE2: See above warning about ZONE_ROOTVP().
 945  952   */
 946  953  #define VN_IS_CURZONEROOT(vp)   (VN_CMP(vp, ZONE_ROOTVP()))
 947  954  
 948  955  /*
 949  956   * Zone-safe version of thread_create() to be used when the caller wants to
 950  957   * create a kernel thread to run within the current zone's context.
 951  958   */
 952  959  extern kthread_t *zthread_create(caddr_t, size_t, void (*)(), void *, size_t,
 953  960      pri_t);
 954  961  extern void zthread_exit(void);
↓ open down ↓ 96 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX