zio_checksum.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * GRUB -- GRand Unified Bootloader
  4. * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
  5. */
  6. /*
  7. * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
  8. * Use is subject to license terms.
  9. */
  10. #ifndef _SYS_ZIO_CHECKSUM_H
  11. #define _SYS_ZIO_CHECKSUM_H
  12. /*
  13. * Signature for checksum functions.
  14. */
  15. typedef void zio_checksum_t(const void *data, uint64_t size,
  16. zfs_endian_t endian, zio_cksum_t *zcp);
  17. /*
  18. * Information about each checksum function.
  19. */
  20. typedef struct zio_checksum_info {
  21. zio_checksum_t *ci_func; /* checksum function for each byteorder */
  22. int ci_correctable; /* number of correctable bits */
  23. int ci_eck; /* uses zio embedded checksum? */
  24. char *ci_name; /* descriptive name */
  25. } zio_checksum_info_t;
  26. extern void zio_checksum_SHA256(const void *, uint64_t,
  27. zfs_endian_t endian, zio_cksum_t *);
  28. extern void fletcher_2_endian(const void *, uint64_t, zfs_endian_t endian,
  29. zio_cksum_t *);
  30. extern void fletcher_4_endian(const void *, uint64_t, zfs_endian_t endian,
  31. zio_cksum_t *);
  32. #endif /* _SYS_ZIO_CHECKSUM_H */