diff options
author | jhb <jhb@FreeBSD.org> | 2004-03-16 17:07:06 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2004-03-16 17:07:06 +0000 |
commit | b7e56e9eea26be625659f4a99d9094c501a0a3bc (patch) | |
tree | 5aa997ef67b14b420649f8ea11a120707fde3633 /lib/libdisk/create_chunk.c | |
parent | 662b843050ffa69c81e8bd9be635806f6abd5739 (diff) | |
download | FreeBSD-src-b7e56e9eea26be625659f4a99d9094c501a0a3bc.zip FreeBSD-src-b7e56e9eea26be625659f4a99d9094c501a0a3bc.tar.gz |
Change libdisk and sysinstall to use d_addr_t rather than u_long for disk
addresses. For arch's with 64-bit longs, this is a nop, but for i386 this
allows sysinstall to properly handle disks and filesystems > 1 TB.
Changes from the original patch include:
- Use d_addr_t rather than inventing a blkcnt type based on int64_t.
- Use strtoimax() rather than strtoull() to parse d_addr_t's from config
files.
- Use intmax_t casts and %jd rather than %llu to printf d_addr_t values.
Tested on: i386
Tested by: kuriyama
Submitted by: julian
MFC after: 1 month
Diffstat (limited to 'lib/libdisk/create_chunk.c')
-rw-r--r-- | lib/libdisk/create_chunk.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libdisk/create_chunk.c b/lib/libdisk/create_chunk.c index d3625b9..c65b8f3 100644 --- a/lib/libdisk/create_chunk.c +++ b/lib/libdisk/create_chunk.c @@ -194,14 +194,14 @@ Fixup_Names(struct disk *d) } int -Create_Chunk(struct disk *d, u_long offset, u_long size, chunk_e type, +Create_Chunk(struct disk *d, daddr_t offset, daddr_t size, chunk_e type, int subtype, u_long flags, const char *sname) { int i; #ifndef __ia64__ if (!(flags & CHUNK_FORCE_ALL)) { - u_long l; + daddr_t l; #ifdef PC98 /* Never use the first cylinder */ if (!offset) { @@ -217,7 +217,7 @@ Create_Chunk(struct disk *d, u_long offset, u_long size, chunk_e type, #endif /* PC98 */ /* Always end on cylinder boundary */ - l = (offset+size) % (d->bios_sect * d->bios_hd); + l = (offset + size) % (d->bios_sect * d->bios_hd); size -= l; } #endif @@ -228,12 +228,12 @@ Create_Chunk(struct disk *d, u_long offset, u_long size, chunk_e type, } struct chunk * -Create_Chunk_DWIM(struct disk *d, struct chunk *parent, u_long size, +Create_Chunk_DWIM(struct disk *d, struct chunk *parent, daddr_t size, chunk_e type, int subtype, u_long flags) { int i; struct chunk *c1; - long offset; + daddr_t offset; if (!parent) parent = d->chunks; |