zio_checksum.h 1.1 KB

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