Print this page
    
NEX-9406 Add a property to show that a dataset has been modified since a snapshot
Reviewed by: Alexey Komarov <alexey.komarov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
OS-80 support for vdev and CoS properties for the new I/O scheduler
OS-95 lint warning introduced by OS-61
Moved closed ZFS files to open repo, changed Makefiles accordingly
Removed unneeded weak symbols
re #12585 rb4049 ZFS++ work port - refactoring to improve separation of open/closed code, bug fixes, performance improvements - open code
Bug 11205: add missing libzfs_closed_stubs.c to fix opensource-only build.
ZFS plus work: special vdevs, cos, cos/vdev properties
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/common/zfs/zfs_prop.h
          +++ new/usr/src/common/zfs/zfs_prop.h
   1    1  /*
   2    2   * CDDL HEADER START
   3    3   *
   4    4   * The contents of this file are subject to the terms of the
   5    5   * Common Development and Distribution License (the "License").
   6    6   * You may not use this file except in compliance with the License.
   7    7   *
   8    8   * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9    9   * or http://www.opensolaris.org/os/licensing.
  10   10   * See the License for the specific language governing permissions
  11   11   * and limitations under the License.
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  
    | 
      ↓ open down ↓ | 
    13 lines elided | 
    
      ↑ open up ↑ | 
  
  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 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + * Copyright 2017 Nexenta Systems, Inc. All rights reserved.
  24   25   */
  25   26  
  26   27  #ifndef _ZFS_PROP_H
  27   28  #define _ZFS_PROP_H
  28   29  
  29   30  #include <sys/fs/zfs.h>
  30   31  #include <sys/types.h>
  31   32  
  32   33  #ifdef  __cplusplus
  33   34  extern "C" {
  34   35  #endif
  35   36  
  36   37  /*
  37   38   * For index types (e.g. compression and checksum), we want the numeric value
  38   39   * in the kernel, but the string value in userland.
  39   40   */
  40   41  typedef enum {
  41   42          PROP_TYPE_NUMBER,       /* numeric value */
  42   43          PROP_TYPE_STRING,       /* string value */
  43   44          PROP_TYPE_INDEX         /* numeric value indexed by string */
  44   45  } zprop_type_t;
  45   46  
  46   47  typedef enum {
  47   48          PROP_DEFAULT,
  48   49          PROP_READONLY,
  49   50          PROP_INHERIT,
  50   51          /*
  51   52           * ONETIME properties are a sort of conglomeration of READONLY
  52   53           * and INHERIT.  They can be set only during object creation,
  53   54           * after that they are READONLY.  If not explicitly set during
  54   55           * creation, they can be inherited.
  55   56           */
  56   57          PROP_ONETIME
  57   58  } zprop_attr_t;
  58   59  
  59   60  typedef struct zfs_index {
  60   61          const char *pi_name;
  61   62          uint64_t pi_value;
  62   63  } zprop_index_t;
  63   64  
  64   65  typedef struct {
  65   66          const char *pd_name;            /* human-readable property name */
  66   67          int pd_propnum;                 /* property number */
  67   68          zprop_type_t pd_proptype;       /* string, boolean, index, number */
  68   69          const char *pd_strdefault;      /* default for strings */
  69   70          uint64_t pd_numdefault;         /* for boolean / index / number */
  70   71          zprop_attr_t pd_attr;           /* default, readonly, inherit */
  71   72          int pd_types;                   /* bitfield of valid dataset types */
  72   73                                          /* fs | vol | snap; or pool */
  73   74          const char *pd_values;          /* string telling acceptable values */
  74   75          const char *pd_colname;         /* column header for "zfs list" */
  75   76          boolean_t pd_rightalign;        /* column alignment for "zfs list" */
  76   77          boolean_t pd_visible;           /* do we list this property with the */
  77   78                                          /* "zfs get" help message */
  78   79          const zprop_index_t *pd_table;  /* for index properties, a table */
  79   80                                          /* defining the possible values */
  80   81          size_t pd_table_size;           /* number of entries in pd_table[] */
  81   82  } zprop_desc_t;
  82   83  
  83   84  /*
  84   85   * zfs dataset property functions
  85   86   */
  86   87  void zfs_prop_init(void);
  87   88  zprop_type_t zfs_prop_get_type(zfs_prop_t);
  88   89  boolean_t zfs_prop_delegatable(zfs_prop_t prop);
  
    | 
      ↓ open down ↓ | 
    55 lines elided | 
    
      ↑ open up ↑ | 
  
  89   90  zprop_desc_t *zfs_prop_get_table(void);
  90   91  
  91   92  /*
  92   93   * zpool property functions
  93   94   */
  94   95  void zpool_prop_init(void);
  95   96  zprop_type_t zpool_prop_get_type(zpool_prop_t);
  96   97  zprop_desc_t *zpool_prop_get_table(void);
  97   98  
  98   99  /*
      100 + * vdev property functions
      101 + */
      102 +void vdev_prop_init(void);
      103 +zprop_type_t vdev_prop_get_type(vdev_prop_t);
      104 +zprop_desc_t *vdev_prop_get_table(void);
      105 +
      106 +/*
      107 + * cos property functions
      108 + */
      109 +void cos_prop_init(void);
      110 +zprop_type_t cos_prop_get_type(cos_prop_t);
      111 +zprop_desc_t *cos_prop_get_table(void);
      112 +
      113 +/*
  99  114   * Common routines to initialize property tables
 100  115   */
 101  116  void zprop_register_impl(int, const char *, zprop_type_t, uint64_t,
 102  117      const char *, zprop_attr_t, int, const char *, const char *,
 103  118      boolean_t, boolean_t, const zprop_index_t *);
 104  119  void zprop_register_string(int, const char *, const char *,
 105  120      zprop_attr_t attr, int, const char *, const char *);
 106  121  void zprop_register_number(int, const char *, uint64_t, zprop_attr_t, int,
 107  122      const char *, const char *);
 108  123  void zprop_register_index(int, const char *, uint64_t, zprop_attr_t, int,
 109  124      const char *, const char *, const zprop_index_t *);
 110  125  void zprop_register_hidden(int, const char *, zprop_type_t, zprop_attr_t,
 111  126      int, const char *);
      127 +void zprop_register_index_hidden(int prop, const char *name, uint64_t def,
      128 +    zprop_attr_t attr, int objset_types, const char *values,
      129 +    const char *colname, const zprop_index_t *idx_tbl);
 112  130  
 113  131  /*
 114  132   * Common routines for zfs and zpool property management
 115  133   */
 116  134  int zprop_iter_common(zprop_func, void *, boolean_t, boolean_t, zfs_type_t);
 117  135  int zprop_name_to_prop(const char *, zfs_type_t);
 118  136  int zprop_string_to_index(int, const char *, uint64_t *, zfs_type_t);
 119  137  int zprop_index_to_string(int, uint64_t, const char **, zfs_type_t);
 120  138  uint64_t zprop_random_value(int, uint64_t, zfs_type_t);
 121  139  const char *zprop_values(int, zfs_type_t);
 122  140  size_t zprop_width(int, boolean_t *, zfs_type_t);
 123  141  boolean_t zprop_valid_for_type(int, zfs_type_t);
 124  142  
 125  143  #ifdef  __cplusplus
 126  144  }
 127  145  #endif
 128  146  
 129  147  #endif  /* _ZFS_PROP_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX