Print this page
2882 implement libzfs_core
2883 changing "canmount" property to "on" should not always remount dataset
2900 "zfs snapshot" should be able to create multiple, arbitrary snapshots at once
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Chris Siden <christopher.siden@delphix.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Bill Pijewski <wdp@joyent.com>
Reviewed by: Dan Kruchinin <dan.kruchinin@gmail.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/fs/zfs.h
          +++ new/usr/src/uts/common/sys/fs/zfs.h
↓ open down ↓ 44 lines elided ↑ open up ↑
  45   45   * Each dataset can be one of the following types.  These constants can be
  46   46   * combined into masks that can be passed to various functions.
  47   47   */
  48   48  typedef enum {
  49   49          ZFS_TYPE_FILESYSTEM     = 0x1,
  50   50          ZFS_TYPE_SNAPSHOT       = 0x2,
  51   51          ZFS_TYPE_VOLUME         = 0x4,
  52   52          ZFS_TYPE_POOL           = 0x8
  53   53  } zfs_type_t;
  54   54  
       55 +typedef enum dmu_objset_type {
       56 +        DMU_OST_NONE,
       57 +        DMU_OST_META,
       58 +        DMU_OST_ZFS,
       59 +        DMU_OST_ZVOL,
       60 +        DMU_OST_OTHER,                  /* For testing only! */
       61 +        DMU_OST_ANY,                    /* Be careful! */
       62 +        DMU_OST_NUMTYPES
       63 +} dmu_objset_type_t;
       64 +
  55   65  #define ZFS_TYPE_DATASET        \
  56   66          (ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME | ZFS_TYPE_SNAPSHOT)
  57   67  
  58   68  #define ZAP_MAXNAMELEN 256
  59   69  #define ZAP_MAXVALUELEN (1024 * 8)
  60   70  #define ZAP_OLDMAXVALUELEN 1024
  61   71  
  62   72  /*
  63   73   * Dataset properties are identified by these constants and must be added to
  64   74   * the end of this list to ensure that external consumers are not affected
↓ open down ↓ 672 lines elided ↑ open up ↑
 737  747  /* for dump and swap */
 738  748  #define ZVOL_FULL_DEV_DIR       ZVOL_DIR "/dsk/"
 739  749  #define ZVOL_FULL_RDEV_DIR      ZVOL_DIR "/rdsk/"
 740  750  
 741  751  #define ZVOL_PROP_NAME          "name"
 742  752  #define ZVOL_DEFAULT_BLOCKSIZE  8192
 743  753  
 744  754  /*
 745  755   * /dev/zfs ioctl numbers.
 746  756   */
 747      -#define ZFS_IOC         ('Z' << 8)
 748      -
 749  757  typedef enum zfs_ioc {
 750      -        ZFS_IOC_POOL_CREATE = ZFS_IOC,
      758 +        ZFS_IOC_FIRST = ('Z' << 8),
      759 +        ZFS_IOC = ZFS_IOC_FIRST,
      760 +        ZFS_IOC_POOL_CREATE = ZFS_IOC_FIRST,
 751  761          ZFS_IOC_POOL_DESTROY,
 752  762          ZFS_IOC_POOL_IMPORT,
 753  763          ZFS_IOC_POOL_EXPORT,
 754  764          ZFS_IOC_POOL_CONFIGS,
 755  765          ZFS_IOC_POOL_STATS,
 756  766          ZFS_IOC_POOL_TRYIMPORT,
 757  767          ZFS_IOC_POOL_SCAN,
 758  768          ZFS_IOC_POOL_FREEZE,
 759  769          ZFS_IOC_POOL_UPGRADE,
 760  770          ZFS_IOC_POOL_GET_HISTORY,
↓ open down ↓ 38 lines elided ↑ open up ↑
 799  809          ZFS_IOC_RELEASE,
 800  810          ZFS_IOC_GET_HOLDS,
 801  811          ZFS_IOC_OBJSET_RECVD_PROPS,
 802  812          ZFS_IOC_VDEV_SPLIT,
 803  813          ZFS_IOC_NEXT_OBJ,
 804  814          ZFS_IOC_DIFF,
 805  815          ZFS_IOC_TMP_SNAPSHOT,
 806  816          ZFS_IOC_OBJ_TO_STATS,
 807  817          ZFS_IOC_SPACE_WRITTEN,
 808  818          ZFS_IOC_SPACE_SNAPS,
 809      -        ZFS_IOC_DESTROY_SNAPS_NVL,
      819 +        ZFS_IOC_DESTROY_SNAPS,
 810  820          ZFS_IOC_POOL_REGUID,
 811  821          ZFS_IOC_POOL_REOPEN,
 812      -        ZFS_IOC_SEND_PROGRESS
      822 +        ZFS_IOC_SEND_PROGRESS,
      823 +        ZFS_IOC_LOG_HISTORY,
      824 +        ZFS_IOC_SEND_NEW,
      825 +        ZFS_IOC_SEND_SPACE,
      826 +        ZFS_IOC_CLONE,
      827 +        ZFS_IOC_LAST
 813  828  } zfs_ioc_t;
 814  829  
 815  830  /*
 816  831   * Internal SPA load state.  Used by FMA diagnosis engine.
 817  832   */
 818  833  typedef enum {
 819  834          SPA_LOAD_NONE,          /* no load in progress  */
 820  835          SPA_LOAD_OPEN,          /* normal open          */
 821  836          SPA_LOAD_IMPORT,        /* import in progress   */
 822  837          SPA_LOAD_TRYIMPORT,     /* tryimport in progress */
↓ open down ↓ 16 lines elided ↑ open up ↑
 839  854   */
 840  855  #define ZPOOL_HIST_RECORD       "history record"
 841  856  #define ZPOOL_HIST_TIME         "history time"
 842  857  #define ZPOOL_HIST_CMD          "history command"
 843  858  #define ZPOOL_HIST_WHO          "history who"
 844  859  #define ZPOOL_HIST_ZONE         "history zone"
 845  860  #define ZPOOL_HIST_HOST         "history hostname"
 846  861  #define ZPOOL_HIST_TXG          "history txg"
 847  862  #define ZPOOL_HIST_INT_EVENT    "history internal event"
 848  863  #define ZPOOL_HIST_INT_STR      "history internal str"
      864 +#define ZPOOL_HIST_INT_NAME     "internal_name"
      865 +#define ZPOOL_HIST_IOCTL        "ioctl"
      866 +#define ZPOOL_HIST_INPUT_NVL    "in_nvl"
      867 +#define ZPOOL_HIST_OUTPUT_NVL   "out_nvl"
      868 +#define ZPOOL_HIST_DSNAME       "dsname"
      869 +#define ZPOOL_HIST_DSID         "dsid"
 849  870  
 850  871  /*
 851  872   * Flags for ZFS_IOC_VDEV_SET_STATE
 852  873   */
 853  874  #define ZFS_ONLINE_CHECKREMOVE  0x1
 854  875  #define ZFS_ONLINE_UNSPARE      0x2
 855  876  #define ZFS_ONLINE_FORCEFAULT   0x4
 856  877  #define ZFS_ONLINE_EXPAND       0x8
 857  878  #define ZFS_OFFLINE_TEMPORARY   0x1
 858  879  
↓ open down ↓ 25 lines elided ↑ open up ↑
 884  905   *              ZFS_EV_POOL_NAME        DATA_TYPE_STRING
 885  906   *              ZFS_EV_POOL_GUID        DATA_TYPE_UINT64
 886  907   *              ZFS_EV_VDEV_PATH        DATA_TYPE_STRING        (optional)
 887  908   *              ZFS_EV_VDEV_GUID        DATA_TYPE_UINT64
 888  909   */
 889  910  #define ZFS_EV_POOL_NAME        "pool_name"
 890  911  #define ZFS_EV_POOL_GUID        "pool_guid"
 891  912  #define ZFS_EV_VDEV_PATH        "vdev_path"
 892  913  #define ZFS_EV_VDEV_GUID        "vdev_guid"
 893  914  
 894      -/*
 895      - * Note: This is encoded on-disk, so new events must be added to the
 896      - * end, and unused events can not be removed.  Be sure to edit
 897      - * libzfs_pool.c: hist_event_table[].
 898      - */
 899      -typedef enum history_internal_events {
 900      -        LOG_NO_EVENT = 0,
 901      -        LOG_POOL_CREATE,
 902      -        LOG_POOL_VDEV_ADD,
 903      -        LOG_POOL_REMOVE,
 904      -        LOG_POOL_DESTROY,
 905      -        LOG_POOL_EXPORT,
 906      -        LOG_POOL_IMPORT,
 907      -        LOG_POOL_VDEV_ATTACH,
 908      -        LOG_POOL_VDEV_REPLACE,
 909      -        LOG_POOL_VDEV_DETACH,
 910      -        LOG_POOL_VDEV_ONLINE,
 911      -        LOG_POOL_VDEV_OFFLINE,
 912      -        LOG_POOL_UPGRADE,
 913      -        LOG_POOL_CLEAR,
 914      -        LOG_POOL_SCAN,
 915      -        LOG_POOL_PROPSET,
 916      -        LOG_DS_CREATE,
 917      -        LOG_DS_CLONE,
 918      -        LOG_DS_DESTROY,
 919      -        LOG_DS_DESTROY_BEGIN,
 920      -        LOG_DS_INHERIT,
 921      -        LOG_DS_PROPSET,
 922      -        LOG_DS_QUOTA,
 923      -        LOG_DS_PERM_UPDATE,
 924      -        LOG_DS_PERM_REMOVE,
 925      -        LOG_DS_PERM_WHO_REMOVE,
 926      -        LOG_DS_PROMOTE,
 927      -        LOG_DS_RECEIVE,
 928      -        LOG_DS_RENAME,
 929      -        LOG_DS_RESERVATION,
 930      -        LOG_DS_REPLAY_INC_SYNC,
 931      -        LOG_DS_REPLAY_FULL_SYNC,
 932      -        LOG_DS_ROLLBACK,
 933      -        LOG_DS_SNAPSHOT,
 934      -        LOG_DS_UPGRADE,
 935      -        LOG_DS_REFQUOTA,
 936      -        LOG_DS_REFRESERV,
 937      -        LOG_POOL_SCAN_DONE,
 938      -        LOG_DS_USER_HOLD,
 939      -        LOG_DS_USER_RELEASE,
 940      -        LOG_POOL_SPLIT,
 941      -        LOG_END
 942      -} history_internal_events_t;
 943      -
 944  915  #ifdef  __cplusplus
 945  916  }
 946  917  #endif
 947  918  
 948  919  #endif  /* _SYS_FS_ZFS_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX