diff options
| author | Marcel Moolenaar <marcel@FreeBSD.org> | 2003-11-02 07:58:19 +0000 |
|---|---|---|
| committer | Marcel Moolenaar <marcel@FreeBSD.org> | 2003-11-02 07:58:19 +0000 |
| commit | aff198c706a393afca0dd82b357a3b0928982350 (patch) | |
| tree | 86457ffa293736786f0513188feacc55d3d38030 /lib/libdisk | |
| parent | 4bd4fa3fe69b8003e0869cc4ed5f368226b2003d (diff) | |
Notes
Diffstat (limited to 'lib/libdisk')
| -rw-r--r-- | lib/libdisk/rules.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/lib/libdisk/rules.c b/lib/libdisk/rules.c index 30e24a78b196..b725b3225a04 100644 --- a/lib/libdisk/rules.c +++ b/lib/libdisk/rules.c @@ -26,59 +26,74 @@ __FBSDID("$FreeBSD$"); int Track_Aligned(const struct disk *d, u_long offset) { - +#ifndef __ia64__ if (!d->bios_sect) return 1; if (offset % d->bios_sect) return 0; +#endif /* __ia64__ */ return 1; } u_long Prev_Track_Aligned(const struct disk *d, u_long offset) { - +#ifndef __ia64__ if (!d->bios_sect) return offset; return (offset / d->bios_sect) * d->bios_sect; +#else + return 1; +#endif } u_long Next_Track_Aligned(const struct disk *d, u_long offset) { - +#ifndef __ia64__ if (!d->bios_sect) return offset; return Prev_Track_Aligned(d, offset + d->bios_sect-1); +#else + return 1; +#endif } static int Cyl_Aligned(const struct disk *d, u_long offset) { - +#ifndef __ia64__ if (!d->bios_sect || !d->bios_hd) return 1; if (offset % (d->bios_sect * d->bios_hd)) return 0; +#endif return 1; } u_long Prev_Cyl_Aligned(const struct disk *d, u_long offset) { - +#ifndef __ia64__ if (!d->bios_sect || !d->bios_hd) return offset; - return (offset / (d->bios_sect*d->bios_hd)) * d->bios_sect * d->bios_hd; + return (offset / (d->bios_sect * d->bios_hd)) * d->bios_sect * + d->bios_hd; +#else + return 1; +#endif } u_long Next_Cyl_Aligned(const struct disk *d, u_long offset) { - +#ifndef __ia64__ if (!d->bios_sect || !d->bios_hd) return offset; return Prev_Cyl_Aligned(d,offset + (d->bios_sect * d->bios_hd) - 1); +#else + return 1; +#endif } /* |
