From ddedcf0a1f5f10af5e7c4d7d6a2cd08d8a587585 Mon Sep 17 00:00:00 2001 From: marcel Date: Sun, 2 Nov 2003 07:58:19 +0000 Subject: Turn Track_Aligned(), Prev_Track_Aligned(), Next_Track_Aligned(), Cyl_Aligned(), Prev_Cyl_Aligned() and Next_Cyl_Aligned() into tautologies on ia64. GPT removes all notion of tracks, heads and sectors per track, so there are no alignment considerations. --- lib/libdisk/rules.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/lib/libdisk/rules.c b/lib/libdisk/rules.c index 30e24a7..b725b32 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 } /* -- cgit v1.1