diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-06-06 17:15:15 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-06-06 17:15:15 +0000 |
commit | 64b0758a0244e515108eec4f2cd5d05a5939ebf1 (patch) | |
tree | e5e991586e626374ede95d07956bcaf6a47372be /sys/scsi | |
parent | a0f03208acbc7a85466c7cf68058959c1bbe9668 (diff) |
now that all partition size/offsets are potentially 64-bit, change the
type of all variables to daddr64_t. this includes the APIs for XXsize()
and XXdump(), all range checks inside bio drivers, internal variables
for disklabel handling, and even uvm's swap offsets. re-read numerous
times by otto, miod, krw, thib to look for errors
Diffstat (limited to 'sys/scsi')
-rw-r--r-- | sys/scsi/cd.c | 6 | ||||
-rw-r--r-- | sys/scsi/sd.c | 15 | ||||
-rw-r--r-- | sys/scsi/st.c | 4 |
3 files changed, 13 insertions, 12 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index 0eeffff87f2..68d9ebc92f5 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd.c,v 1.127 2007/06/05 00:38:23 deraadt Exp $ */ +/* $OpenBSD: cd.c,v 1.128 2007/06/06 17:15:14 deraadt Exp $ */ /* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */ /* @@ -1636,7 +1636,7 @@ cd_get_parms(struct cd_softc *cd, int flags) return (0); } -int +daddr64_t cdsize(dev_t dev) { @@ -1645,7 +1645,7 @@ cdsize(dev_t dev) } int -cddump(dev_t dev, daddr_t blkno, caddr_t va, size_t size) +cddump(dev_t dev, daddr64_t blkno, caddr_t va, size_t size) { /* Not implemented. */ return ENXIO; diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index d7cb2e9f19e..f8e99c19be9 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.130 2007/06/05 00:38:23 deraadt Exp $ */ +/* $OpenBSD: sd.c,v 1.131 2007/06/06 17:15:14 deraadt Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -597,7 +597,8 @@ sdstart(void *v) struct scsi_rw_16 cmd_16; struct scsi_rw cmd_small; struct scsi_generic *cmdp; - int blkno, nblks, cmdlen, error; + int64_t blkno; + int nblks, cmdlen, error; struct partition *p; SC_DEBUG(sc_link, SDEV_DB2, ("sdstart\n")); @@ -1138,12 +1139,12 @@ sd_interpret_sense(struct scsi_xfer *xs) return (retval); } -int +daddr64_t sdsize(dev_t dev) { struct sd_softc *sd; int part, omask; - int size; + int64_t size; sd = sdlookup(DISKUNIT(dev)); if (sd == NULL) @@ -1180,14 +1181,14 @@ static int sddoingadump; * at offset 'dumplo' into the partition. */ int -sddump(dev_t dev, daddr_t blkno, caddr_t va, size_t size) +sddump(dev_t dev, daddr64_t blkno, caddr_t va, size_t size) { struct sd_softc *sd; /* disk unit to do the I/O */ struct disklabel *lp; /* disk's disklabel */ int unit, part; int sectorsize; /* size of a disk sector */ - int nsects; /* number of sectors in partition */ - int sectoff; /* sector offset of partition */ + daddr64_t nsects; /* number of sectors in partition */ + daddr64_t sectoff; /* sector offset of partition */ int totwrt; /* total number of sectors left to write */ int nwrt; /* current number of sectors to write */ struct scsi_rw_big cmd; /* write command */ diff --git a/sys/scsi/st.c b/sys/scsi/st.c index a772f117b55..f22849567a1 100644 --- a/sys/scsi/st.c +++ b/sys/scsi/st.c @@ -1,4 +1,4 @@ -/* $OpenBSD: st.c,v 1.74 2007/06/01 18:44:48 krw Exp $ */ +/* $OpenBSD: st.c,v 1.75 2007/06/06 17:15:14 deraadt Exp $ */ /* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */ /* @@ -2035,7 +2035,7 @@ bad: free(buf, M_TEMP); int stdump(dev, blkno, va, size) dev_t dev; - int blkno; + daddr64_t blkno; caddr_t va; size_t size; { |