From b8403d582b6d6134a7b99da33ac7bace467d4515 Mon Sep 17 00:00:00 2001 From: cgd Date: Sat, 18 Mar 1995 07:22:43 +0000 Subject: [PATCH] don't be so quick to cast macro arguments to unsigned; if the arguments are really off_t's (e.g. to btodb), then you can lose information. This was the "> 4G file systems don't work" bug; physio uses btodb, which was broken. --- sys/arch/alpha/include/param.h | 6 +++--- sys/arch/amiga/include/param.h | 6 +++--- sys/arch/da30/include/param.h | 6 +++--- sys/arch/hp300/include/param.h | 6 +++--- sys/arch/i386/include/param.h | 6 +++--- sys/arch/mac68k/include/param.h | 6 +++--- sys/arch/pc532/include/param.h | 6 +++--- sys/arch/pmax/include/param.h | 6 +++--- sys/arch/sparc/include/param.h | 6 +++--- sys/arch/sun3/include/param.h | 6 +++--- sys/arch/sun3/include/param3.h | 6 +++--- sys/arch/vax/include/param.h | 6 +++--- 12 files changed, 36 insertions(+), 36 deletions(-) diff --git a/sys/arch/alpha/include/param.h b/sys/arch/alpha/include/param.h index fbbc0f7286af..0d889a2ec9f9 100644 --- a/sys/arch/alpha/include/param.h +++ b/sys/arch/alpha/include/param.h @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.1 1995/02/13 23:07:42 cgd Exp $ */ +/* $NetBSD: param.h,v 1.2 1995/03/18 07:22:43 cgd Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -131,9 +131,9 @@ #define btoc(x) (((unsigned long)(x)+(NBPG-1))>>PGSHIFT) #define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ - ((unsigned long)(bytes) >> DEV_BSHIFT) + ((bytes) >> DEV_BSHIFT) #define dbtob(db) /* calculates (db * DEV_BSIZE) */ \ - ((unsigned long)(db) << DEV_BSHIFT) + ((db) << DEV_BSHIFT) /* * Map a ``block device block'' to a file system block. diff --git a/sys/arch/amiga/include/param.h b/sys/arch/amiga/include/param.h index 03b9a5327d07..4f3c18609f1f 100644 --- a/sys/arch/amiga/include/param.h +++ b/sys/arch/amiga/include/param.h @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.17 1995/02/12 19:19:38 chopps Exp $ */ +/* $NetBSD: param.h,v 1.18 1995/03/18 07:22:51 cgd Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -126,9 +126,9 @@ #define btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT) #define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ - ((unsigned)(bytes) >> DEV_BSHIFT) + ((bytes) >> DEV_BSHIFT) #define dbtob(db) /* calculates (db * DEV_BSIZE) */ \ - ((unsigned)(db) << DEV_BSHIFT) + ((db) << DEV_BSHIFT) /* * Map a ``block device block'' to a file system block. diff --git a/sys/arch/da30/include/param.h b/sys/arch/da30/include/param.h index 46ce2f982e4c..0018a38bdf78 100644 --- a/sys/arch/da30/include/param.h +++ b/sys/arch/da30/include/param.h @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.7 1994/10/26 02:33:46 cgd Exp $ */ +/* $NetBSD: param.h,v 1.8 1995/03/18 07:22:57 cgd Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -122,9 +122,9 @@ #define btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT) #define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ - ((unsigned)(bytes) >> DEV_BSHIFT) + ((bytes) >> DEV_BSHIFT) #define dbtob(db) /* calculates (db * DEV_BSIZE) */ \ - ((unsigned)(db) << DEV_BSHIFT) + ((db) << DEV_BSHIFT) /* * Map a ``block device block'' to a file system block. diff --git a/sys/arch/hp300/include/param.h b/sys/arch/hp300/include/param.h index 617c25bff70e..2f2a018025f7 100644 --- a/sys/arch/hp300/include/param.h +++ b/sys/arch/hp300/include/param.h @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.18 1995/03/05 22:06:42 mycroft Exp $ */ +/* $NetBSD: param.h,v 1.19 1995/03/18 07:23:09 cgd Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -119,8 +119,8 @@ #define btoc(x) (((unsigned)(x) + PGOFSET) >> PGSHIFT) /* bytes to disk blocks */ -#define dbtob(x) ((unsigned)(x) << DEV_BSHIFT) -#define btodb(x) ((unsigned)(x) >> DEV_BSHIFT) +#define dbtob(x) ((x) << DEV_BSHIFT) +#define btodb(x) ((x) >> DEV_BSHIFT) /* * Map a ``block device block'' to a file system block. diff --git a/sys/arch/i386/include/param.h b/sys/arch/i386/include/param.h index 20b1fad7901f..6eca45929d61 100644 --- a/sys/arch/i386/include/param.h +++ b/sys/arch/i386/include/param.h @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.23 1994/10/27 04:16:12 cgd Exp $ */ +/* $NetBSD: param.h,v 1.24 1995/03/18 07:23:26 cgd Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -122,8 +122,8 @@ #define btoc(x) (((unsigned)(x) + PGOFSET) >> PGSHIFT) /* bytes to disk blocks */ -#define dbtob(x) ((unsigned)(x) << DEV_BSHIFT) -#define btodb(x) ((unsigned)(x) >> DEV_BSHIFT) +#define dbtob(x) ((x) << DEV_BSHIFT) +#define btodb(x) ((x) >> DEV_BSHIFT) /* * Map a ``block device block'' to a file system block. diff --git a/sys/arch/mac68k/include/param.h b/sys/arch/mac68k/include/param.h index 9f249012b277..3bd5e19a594e 100644 --- a/sys/arch/mac68k/include/param.h +++ b/sys/arch/mac68k/include/param.h @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.14 1994/11/01 03:53:28 briggs Exp $ */ +/* $NetBSD: param.h,v 1.15 1995/03/18 07:23:33 cgd Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -171,9 +171,9 @@ #define btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT) #define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ - ((unsigned)(bytes) >> DEV_BSHIFT) + ((bytes) >> DEV_BSHIFT) #define dbtob(db) /* calculates (db * DEV_BSIZE) */ \ - ((unsigned)(db) << DEV_BSHIFT) + ((db) << DEV_BSHIFT) /* * Map a ``block device block'' to a file system block. diff --git a/sys/arch/pc532/include/param.h b/sys/arch/pc532/include/param.h index fca982541d13..545357518858 100644 --- a/sys/arch/pc532/include/param.h +++ b/sys/arch/pc532/include/param.h @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.9 1994/12/05 19:27:20 phil Exp $ */ +/* $NetBSD: param.h,v 1.10 1995/03/18 07:23:39 cgd Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -139,9 +139,9 @@ #define btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT) #define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ - ((unsigned)(bytes) >> DEV_BSHIFT) + ((bytes) >> DEV_BSHIFT) #define dbtob(db) /* calculates (db * DEV_BSIZE) */ \ - ((unsigned)(db) << DEV_BSHIFT) + ((db) << DEV_BSHIFT) /* diff --git a/sys/arch/pmax/include/param.h b/sys/arch/pmax/include/param.h index edee55b06b1c..082857f6c4ea 100644 --- a/sys/arch/pmax/include/param.h +++ b/sys/arch/pmax/include/param.h @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.7 1994/11/28 18:45:39 dean Exp $ */ +/* $NetBSD: param.h,v 1.8 1995/03/18 07:23:44 cgd Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -126,9 +126,9 @@ #define btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT) #define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ - ((unsigned)(bytes) >> DEV_BSHIFT) + ((bytes) >> DEV_BSHIFT) #define dbtob(db) /* calculates (db * DEV_BSIZE) */ \ - ((unsigned)(db) << DEV_BSHIFT) + ((db) << DEV_BSHIFT) /* * Map a ``block device block'' to a file system block. diff --git a/sys/arch/sparc/include/param.h b/sys/arch/sparc/include/param.h index 3429b99a1b7a..1b322dbf65f5 100644 --- a/sys/arch/sparc/include/param.h +++ b/sys/arch/sparc/include/param.h @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.11 1995/02/01 12:37:46 pk Exp $ */ +/* $NetBSD: param.h,v 1.12 1995/03/18 07:23:49 cgd Exp $ */ /* * Copyright (c) 1992, 1993 @@ -149,9 +149,9 @@ extern int nbpg, pgofset, pgshift; #define btoc(x) (((unsigned)(x) + PGOFSET) >> PGSHIFT) #define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ - ((unsigned)(bytes) >> DEV_BSHIFT) + ((bytes) >> DEV_BSHIFT) #define dbtob(db) /* calculates (db * DEV_BSIZE) */ \ - ((unsigned)(db) << DEV_BSHIFT) + ((db) << DEV_BSHIFT) /* * Map a ``block device block'' to a file system block. diff --git a/sys/arch/sun3/include/param.h b/sys/arch/sun3/include/param.h index 1c23c95ca630..fcc3f73f913b 100644 --- a/sys/arch/sun3/include/param.h +++ b/sys/arch/sun3/include/param.h @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.23 1994/11/28 19:13:18 gwr Exp $ */ +/* $NetBSD: param.h,v 1.24 1995/03/18 07:23:54 cgd Exp $ */ /* * Copyright (c) 1994 Gordon W. Ross @@ -124,9 +124,9 @@ #define btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT) #define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ - ((unsigned)(bytes) >> DEV_BSHIFT) + ((bytes) >> DEV_BSHIFT) #define dbtob(db) /* calculates (db * DEV_BSIZE) */ \ - ((unsigned)(db) << DEV_BSHIFT) + ((db) << DEV_BSHIFT) /* * Map a ``block device block'' to a file system block. diff --git a/sys/arch/sun3/include/param3.h b/sys/arch/sun3/include/param3.h index a1f1c0de9579..a0eb75514198 100644 --- a/sys/arch/sun3/include/param3.h +++ b/sys/arch/sun3/include/param3.h @@ -1,4 +1,4 @@ -/* $NetBSD: param3.h,v 1.23 1994/11/28 19:13:18 gwr Exp $ */ +/* $NetBSD: param3.h,v 1.24 1995/03/18 07:23:54 cgd Exp $ */ /* * Copyright (c) 1994 Gordon W. Ross @@ -124,9 +124,9 @@ #define btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT) #define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ - ((unsigned)(bytes) >> DEV_BSHIFT) + ((bytes) >> DEV_BSHIFT) #define dbtob(db) /* calculates (db * DEV_BSIZE) */ \ - ((unsigned)(db) << DEV_BSHIFT) + ((db) << DEV_BSHIFT) /* * Map a ``block device block'' to a file system block. diff --git a/sys/arch/vax/include/param.h b/sys/arch/vax/include/param.h index d972113e0a9d..91744c736a1e 100644 --- a/sys/arch/vax/include/param.h +++ b/sys/arch/vax/include/param.h @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.5 1995/02/13 00:43:26 ragge Exp $ */ +/* $NetBSD: param.h,v 1.6 1995/03/18 07:24:01 cgd Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -145,9 +145,9 @@ #define btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT) #define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ - ((unsigned)(bytes) >> DEV_BSHIFT) + ((bytes) >> DEV_BSHIFT) #define dbtob(db) /* calculates (db * DEV_BSIZE) */ \ - ((unsigned)(db) << DEV_BSHIFT) + ((db) << DEV_BSHIFT) /* * Map a ``block device block'' to a file system block.