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.
This commit is contained in:
Marcel Moolenaar 2003-11-02 07:58:19 +00:00
parent 4bd4fa3fe6
commit aff198c706

View File

@ -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
}
/*