From 27424f98f99646fb8b3e4ef11652da62014a7ceb Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Tue, 5 Jun 2007 00:38:25 +0000 Subject: use six new macros to access & store the 48-bit disklabel fields related to size. tested on almost all machines, double checked by miod and krw next comes the type handling surrounding these values --- sys/compat/linux/linux_hdio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/compat/linux/linux_hdio.c') diff --git a/sys/compat/linux/linux_hdio.c b/sys/compat/linux/linux_hdio.c index 8e4704ccb40..4eb2edba747 100644 --- a/sys/compat/linux/linux_hdio.c +++ b/sys/compat/linux/linux_hdio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_hdio.c,v 1.5 2002/03/14 01:26:50 millert Exp $ */ +/* $OpenBSD: linux_hdio.c,v 1.6 2007/06/05 00:38:20 deraadt Exp $ */ /* $NetBSD: linux_hdio.c,v 1.1 2000/12/10 14:12:17 fvdl Exp $ */ /* @@ -130,7 +130,7 @@ linux_ioctl_hdio(struct proc *p, struct linux_sys_ioctl_args *uap, break; } labp = error != 0 ? &label : partp.disklab; - hdg.start = error1 != 0 ? partp.part->p_offset : 0; + hdg.start = error1 != 0 ? DL_GETPOFFSET(partp.part) & 0x7fffffff: 0; hdg.heads = labp->d_ntracks; hdg.cylinders = labp->d_ncylinders; hdg.sectors = labp->d_nsectors; @@ -148,7 +148,7 @@ linux_ioctl_hdio(struct proc *p, struct linux_sys_ioctl_args *uap, break; } labp = error != 0 ? &label : partp.disklab; - hdg_big.start = error1 != 0 ? partp.part->p_offset : 0; + hdg_big.start = error1 != 0 ? DL_GETPOFFSET(partp.part) & 0x7fffffff : 0; hdg_big.heads = labp->d_ntracks; hdg_big.cylinders = labp->d_ncylinders; hdg_big.sectors = labp->d_nsectors; -- cgit v1.2.3