Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/zone.h
          +++ new/usr/src/uts/common/sys/zone.h
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  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   * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
       23 + * Copyright 2015 Joyent, Inc. All rights reserved.
  23   24   * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
  24   25   * Copyright 2014 Igor Kozhukhov <ikozhukhov@gmail.com>.
  25   26   * Copyright 2016, Joyent, Inc.
  26   27   */
  27   28  
  28   29  #ifndef _SYS_ZONE_H
  29   30  #define _SYS_ZONE_H
  30   31  
  31   32  #include <sys/types.h>
  32   33  #include <sys/mutex.h>
↓ open down ↓ 150 lines elided ↑ open up ↑
 183  184          size32_t zone_privssz;
 184  185          caddr32_t rctlbuf;
 185  186          size32_t rctlbufsz;
 186  187          caddr32_t extended_error;
 187  188          caddr32_t zfsbuf;
 188  189          size32_t  zfsbufsz;
 189  190          int match;                      /* match level */
 190  191          uint32_t doi;                   /* DOI for label */
 191  192          caddr32_t label;                /* label associated with zone */
 192  193          int flags;
 193      -        zoneid_t zoneid;                /* requested zoneid */
 194  194  } zone_def32;
 195  195  #endif
 196  196  typedef struct {
 197  197          const char *zone_name;
 198  198          const char *zone_root;
 199  199          const struct priv_set *zone_privs;
 200  200          size_t zone_privssz;
 201  201          const char *rctlbuf;
 202  202          size_t rctlbufsz;
 203  203          int *extended_error;
 204  204          const char *zfsbuf;
 205  205          size_t zfsbufsz;
 206  206          int match;                      /* match level */
 207  207          uint32_t doi;                   /* DOI for label */
 208  208          const bslabel_t *label;         /* label associated with zone */
 209  209          int flags;
 210      -        zoneid_t zoneid;                /* requested zoneid */
 211  210  } zone_def;
 212  211  
 213  212  /* extended error information */
 214  213  #define ZE_UNKNOWN      0       /* No extended error info */
 215  214  #define ZE_CHROOTED     1       /* tried to zone_create from chroot */
 216  215  #define ZE_AREMOUNTS    2       /* there are mounts within the zone */
 217  216  #define ZE_LABELINUSE   3       /* label is already in use by some other zone */
 218  217  
 219  218  /*
 220  219   * zone_status values
↓ open down ↓ 155 lines elided ↑ open up ↑
 376  375  
 377  376  /*
 378  377   * Structure to record list of ZFS datasets exported to a zone.
 379  378   */
 380  379  typedef struct zone_dataset {
 381  380          char            *zd_dataset;
 382  381          list_node_t     zd_linkage;
 383  382  } zone_dataset_t;
 384  383  
 385  384  /*
 386      - * structure for rctl zone kstats
      385 + * structure for zone kstats
 387  386   */
 388  387  typedef struct zone_kstat {
 389  388          kstat_named_t zk_zonename;
 390  389          kstat_named_t zk_usage;
 391  390          kstat_named_t zk_value;
 392  391  } zone_kstat_t;
 393  392  
 394  393  struct cpucap;
 395  394  
 396  395  typedef struct {
↓ open down ↓ 55 lines elided ↑ open up ↑
 452  451          kstat_named_t   zm_utime;
 453  452          kstat_named_t   zm_stime;
 454  453          kstat_named_t   zm_wtime;
 455  454          kstat_named_t   zm_avenrun1;
 456  455          kstat_named_t   zm_avenrun5;
 457  456          kstat_named_t   zm_avenrun15;
 458  457          kstat_named_t   zm_ffcap;
 459  458          kstat_named_t   zm_ffnoproc;
 460  459          kstat_named_t   zm_ffnomem;
 461  460          kstat_named_t   zm_ffmisc;
 462      -        kstat_named_t   zm_mfseglim;
 463  461          kstat_named_t   zm_nested_intp;
 464  462          kstat_named_t   zm_init_pid;
 465  463          kstat_named_t   zm_boot_time;
 466  464  } zone_misc_kstat_t;
 467  465  
 468  466  typedef struct zone {
 469  467          /*
 470  468           * zone_name is never modified once set.
 471  469           */
 472  470          char            *zone_name;     /* zone's configuration name */
↓ open down ↓ 24 lines elided ↑ open up ↑
 497  495           *      zone_zsd
 498  496           *      zone_pfexecd
 499  497           */
 500  498          kmutex_t        zone_lock;
 501  499          /*
 502  500           * zone_linkage is the zone's linkage into the active or
 503  501           * death-row list.  The field is protected by zonehash_lock.
 504  502           */
 505  503          list_node_t     zone_linkage;
 506  504          zoneid_t        zone_id;        /* ID of zone */
 507      -        zoneid_t        zone_did;       /* persistent debug ID of zone */
 508  505          uint_t          zone_ref;       /* count of zone_hold()s on zone */
 509  506          uint_t          zone_cred_ref;  /* count of zone_hold_cred()s on zone */
 510  507          /*
 511  508           * Fixed-sized array of subsystem-specific reference counts
 512  509           * The sum of all of the counts must be less than or equal to zone_ref.
 513  510           * The array is indexed by the counts' subsystems' zone_ref_subsys_t
 514  511           * constants.
 515  512           */
 516  513          uint_t          zone_subsys_ref[ZONE_REF_NUM_SUBSYS];
 517  514          list_t          zone_ref_list;  /* list of zone_ref_t structs */
↓ open down ↓ 104 lines elided ↑ open up ↑
 622  619          uint64_t        zone_zfs_weight;        /* used to prevent starvation */
 623  620          uint64_t        zone_io_util;           /* IO utilization metric */
 624  621          boolean_t       zone_io_util_above_avg; /* IO util percent > avg. */
 625  622          uint16_t        zone_io_delay;          /* IO delay on logical r/w */
 626  623          kmutex_t        zone_stg_io_lock;       /* protects IO window data */
 627  624          sys_zio_cntr_t  zone_rd_ops;            /* Counters for ZFS reads, */
 628  625          sys_zio_cntr_t  zone_wr_ops;            /* writes and */
 629  626          sys_zio_cntr_t  zone_lwr_ops;           /* logical writes. */
 630  627  
 631  628          /*
      629 +         * kstats and counters for I/O ops and bytes.
      630 +         */
      631 +        kmutex_t        zone_io_lock;           /* protects I/O statistics */
      632 +        kstat_t         *zone_io_ksp;
      633 +        kstat_io_t      *zone_io_kiop;
      634 +
      635 +        /*
 632  636           * kstats and counters for VFS ops and bytes.
 633  637           */
 634  638          kmutex_t        zone_vfs_lock;          /* protects VFS statistics */
 635  639          kstat_t         *zone_vfs_ksp;
 636  640          kstat_io_t      zone_vfs_rwstats;
 637  641          zone_vfs_kstat_t *zone_vfs_stats;
 638  642  
 639  643          /*
 640  644           * kstats for ZFS I/O ops and bytes.
 641  645           */
 642  646          kmutex_t        zone_zfs_lock;          /* protects ZFS statistics */
 643      -        kstat_t         *zone_zfs_ksp;
 644  647          kstat_io_t      zone_zfs_rwstats;
 645  648          zone_zfs_kstat_t *zone_zfs_stats;
 646  649  
 647  650          /*
 648  651           * Solaris Auditing per-zone audit context
 649  652           */
 650  653          struct au_kcontext      *zone_audit_kctxt;
 651  654          /*
 652  655           * For private use by mntfs.
 653  656           */
↓ open down ↓ 46 lines elided ↑ open up ↑
 700  703          zone_misc_kstat_t *zone_misc_stats;
 701  704          uint64_t        zone_stime;             /* total system time */
 702  705          uint64_t        zone_utime;             /* total user time */
 703  706          uint64_t        zone_wtime;             /* total time waiting in runq */
 704  707          /* fork-fail kstat tracking */
 705  708          uint32_t        zone_ffcap;             /* hit an rctl cap */
 706  709          uint32_t        zone_ffnoproc;          /* get proc/lwp error */
 707  710          uint32_t        zone_ffnomem;           /* as_dup/memory error */
 708  711          uint32_t        zone_ffmisc;            /* misc. other error */
 709  712  
 710      -        uint32_t        zone_mfseglim;          /* map failure (# segs limit) */
 711      -
 712  713          uint32_t        zone_nested_intp;       /* nested interp. kstat */
 713  714  
 714  715          struct loadavg_s zone_loadavg;          /* loadavg for this zone */
 715  716          uint64_t        zone_hp_avenrun[3];     /* high-precision avenrun */
 716  717          int             zone_avenrun[3];        /* FSCALED avg. run queue len */
 717  718  
 718  719          /*
 719  720           * FSS stats updated once per second by fss_decay_usage.
 720  721           */
 721  722          uint32_t        zone_fss_gen;           /* FSS generation cntr */
↓ open down ↓ 36 lines elided ↑ open up ↑
 758  759  extern void zone_cred_hold(zone_t *);
 759  760  extern void zone_cred_rele(zone_t *);
 760  761  extern void zone_task_hold(zone_t *);
 761  762  extern void zone_task_rele(zone_t *);
 762  763  extern zone_t *zone_find_by_id(zoneid_t);
 763  764  extern zone_t *zone_find_by_label(const ts_label_t *);
 764  765  extern zone_t *zone_find_by_name(char *);
 765  766  extern zone_t *zone_find_by_any_path(const char *, boolean_t);
 766  767  extern zone_t *zone_find_by_path(const char *);
 767  768  extern zoneid_t getzoneid(void);
 768      -extern zoneid_t getzonedid(void);
 769  769  extern zone_t *zone_find_by_id_nolock(zoneid_t);
 770  770  extern int zone_datalink_walk(zoneid_t, int (*)(datalink_id_t, void *), void *);
 771  771  extern int zone_check_datalink(zoneid_t *, datalink_id_t);
 772  772  extern void zone_loadavg_update();
 773  773  
 774  774  /*
 775  775   * Zone-specific data (ZSD) APIs
 776  776   */
 777  777  /*
 778  778   * The following is what code should be initializing its zone_key_t to if it
↓ open down ↓ 195 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX