xref: /titanic_50/usr/src/uts/common/sys/fs/zev.h (revision 2bb8e5e2ef829a38e0408e7207b4aa15f5eb947b)
1 #ifndef __ZEV_H__
2 #define __ZEV_H__
3 
4 #include <sys/types.h>
5 
6 #ifdef _KERNEL
7 #include <sys/dmu_objset.h>
8 #include <sys/dsl_dataset.h>
9 #include <sys/zfs_vfsops.h>
10 #include <sys/dsl_dir.h>
11 #include <sys/spa_impl.h>
12 #endif
13 
14 #define ZEVIOC			('z' << 8)
15 #define ZEV_IOC_GET_STATISTICS		(ZEVIOC | 1)	/* get zev statistics */
16 #define ZEV_IOC_MUTE_POOL		(ZEVIOC | 2)	/* no events for pool */
17 #define ZEV_IOC_UNMUTE_POOL		(ZEVIOC | 3)	/* send pool events */
18 #define ZEV_IOC_SET_MAX_QUEUE_LEN	(ZEVIOC | 4)	/* when to block ops */
19 
20 #define ZEV_OP_MIN			 1
21 #define	ZEV_OP_ZFS_MOUNT		 1
22 #define	ZEV_OP_ZFS_UMOUNT		 2
23 #define	ZEV_OP_ZVOL_WRITE		 3
24 #define	ZEV_OP_ZVOL_TRUNCATE		 4
25 #define	ZEV_OP_ZNODE_CLOSE_AFTER_UPDATE	 5
26 #define	ZEV_OP_ZNODE_CREATE		 6
27 #define	ZEV_OP_ZNODE_REMOVE		 7
28 #define	ZEV_OP_ZNODE_LINK		 8
29 #define	ZEV_OP_ZNODE_SYMLINK		 9
30 #define	ZEV_OP_ZNODE_RENAME		10
31 #define	ZEV_OP_ZNODE_WRITE		11
32 #define	ZEV_OP_ZNODE_TRUNCATE		12
33 #define	ZEV_OP_ZNODE_SETATTR		13
34 #define	ZEV_OP_ZNODE_ACL		14
35 #define	ZEV_OP_MAX			14
36 
37 typedef struct zev_statistics_t {
38 	uint64_t	zev_queue_len;
39 	uint64_t	zev_max_queue_len;
40 	uint64_t	zev_bytes_read;
41 	/* counters */
42 	uint64_t	zev_cnt_total_events;
43 	uint64_t	zev_cnt_errors;
44 	/* zfsvfs ops */
45 	uint64_t	zev_cnt_zfs_mount;
46 	uint64_t	zev_cnt_zfs_umount;
47 	/* zvol ops */
48 	uint64_t	zev_cnt_zvol_write;
49 	uint64_t	zev_cnt_zvol_truncate;
50 	/* znode ops */
51 	uint64_t	zev_cnt_znode_close_after_update;
52 	uint64_t	zev_cnt_znode_create;
53 	uint64_t	zev_cnt_znode_remove;
54 	uint64_t	zev_cnt_znode_link;
55 	uint64_t	zev_cnt_znode_symlink;
56 	uint64_t	zev_cnt_znode_rename;
57 	uint64_t	zev_cnt_znode_write;
58 	uint64_t	zev_cnt_znode_truncate;
59 	uint64_t	zev_cnt_znode_setattr;
60 	uint64_t	zev_cnt_znode_acl;
61 } zev_statistics_t;
62 
63 typedef struct zev_ioctl_poolarg {
64 	uint64_t	zev_poolname_len;
65 	char		zev_poolname[MAXPATHLEN];
66 } zev_ioctl_poolarg_t;
67 
68 #ifdef _KERNEL
69 void zev_mq_printf(int op, int error, char *fmt, ...);
70 int zev_skip_pool(objset_t *os);
71 #endif
72 
73 #endif /* __ZEV_H__ */
74 
75