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