From owner-freebsd-alpha Sun Mar 25 17: 6:27 2001 Delivered-To: freebsd-alpha@freebsd.org Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.80]) by hub.freebsd.org (Postfix) with ESMTP id BE83937B718; Sun, 25 Mar 2001 17:06:24 -0800 (PST) (envelope-from grog@lemis.com) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id 5ADE56A90D; Mon, 26 Mar 2001 10:36:22 +0930 (CST) Date: Mon, 26 Mar 2001 10:36:22 +0930 From: Greg Lehey To: John Baldwin Cc: Mike Smith , freebsd-alpha@FreeBSD.org, leclercn@videotron.ca Subject: Re: dev_t size mismatch kernel / userland Message-ID: <20010326103622.H40349@wantadilla.lemis.com> References: <200103240509.f2O59L900618@mass.dis.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from jhb@FreeBSD.org on Fri, Mar 23, 2001 at 09:45:12PM -0800 Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.lemis.com/~grog X-PGP-Fingerprint: 6B 7B C3 8C 61 CD 54 AF 13 24 52 F8 6D A4 95 EF Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Friday, 23 March 2001 at 21:45:12 -0800, John Baldwin wrote: > > On 24-Mar-01 Mike Smith wrote: >>> Already tried vinum, works fine after modification of dev_t to >>> u_int64_t. I'll change it to uintptr_t tough (cleaner). Hope this gets >>> fixed! >> >> This is wrong. In the kernel or in a module, dev_t is an opaque type. >> In userspace, you use udev_t, not dev_t. >> >> It sounds like vinum is failing to perform the required conversions when >> exchanging a dev_t with userland, and the correct fix is going to be to >> add these. > > struct drive, struct plex, etc. are shared between userland and the kernel. It > looks like they need to use a udev_t, and the kernel will always have to do > udev2dev() before using them. Either that or don't export the structures to > userland. I already had code under way to export expurgated versions of these structs. But that's a separate issue. It seems to me that if dev_t is even visible in userland header files, it should be correct. We should either fix it or remove it. Greg -- Finger grog@lemis.com for PGP public key See complete headers for address and phone numbers To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message