#ifndef _SYS_ZFS_EVENTHOOKS_H #define _SYS_ZFS_EVENTHOOKS_H #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif #ifdef _KERNEL /* zfsvfs ops */ typedef void (*rz_zev_zfs_mount_cb_t)(vfs_t *vfs, vnode_t *mpt, char *dataset, boolean_t remount); typedef void (*rz_zev_zfs_umount_cb_t)(vfs_t *vfs); /* zvol zil events */ typedef void (*rz_zev_zvol_truncate_cb_t)(char *dataset, objset_t *os, dmu_tx_t *tx, uint64_t off, uint64_t len); typedef void (*rz_zev_zvol_write_cb_t)(char *dataset, objset_t *os, dmu_tx_t *tx, uint64_t off, uint64_t len); /* znode zil events */ typedef void (*rz_zev_znode_close_after_update_cb_t)(znode_t *zp); typedef void (*rz_zev_znode_create_cb_t)(znode_t *dzp, znode_t *zp, dmu_tx_t *tx, char *name, uint64_t txmode); typedef void (*rz_zev_znode_remove_cb_t)(znode_t *dzp, znode_t *zp, dmu_tx_t *tx, char *name, uint64_t txmode); typedef void (*rz_zev_znode_link_cb_t)(znode_t *dzp, znode_t *zp, dmu_tx_t *tx, char *name); typedef void (*rz_zev_znode_symlink_cb_t)(znode_t *dzp, znode_t *zp, dmu_tx_t *tx, char *name, char *link); typedef void (*rz_zev_znode_rename_cb_t)(znode_t *sdzp, char *sname, znode_t *tdzp, char *tname, znode_t *szp, znode_t *tzp, dmu_tx_t *tx); typedef void (*rz_zev_znode_write_cb_t)(znode_t *zp, dmu_tx_t *tx, uint64_t off, uint64_t len); typedef void (*rz_zev_znode_truncate_cb_t)(znode_t *zp, dmu_tx_t *tx, uint64_t off, uint64_t len); typedef void (*rz_zev_znode_setattr_cb_t)(znode_t *zp, dmu_tx_t *tx); typedef void (*rz_zev_znode_acl_cb_t)(znode_t *zp, dmu_tx_t *tx); typedef struct rz_zev_callbacks { /* zfsvfs events */ rz_zev_zfs_mount_cb_t rz_zev_zfs_mount; rz_zev_zfs_umount_cb_t rz_zev_zfs_umount; /* zvol zil events */ rz_zev_zvol_truncate_cb_t rz_zev_zvol_truncate; rz_zev_zvol_write_cb_t rz_zev_zvol_write; /* znode zil events */ rz_zev_znode_close_after_update_cb_t rz_zev_znode_close_after_update; rz_zev_znode_create_cb_t rz_zev_znode_create; rz_zev_znode_remove_cb_t rz_zev_znode_remove; rz_zev_znode_link_cb_t rz_zev_znode_link; rz_zev_znode_symlink_cb_t rz_zev_znode_symlink; rz_zev_znode_rename_cb_t rz_zev_znode_rename; rz_zev_znode_write_cb_t rz_zev_znode_write; rz_zev_znode_truncate_cb_t rz_zev_znode_truncate; rz_zev_znode_setattr_cb_t rz_zev_znode_setattr; rz_zev_znode_acl_cb_t rz_zev_znode_acl; } rz_zev_callbacks_t; extern rz_zev_callbacks_t *rz_zev_callbacks; /* in zfs_events.c */ extern rz_zev_callbacks_t *rz_zev_default_callbacks; /* in zfs_events.c */ extern krwlock_t rz_zev_rwlock; /* in zfs_events.c */ void rz_zev_init(void); void rz_zev_fini(void); boolean_t rz_zev_active(void); void rz_zev_set_active(boolean_t active); #endif #ifdef __cplusplus } #endif #endif /* _SYS_ZFS_EVENTS_H */