1 #ifndef __ZEV_CHECKSUMS_H__ 2 #define __ZEV_CHECKSUMS_H__ 3 4 #include <sys/zfs_znode.h> 5 #include <sys/fs/zev.h> 6 7 /* cache size in bytes */ 8 #define ZEV_CHKSUM_DEFAULT_CACHE_SIZE (4 * 1024 * 1024) 9 10 void zev_chksum_init(void); 11 void zev_chksum_fini(void); 12 13 typedef enum { 14 zev_write = 0, 15 zev_truncate 16 } zev_chksum_mode_t; 17 18 int zev_get_checksums(zev_sig_t **sig_buf, 19 uint64_t *sig_buf_len, 20 uint64_t *sig_cnt, 21 uint64_t max_sig_buf_len, 22 znode_t *zp, 23 uint64_t off, 24 uint64_t len, 25 zev_chksum_mode_t mode); 26 27 void zev_chksum_stats(uint64_t *c_size, uint64_t *c_hits, uint64_t *c_misses); 28 29 int zev_ioc_get_signatures(intptr_t arg, int mode); 30 void zev_symlink_checksum(zev_znode_symlink_t *rec, char *link); 31 void zev_create_checksum(zev_znode_create_t *rec, znode_t *zp); 32 33 #endif 34 35