Print this page
4185 New hash algorithm support


  54         "groupused@",
  55         "groupquota@"
  56 };
  57 
  58 zprop_desc_t *
  59 zfs_prop_get_table(void)
  60 {
  61         return (zfs_prop_table);
  62 }
  63 
  64 void
  65 zfs_prop_init(void)
  66 {
  67         static zprop_index_t checksum_table[] = {
  68                 { "on",         ZIO_CHECKSUM_ON },
  69                 { "off",        ZIO_CHECKSUM_OFF },
  70                 { "fletcher2",  ZIO_CHECKSUM_FLETCHER_2 },
  71                 { "fletcher4",  ZIO_CHECKSUM_FLETCHER_4 },
  72                 { "sha256",     ZIO_CHECKSUM_SHA256 },
  73                 { "noparity",   ZIO_CHECKSUM_NOPARITY },



  74                 { NULL }
  75         };
  76 
  77         static zprop_index_t dedup_table[] = {
  78                 { "on",         ZIO_CHECKSUM_ON },
  79                 { "off",        ZIO_CHECKSUM_OFF },
  80                 { "verify",     ZIO_CHECKSUM_ON | ZIO_CHECKSUM_VERIFY },
  81                 { "sha256",     ZIO_CHECKSUM_SHA256 },
  82                 { "sha256,verify",
  83                                 ZIO_CHECKSUM_SHA256 | ZIO_CHECKSUM_VERIFY },









  84                 { NULL }
  85         };
  86 
  87         static zprop_index_t compress_table[] = {
  88                 { "on",         ZIO_COMPRESS_ON },
  89                 { "off",        ZIO_COMPRESS_OFF },
  90                 { "lzjb",       ZIO_COMPRESS_LZJB },
  91                 { "gzip",       ZIO_COMPRESS_GZIP_6 },  /* gzip default */
  92                 { "gzip-1",     ZIO_COMPRESS_GZIP_1 },
  93                 { "gzip-2",     ZIO_COMPRESS_GZIP_2 },
  94                 { "gzip-3",     ZIO_COMPRESS_GZIP_3 },
  95                 { "gzip-4",     ZIO_COMPRESS_GZIP_4 },
  96                 { "gzip-5",     ZIO_COMPRESS_GZIP_5 },
  97                 { "gzip-6",     ZIO_COMPRESS_GZIP_6 },
  98                 { "gzip-7",     ZIO_COMPRESS_GZIP_7 },
  99                 { "gzip-8",     ZIO_COMPRESS_GZIP_8 },
 100                 { "gzip-9",     ZIO_COMPRESS_GZIP_9 },
 101                 { "zle",        ZIO_COMPRESS_ZLE },
 102                 { "lz4",        ZIO_COMPRESS_LZ4 },
 103                 { NULL }


 189                 { "metadata",   ZFS_CACHE_METADATA },
 190                 { "all",        ZFS_CACHE_ALL },
 191                 { NULL }
 192         };
 193 
 194         static zprop_index_t sync_table[] = {
 195                 { "standard",   ZFS_SYNC_STANDARD },
 196                 { "always",     ZFS_SYNC_ALWAYS },
 197                 { "disabled",   ZFS_SYNC_DISABLED },
 198                 { NULL }
 199         };
 200 
 201         /* inherit index properties */
 202         zprop_register_index(ZFS_PROP_SYNC, "sync", ZFS_SYNC_STANDARD,
 203             PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
 204             "standard | always | disabled", "SYNC",
 205             sync_table);
 206         zprop_register_index(ZFS_PROP_CHECKSUM, "checksum",
 207             ZIO_CHECKSUM_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM |
 208             ZFS_TYPE_VOLUME,
 209             "on | off | fletcher2 | fletcher4 | sha256", "CHECKSUM",
 210             checksum_table);
 211         zprop_register_index(ZFS_PROP_DEDUP, "dedup", ZIO_CHECKSUM_OFF,
 212             PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
 213             "on | off | verify | sha256[,verify]", "DEDUP",
 214             dedup_table);
 215         zprop_register_index(ZFS_PROP_COMPRESSION, "compression",
 216             ZIO_COMPRESS_DEFAULT, PROP_INHERIT,
 217             ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
 218             "on | off | lzjb | gzip | gzip-[1-9] | zle | lz4",
 219             "COMPRESS", compress_table);
 220         zprop_register_index(ZFS_PROP_SNAPDIR, "snapdir", ZFS_SNAPDIR_HIDDEN,
 221             PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
 222             "hidden | visible", "SNAPDIR", snapdir_table);
 223         zprop_register_index(ZFS_PROP_ACLMODE, "aclmode", ZFS_ACL_DISCARD,
 224             PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
 225             "discard | groupmask | passthrough | restricted", "ACLMODE",
 226             acl_mode_table);
 227         zprop_register_index(ZFS_PROP_ACLINHERIT, "aclinherit",
 228             ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
 229             "discard | noallow | restricted | passthrough | passthrough-x",
 230             "ACLINHERIT", acl_inherit_table);
 231         zprop_register_index(ZFS_PROP_COPIES, "copies", 1, PROP_INHERIT,
 232             ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
 233             "1 | 2 | 3", "COPIES", copies_table);
 234         zprop_register_index(ZFS_PROP_PRIMARYCACHE, "primarycache",




  54         "groupused@",
  55         "groupquota@"
  56 };
  57 
  58 zprop_desc_t *
  59 zfs_prop_get_table(void)
  60 {
  61         return (zfs_prop_table);
  62 }
  63 
  64 void
  65 zfs_prop_init(void)
  66 {
  67         static zprop_index_t checksum_table[] = {
  68                 { "on",         ZIO_CHECKSUM_ON },
  69                 { "off",        ZIO_CHECKSUM_OFF },
  70                 { "fletcher2",  ZIO_CHECKSUM_FLETCHER_2 },
  71                 { "fletcher4",  ZIO_CHECKSUM_FLETCHER_4 },
  72                 { "sha256",     ZIO_CHECKSUM_SHA256 },
  73                 { "noparity",   ZIO_CHECKSUM_NOPARITY },
  74                 { "sha512",     ZIO_CHECKSUM_SHA512 },
  75                 { "skein",      ZIO_CHECKSUM_SKEIN },
  76                 { "edonr",      ZIO_CHECKSUM_EDONR },
  77                 { NULL }
  78         };
  79 
  80         static zprop_index_t dedup_table[] = {
  81                 { "on",         ZIO_CHECKSUM_ON },
  82                 { "off",        ZIO_CHECKSUM_OFF },
  83                 { "verify",     ZIO_CHECKSUM_ON | ZIO_CHECKSUM_VERIFY },
  84                 { "sha256",     ZIO_CHECKSUM_SHA256 },
  85                 { "sha256,verify",
  86                                 ZIO_CHECKSUM_SHA256 | ZIO_CHECKSUM_VERIFY },
  87                 { "sha512",     ZIO_CHECKSUM_SHA512 },
  88                 { "sha512,verify",
  89                                 ZIO_CHECKSUM_SHA512 | ZIO_CHECKSUM_VERIFY },
  90                 { "skein",      ZIO_CHECKSUM_SKEIN },
  91                 { "skein,verify",
  92                                 ZIO_CHECKSUM_SKEIN | ZIO_CHECKSUM_VERIFY },
  93                 { "edonr",      ZIO_CHECKSUM_EDONR },
  94                 { "edonr,verify",
  95                                 ZIO_CHECKSUM_EDONR | ZIO_CHECKSUM_VERIFY },
  96                 { NULL }
  97         };
  98 
  99         static zprop_index_t compress_table[] = {
 100                 { "on",         ZIO_COMPRESS_ON },
 101                 { "off",        ZIO_COMPRESS_OFF },
 102                 { "lzjb",       ZIO_COMPRESS_LZJB },
 103                 { "gzip",       ZIO_COMPRESS_GZIP_6 },  /* gzip default */
 104                 { "gzip-1",     ZIO_COMPRESS_GZIP_1 },
 105                 { "gzip-2",     ZIO_COMPRESS_GZIP_2 },
 106                 { "gzip-3",     ZIO_COMPRESS_GZIP_3 },
 107                 { "gzip-4",     ZIO_COMPRESS_GZIP_4 },
 108                 { "gzip-5",     ZIO_COMPRESS_GZIP_5 },
 109                 { "gzip-6",     ZIO_COMPRESS_GZIP_6 },
 110                 { "gzip-7",     ZIO_COMPRESS_GZIP_7 },
 111                 { "gzip-8",     ZIO_COMPRESS_GZIP_8 },
 112                 { "gzip-9",     ZIO_COMPRESS_GZIP_9 },
 113                 { "zle",        ZIO_COMPRESS_ZLE },
 114                 { "lz4",        ZIO_COMPRESS_LZ4 },
 115                 { NULL }


 201                 { "metadata",   ZFS_CACHE_METADATA },
 202                 { "all",        ZFS_CACHE_ALL },
 203                 { NULL }
 204         };
 205 
 206         static zprop_index_t sync_table[] = {
 207                 { "standard",   ZFS_SYNC_STANDARD },
 208                 { "always",     ZFS_SYNC_ALWAYS },
 209                 { "disabled",   ZFS_SYNC_DISABLED },
 210                 { NULL }
 211         };
 212 
 213         /* inherit index properties */
 214         zprop_register_index(ZFS_PROP_SYNC, "sync", ZFS_SYNC_STANDARD,
 215             PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
 216             "standard | always | disabled", "SYNC",
 217             sync_table);
 218         zprop_register_index(ZFS_PROP_CHECKSUM, "checksum",
 219             ZIO_CHECKSUM_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM |
 220             ZFS_TYPE_VOLUME,
 221             "on | off | fletcher2 | fletcher4 | sha256 | sha512 | "
 222             "skein | edonr", "CHECKSUM", checksum_table);
 223         zprop_register_index(ZFS_PROP_DEDUP, "dedup", ZIO_CHECKSUM_OFF,
 224             PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
 225             "on | off | verify | sha256[,verify], sha512[,verify], "
 226             "skein[,verify], edonr[,verify]", "DEDUP", dedup_table);
 227         zprop_register_index(ZFS_PROP_COMPRESSION, "compression",
 228             ZIO_COMPRESS_DEFAULT, PROP_INHERIT,
 229             ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
 230             "on | off | lzjb | gzip | gzip-[1-9] | zle | lz4",
 231             "COMPRESS", compress_table);
 232         zprop_register_index(ZFS_PROP_SNAPDIR, "snapdir", ZFS_SNAPDIR_HIDDEN,
 233             PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
 234             "hidden | visible", "SNAPDIR", snapdir_table);
 235         zprop_register_index(ZFS_PROP_ACLMODE, "aclmode", ZFS_ACL_DISCARD,
 236             PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
 237             "discard | groupmask | passthrough | restricted", "ACLMODE",
 238             acl_mode_table);
 239         zprop_register_index(ZFS_PROP_ACLINHERIT, "aclinherit",
 240             ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
 241             "discard | noallow | restricted | passthrough | passthrough-x",
 242             "ACLINHERIT", acl_inherit_table);
 243         zprop_register_index(ZFS_PROP_COPIES, "copies", 1, PROP_INHERIT,
 244             ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
 245             "1 | 2 | 3", "COPIES", copies_table);
 246         zprop_register_index(ZFS_PROP_PRIMARYCACHE, "primarycache",