From owner-freebsd-hackers Tue Feb 5 19:15: 6 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from falcon.prod.itd.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by hub.freebsd.org (Postfix) with ESMTP id 943A937B417; Tue, 5 Feb 2002 19:15:01 -0800 (PST) Received: from pool0362.cvx40-bradley.dialup.earthlink.net ([216.244.43.107] helo=mindspring.com) by falcon.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16YIY0-0000li-00; Tue, 05 Feb 2002 19:15:00 -0800 Message-ID: <3C609FAE.9B4B4EA1@mindspring.com> Date: Tue, 05 Feb 2002 19:14:54 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Yar Tikhiy Cc: "M. Warner Losh" , hackers@FreeBSD.ORG Subject: Re: Get disk device size? References: <20020205125557.A10266@comp.chem.msu.su> <20020205.093006.104650505.imp@village.org> <20020206022029.A95467@comp.chem.msu.su> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Yar Tikhiy wrote: > Thanks, the DIOCGDINFO ioctl is nearly what I was looking for. > > However, there seems to be a number of problems (or my misunderstandings?) > about it. This ioctl can't be used against non-BSD slices; it > fails on them with EINVAL due to code in kern/subr_diskslice.c. > OTOH, invoking this ioctl on a partition (e.g. ad0s1a) will result > in the parameters of the whole slice/disk (i.e. ad0s1.) Isn't all > that a bit inconsistent? E.g. a filesystem layer doesn't need to > distinguish between say ad0, ad0s1, and ad0s1a -- they're just > disk devices for it. Or did I miss any important point? You missed the fact that there is not a uniform kernel API for manipulating disk space. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message