From owner-cvs-sys Wed May 13 06:29:25 1998 Return-Path: Received: (from daemon@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA28100 for cvs-sys-outgoing; Wed, 13 May 1998 06:29:25 -0700 (PDT) (envelope-from owner-cvs-sys) Received: from godzilla.zeta.org.au (mothra.kralizec.net.au [203.15.68.22] (may be forged)) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA28035; Wed, 13 May 1998 06:28:50 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id XAA06754; Wed, 13 May 1998 23:25:21 +1000 Date: Wed, 13 May 1998 23:25:21 +1000 From: Bruce Evans Message-Id: <199805131325.XAA06754@godzilla.zeta.org.au> To: bde@FreeBSD.ORG, bde@zeta.org.au, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-sys@FreeBSD.ORG, luoqi@watermarkgroup.com Subject: Re: cvs commit: src/sys/i386/i386 autoconf.c src/sys/kern kern_shutdown.c Sender: owner-cvs-sys@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >I guess we could make SLICE code do that. But eventually we'd like to get >rid of dev_t all together, we have to find another way to figure out if >a disk partition is a swap partition. IMO, using disklabel is the correct >way (being a 'b' partition doesn't prevent user from creating a fs in it, >and being a non-'b' partition doesn't mean you can't use it as a swap). >It's just bad luck we couldn't retrieve disklabel during a dump. I don't want to use a disk label. I use a DOS partition (shared with Linux) for swap and dumps. I had to label it to get it to work under FreeBSD (except under SLICEd kernel which don't recognise labels on Linux swap partitions). The label sector is essentially read-only in Linux - the zero bits in it are interpeted as bad sectors, so I lose a little swap space under Linux :-). >I have a suggestion: since swap and dump code are the only consumers of >d_psize(), can we change d_psize to return disklabel instead (similar to >what DIOCGPART does)? This would also allow us to get rid of the DIOCGPART >kludge (ioctl should only be called from userland). If you think this is >doable, I can work out a patch for that. No, raw disks don't have labels, and labels are too large. DIOCGPART and d_maxio should be replaced by additional interfaces like d_psize() instead. Eventually the interfaces should be something like: #define d_psize(diskdevp) ((diskdevp)->d_psize) Bruce