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