summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_disklabel.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-07-28 18:25:51 +0000
committerbde <bde@FreeBSD.org>1998-07-28 18:25:51 +0000
commit0c1764387cef9f99af21a47fa453917fa3072468 (patch)
tree64bb61e1d9791c796b156e94fb88fbea2fbfaaed /sys/kern/subr_disklabel.c
parent959a234634b39d656cfb802c3ab919c07e287f69 (diff)
downloadFreeBSD-src-0c1764387cef9f99af21a47fa453917fa3072468.zip
FreeBSD-src-0c1764387cef9f99af21a47fa453917fa3072468.tar.gz
Used daddr_t's, not ints, to store disk block numbers. Updated printf
formats and args to match. Fixed old printf format errors (all related; most were hidden by calling printf indirectly). This change somehow avoids compiler bugs for 64-bit longs on i386's, although it increases the number of 64-bit calculations.
Diffstat (limited to 'sys/kern/subr_disklabel.c')
-rw-r--r--sys/kern/subr_disklabel.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/kern/subr_disklabel.c b/sys/kern/subr_disklabel.c
index 96f822e..de42e86 100644
--- a/sys/kern/subr_disklabel.c
+++ b/sys/kern/subr_disklabel.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94
- * $Id: ufs_disksubr.c,v 1.33 1997/11/07 08:53:36 phk Exp $
+ * $Id: ufs_disksubr.c,v 1.34 1998/02/20 13:37:40 bde Exp $
*/
#include <sys/param.h>
@@ -344,7 +344,7 @@ diskerr(bp, dname, what, pri, blkdone, lp)
register int (*pr) __P((const char *, ...));
char partname[2];
char *sname;
- int sn;
+ daddr_t sn;
if (pri != LOG_PRINTF) {
log(pri, "");
@@ -356,14 +356,14 @@ diskerr(bp, dname, what, pri, blkdone, lp)
bp->b_flags & B_READ ? "read" : "writ");
sn = bp->b_blkno;
if (bp->b_bcount <= DEV_BSIZE)
- (*pr)("%d", sn);
+ (*pr)("%ld", (long)sn);
else {
if (blkdone >= 0) {
sn += blkdone;
- (*pr)("%d of ", sn);
+ (*pr)("%ld of ", (long)sn);
}
- (*pr)("%d-%d", bp->b_blkno,
- bp->b_blkno + (bp->b_bcount - 1) / DEV_BSIZE);
+ (*pr)("%ld-%ld", (long)bp->b_blkno,
+ (long)(bp->b_blkno + (bp->b_bcount - 1) / DEV_BSIZE));
}
if (lp && (blkdone >= 0 || bp->b_bcount <= lp->d_secsize)) {
#ifdef tahoe
@@ -377,8 +377,10 @@ diskerr(bp, dname, what, pri, blkdone, lp)
* independent of slices, labels and bad sector remapping,
* but some drivers don't set bp->b_pblkno.
*/
- (*pr)(" (%s bn %d; cn %d", sname, sn, sn / lp->d_secpercyl);
- sn %= lp->d_secpercyl;
- (*pr)(" tn %d sn %d)", sn / lp->d_nsectors, sn % lp->d_nsectors);
+ (*pr)(" (%s bn %ld; cn %ld", sname, (long)sn,
+ (long)(sn / lp->d_secpercyl));
+ sn %= (long)lp->d_secpercyl;
+ (*pr)(" tn %ld sn %ld)", (long)(sn / lp->d_nsectors),
+ (long)(sn % lp->d_nsectors));
}
}
OpenPOWER on IntegriCloud