From owner-freebsd-current Mon Sep 25 9:52:16 2000 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 27E4537B42C; Mon, 25 Sep 2000 09:52:01 -0700 (PDT) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.8.7/8.8.7) with ESMTP id DAA02156; Tue, 26 Sep 2000 03:51:56 +1100 Date: Tue, 26 Sep 2000 03:51:51 +1100 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Adrian Chadd Cc: freebsd-fs@freebsd.org, freebsd-current@freebsd.org Subject: Re: Fsck wrappers, revisited In-Reply-To: <20000923114434.A4419@roaming.cacheboy.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 23 Sep 2000, Adrian Chadd wrote: > On Sat, Sep 23, 2000, Bruce Evans wrote: > > On Sat, 23 Dec 2000, Adrian Chadd wrote: > > > > > Here's the patch: > > > > > > --- fsck.c.orig Sat Dec 23 11:13:30 2000 > > > +++ fsck.c Sat Dec 23 11:13:34 2000 > > > @@ -501,7 +501,7 @@ > > > errx(1, "partition `%s' is not of a legal vfstype", > > > str); > > > - if ((vfstype = dktypenames[t]) == NULL) > > > + if ((vfstype = fstypenames[t]) == NULL) > > > errx(1, "vfstype `%s' on partition `%s' is not supported", > > > fstypenames[t], str); > > > > > > > > > So now is a problem which I'm sure the NetBSD people came up against. > > > The fstypenames are names like 4.2BSD, vinum, ISO9660, etc. NetBSD fixed > > > this by creating a new list 'mountnames[]', which maps the fs type to > > > a string. > > > > fs typenames are already strings in FreeBSD (the kernel's vfc_index is an > > implementation detail which should not be visible in applications). > > Oh, wait. I understand what you're talking about now. There isn't any mapping > to partition type (p_fstype) to fs typename string. > > > > http://cvsweb.netbsd.org/bsdweb.cgi/syssrc/sys/sys/disklabel.h.diff?r1=1.60&r2=1.61 > > > > > > What do people think about doing this as well? It would certainly make things > > > a little tidier, but every time a new fs comes in the magic autodetection code > > > will need to be updated (if appropriate, of course.) > > > > This would be a bug. > > Well, if you have any suggestions, I'm all for it. :-) I don't understand the problem. You get the filesystem type name (fstypename) from fs_vfstype in struct fstab or from f_fstypename in struct statfs. You attempt to execute strcat("/sbin/fsck_", fstypename) to see if fsck is supported on filesystems of type fstypename. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message