summaryrefslogtreecommitdiffstats
path: root/sys/dev/raidframe/rf_utils.h
diff options
context:
space:
mode:
authorpeter <peter@openbsd.org>1999-08-03 13:56:37 +0000
committerpeter <peter@openbsd.org>1999-08-03 13:56:37 +0000
commit8eb9529b4671d09f26ac73b9d58096f3c134e333 (patch)
treec89e941dd1baed0417e1f6ced6932a9f3bb9b077 /sys/dev/raidframe/rf_utils.h
parentReturn an open failure if the fstab is zero length or not a regular file. (diff)
downloadwireguard-openbsd-8eb9529b4671d09f26ac73b9d58096f3c134e333.tar.xz
wireguard-openbsd-8eb9529b4671d09f26ac73b9d58096f3c134e333.zip
* rf_reconstruct.c: adopt nilkas' suggestion regard statics and
__inline__ - this is a proof of concept and will cover the raidframe source as a whole over coming updates. Update namespace of function to prefix with rf_ - comments again welcome. * overall: rework the macros in rf_etimer.h and the resultant changes to their use to count microseconds and not clock ticks. Restore the code in rf_revent.c to a similar strcuture to before the previous commit, and use the system timers to govern resource usage. Tested with local i386/IDE and the reconstruction of a disk in my array - performance has improved for reconstruction at no noticable CPU cost.
Diffstat (limited to 'sys/dev/raidframe/rf_utils.h')
-rw-r--r--sys/dev/raidframe/rf_utils.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/raidframe/rf_utils.h b/sys/dev/raidframe/rf_utils.h
index fb53ecd9719..1e5a9d3e872 100644
--- a/sys/dev/raidframe/rf_utils.h
+++ b/sys/dev/raidframe/rf_utils.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rf_utils.h,v 1.2 1999/02/16 00:03:33 niklas Exp $ */
+/* $OpenBSD: rf_utils.h,v 1.3 1999/08/03 13:56:38 peter Exp $ */
/* $NetBSD: rf_utils.h,v 1.3 1999/02/05 00:06:18 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
@@ -52,6 +52,7 @@ int rf_atoi(char *p);
int rf_htoi(char *p);
#define RF_USEC_PER_SEC 1000000
+#define RF_TIMEVAL_TO_US(_t_) (((_t_).tv_sec) * RF_USEC_PER_SEC + (_t_).tv_usec)
#define RF_TIMEVAL_DIFF(_start_,_end_,_diff_) { \
if ((_end_)->tv_usec < (_start_)->tv_usec) { \
(_diff_)->tv_usec = ((_end_)->tv_usec + RF_USEC_PER_SEC) \