xref: /titanic_50/usr/src/uts/common/fs/zev/sys/zev_checksums.h (revision 1ca5a13b91f7b1ae27d6dd26a0fd511ef5492d35)
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