Print this page
Try to remove assumption that zone's root vnode is marked VROOT

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/zone.h
          +++ new/usr/src/uts/common/sys/zone.h
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   * Copyright 2014 Igor Kozhukhov <ikozhukhov@gmail.com>.
  25      - * Copyright 2018 Joyent, Inc.
       25 + * Copyright 2019 Joyent, Inc.
  26   26   * Copyright 2019 Nexenta Systems, Inc. All rights reserved.
  27   27   */
  28   28  
  29   29  #ifndef _SYS_ZONE_H
  30   30  #define _SYS_ZONE_H
  31   31  
  32   32  #include <sys/types.h>
  33   33  #include <sys/param.h>
  34   34  #include <sys/tsol/label.h>
  35   35  #include <sys/uadmin.h>
↓ open down ↓ 740 lines elided ↑ open up ↑
 776  776          (path) + (zone)->zone_rootpathlen - 2)
 777  777  
 778  778  /*
 779  779   * Special processes visible in all zones.
 780  780   */
 781  781  #define ZONE_SPECIALPID(x)       ((x) == 0 || (x) == 1)
 782  782  
 783  783  /*
 784  784   * A root vnode of the current zone.
 785  785   */
 786      -#define ZONE_ROOTVP()   (curproc->p_zone->zone_rootvp)
      786 +#define ZONE_ROOTVP()   (curzone->zone_rootvp)
 787  787  
 788  788  /*
      789 + * Since a zone's root isn't necessarily an actual filesystem boundary
      790 + * (i.e. VROOT may not be set on zone->zone_rootvp) we need to not assume it.
      791 + * This macro helps in checking if a vnode is the current zone's rootvp.
      792 + * NOTE:  Using the VN_ prefix, even though it's defined here in zone.h.
      793 + */
      794 +#define        VN_IS_CURZONEROOT(vp)   (VN_CMP(vp, ZONE_ROOTVP()))
      795 +
      796 +/*
 789  797   * Zone-safe version of thread_create() to be used when the caller wants to
 790  798   * create a kernel thread to run within the current zone's context.
 791  799   */
 792  800  extern kthread_t *zthread_create(caddr_t, size_t, void (*)(), void *, size_t,
 793  801      pri_t);
 794  802  extern void zthread_exit(void);
 795  803  
 796  804  /*
 797  805   * Functions for an external observer to register interest in a zone's status
 798  806   * change.  Observers will be woken up when the zone status equals the status
↓ open down ↓ 76 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX