Print this page
4185 New hash algorithm support

Split Close
Expand all
Collapse all
          --- old/usr/src/grub/grub-0.97/stage2/fsys_zfs.c
          +++ new/usr/src/grub/grub-0.97/stage2/fsys_zfs.c
↓ open down ↓ 137 lines elided ↑ open up ↑
 138  138          {{NULL,                 NULL},                  0, 0,   "inherit"},
 139  139          {{NULL,                 NULL},                  0, 0,   "on"},
 140  140          {{zio_checksum_off,     zio_checksum_off},      0, 0,   "off"},
 141  141          {{zio_checksum_SHA256,  zio_checksum_SHA256},   1, 1,   "label"},
 142  142          {{zio_checksum_SHA256,  zio_checksum_SHA256},   1, 1,   "gang_header"},
 143  143          {{NULL,                 NULL},                  0, 0,   "zilog"},
 144  144          {{fletcher_2_native,    fletcher_2_byteswap},   0, 0,   "fletcher2"},
 145  145          {{fletcher_4_native,    fletcher_4_byteswap},   1, 0,   "fletcher4"},
 146  146          {{zio_checksum_SHA256,  zio_checksum_SHA256},   1, 0,   "SHA256"},
 147  147          {{NULL,                 NULL},                  0, 0,   "zilog2"},
      148 +        {{zio_checksum_SHA512,  NULL},                  0, 0,   "SHA512"}
 148  149  };
 149  150  
 150  151  /*
 151  152   * zio_checksum_verify: Provides support for checksum verification.
 152  153   *
 153      - * Fletcher2, Fletcher4, and SHA256 are supported.
      154 + * Fletcher2, Fletcher4, SHA-256 and SHA-512/256 are supported.
 154  155   *
 155  156   * Return:
 156  157   *      -1 = Failure
 157  158   *       0 = Success
 158  159   */
 159  160  static int
 160  161  zio_checksum_verify(blkptr_t *bp, char *data, int size)
 161  162  {
 162  163          zio_cksum_t zc = bp->blk_cksum;
 163  164          uint32_t checksum = BP_GET_CHECKSUM(bp);
↓ open down ↓ 795 lines elided ↑ open up ↑
 959  960  /*
 960  961   * List of pool features that the grub implementation of ZFS supports for
 961  962   * read. Note that features that are only required for write do not need
 962  963   * to be listed here since grub opens pools in read-only mode.
 963  964   *
 964  965   * When this list is updated the version number in usr/src/grub/capability
 965  966   * must be incremented to ensure the new grub gets installed.
 966  967   */
 967  968  static const char *spa_feature_names[] = {
 968  969          "org.illumos:lz4_compress",
      970 +        "org.illumos:sha512",
 969  971          NULL
 970  972  };
 971  973  
 972  974  /*
 973  975   * Checks whether the MOS features that are active are supported by this
 974  976   * (GRUB's) implementation of ZFS.
 975  977   *
 976  978   * Return:
 977  979   *      0: Success.
 978  980   *      errnum: Failure.
↓ open down ↓ 820 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX