aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/sys/vdev_impl.h2
-rw-r--r--include/sys/zfs_ratelimit.h12
2 files changed, 9 insertions, 5 deletions
diff --git a/include/sys/vdev_impl.h b/include/sys/vdev_impl.h
index bb80899e9..2ad3510ea 100644
--- a/include/sys/vdev_impl.h
+++ b/include/sys/vdev_impl.h
@@ -262,8 +262,6 @@ struct vdev {
* We rate limit ZIO delay and ZIO checksum events, since they
* can flood ZED with tons of events when a drive is acting up.
*/
-#define DELAYS_PER_SECOND 5
-#define CHECKSUMS_PER_SECOND 5
zfs_ratelimit_t vdev_delay_rl;
zfs_ratelimit_t vdev_checksum_rl;
};
diff --git a/include/sys/zfs_ratelimit.h b/include/sys/zfs_ratelimit.h
index f36e07841..012825fad 100644
--- a/include/sys/zfs_ratelimit.h
+++ b/include/sys/zfs_ratelimit.h
@@ -25,13 +25,19 @@
typedef struct {
hrtime_t start;
unsigned int count;
- unsigned int burst; /* Number to allow per interval */
- unsigned int interval; /* Interval length in seconds */
+
+ /*
+ * Pointer to number of events per interval. We do this to
+ * allow the burst to be a (changeable) module parameter.
+ */
+ unsigned int *burst;
+
+ unsigned int interval; /* Interval length in seconds */
kmutex_t lock;
} zfs_ratelimit_t;
int zfs_ratelimit(zfs_ratelimit_t *rl);
-void zfs_ratelimit_init(zfs_ratelimit_t *rl, unsigned int burst,
+void zfs_ratelimit_init(zfs_ratelimit_t *rl, unsigned int *burst,
unsigned int interval);
void zfs_ratelimit_fini(zfs_ratelimit_t *rl);