Print this page
4185 New hash algorithm support

Split Close
Expand all
Collapse all
          --- old/usr/src/common/zfs/zfs_prop.c
          +++ new/usr/src/common/zfs/zfs_prop.c
↓ open down ↓ 63 lines elided ↑ open up ↑
  64   64  void
  65   65  zfs_prop_init(void)
  66   66  {
  67   67          static zprop_index_t checksum_table[] = {
  68   68                  { "on",         ZIO_CHECKSUM_ON },
  69   69                  { "off",        ZIO_CHECKSUM_OFF },
  70   70                  { "fletcher2",  ZIO_CHECKSUM_FLETCHER_2 },
  71   71                  { "fletcher4",  ZIO_CHECKSUM_FLETCHER_4 },
  72   72                  { "sha256",     ZIO_CHECKSUM_SHA256 },
  73   73                  { "noparity",   ZIO_CHECKSUM_NOPARITY },
       74 +                { "sha512",     ZIO_CHECKSUM_SHA512 },
       75 +                { "skein",      ZIO_CHECKSUM_SKEIN },
       76 +                { "edonr",      ZIO_CHECKSUM_EDONR },
  74   77                  { NULL }
  75   78          };
  76   79  
  77   80          static zprop_index_t dedup_table[] = {
  78   81                  { "on",         ZIO_CHECKSUM_ON },
  79   82                  { "off",        ZIO_CHECKSUM_OFF },
  80   83                  { "verify",     ZIO_CHECKSUM_ON | ZIO_CHECKSUM_VERIFY },
  81   84                  { "sha256",     ZIO_CHECKSUM_SHA256 },
  82   85                  { "sha256,verify",
  83   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 },
  84   96                  { NULL }
  85   97          };
  86   98  
  87   99          static zprop_index_t compress_table[] = {
  88  100                  { "on",         ZIO_COMPRESS_ON },
  89  101                  { "off",        ZIO_COMPRESS_OFF },
  90  102                  { "lzjb",       ZIO_COMPRESS_LZJB },
  91  103                  { "gzip",       ZIO_COMPRESS_GZIP_6 },  /* gzip default */
  92  104                  { "gzip-1",     ZIO_COMPRESS_GZIP_1 },
  93  105                  { "gzip-2",     ZIO_COMPRESS_GZIP_2 },
↓ open down ↓ 105 lines elided ↑ open up ↑
 199  211          };
 200  212  
 201  213          /* inherit index properties */
 202  214          zprop_register_index(ZFS_PROP_SYNC, "sync", ZFS_SYNC_STANDARD,
 203  215              PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
 204  216              "standard | always | disabled", "SYNC",
 205  217              sync_table);
 206  218          zprop_register_index(ZFS_PROP_CHECKSUM, "checksum",
 207  219              ZIO_CHECKSUM_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM |
 208  220              ZFS_TYPE_VOLUME,
 209      -            "on | off | fletcher2 | fletcher4 | sha256", "CHECKSUM",
 210      -            checksum_table);
      221 +            "on | off | fletcher2 | fletcher4 | sha256 | sha512 | "
      222 +            "skein | edonr", "CHECKSUM", checksum_table);
 211  223          zprop_register_index(ZFS_PROP_DEDUP, "dedup", ZIO_CHECKSUM_OFF,
 212  224              PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
 213      -            "on | off | verify | sha256[,verify]", "DEDUP",
 214      -            dedup_table);
      225 +            "on | off | verify | sha256[,verify], sha512[,verify], "
      226 +            "skein[,verify], edonr[,verify]", "DEDUP", dedup_table);
 215  227          zprop_register_index(ZFS_PROP_COMPRESSION, "compression",
 216  228              ZIO_COMPRESS_DEFAULT, PROP_INHERIT,
 217  229              ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
 218  230              "on | off | lzjb | gzip | gzip-[1-9] | zle | lz4",
 219  231              "COMPRESS", compress_table);
 220  232          zprop_register_index(ZFS_PROP_SNAPDIR, "snapdir", ZFS_SNAPDIR_HIDDEN,
 221  233              PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
 222  234              "hidden | visible", "SNAPDIR", snapdir_table);
 223  235          zprop_register_index(ZFS_PROP_ACLMODE, "aclmode", ZFS_ACL_DISCARD,
 224  236              PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
↓ open down ↓ 406 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX