diff options
author | gibbs <gibbs@FreeBSD.org> | 1999-04-07 22:57:48 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 1999-04-07 22:57:48 +0000 |
commit | 71072fc11358b4c222da690ee5866cc00f1a8fe3 (patch) | |
tree | 4a033fb4ddaf6f21087caaa4afb9d6905a2eecb2 /sys/cam/cam.h | |
parent | 9e60b40925fe4dbc882d66c232811d1366a442c1 (diff) | |
download | FreeBSD-src-71072fc11358b4c222da690ee5866cc00f1a8fe3.zip FreeBSD-src-71072fc11358b4c222da690ee5866cc00f1a8fe3.tar.gz |
Remove camq_regen(). We already perform modular comparisons
for generation counts, so no further steps to deal with generation
count wrap are required.
Fix an off by one problem in the camq heap code.
Diffstat (limited to 'sys/cam/cam.h')
-rw-r--r-- | sys/cam/cam.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/cam/cam.h b/sys/cam/cam.h index 21aea02..c182fd6 100644 --- a/sys/cam/cam.h +++ b/sys/cam/cam.h @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: cam.h,v 1.1 1998/09/15 06:33:23 gibbs Exp $ */ #ifndef _CAM_CAM_H @@ -74,6 +74,17 @@ typedef struct { #define CAM_DONEQ_INDEX -3 } cam_pinfo; +/* + * Macro to compare two generation numbers. It is used like this: + * + * if (GENERATIONCMP(a, >=, b)) + * ...; + * + * GERERATIONCMP uses modular arithmetic to guard against wraps + * wraps in the generation number. + */ +#define GENERATIONCMP(x, op, y) ((int32_t)((x) - (y)) op 0) + /* CAM flags */ typedef enum { CAM_FLAG_NONE = 0x00, |