From owner-freebsd-current@FreeBSD.ORG Tue Jul 11 12:46:45 2006 Return-Path: X-Original-To: freebsd-current@FreeBSD.ORG Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0F07F16A4E2 for ; Tue, 11 Jul 2006 12:46:45 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A2EB43D49 for ; Tue, 11 Jul 2006 12:46:43 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (urahsr@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k6BCkaoT074862 for ; Tue, 11 Jul 2006 14:46:41 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k6BCkauh074861; Tue, 11 Jul 2006 14:46:36 +0200 (CEST) (envelope-from olli) Date: Tue, 11 Jul 2006 14:46:36 +0200 (CEST) Message-Id: <200607111246.k6BCkauh074861@lurza.secnetix.de> From: Oliver Fromme To: freebsd-current@FreeBSD.ORG In-Reply-To: X-Newsgroups: list.freebsd-current User-Agent: tin/1.8.0-20051224 ("Ronay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Tue, 11 Jul 2006 14:46:41 +0200 (CEST) X-Mailman-Approved-At: Tue, 11 Jul 2006 13:02:16 +0000 Cc: Subject: Re: [RFC] mount can figure out fstype automatically X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-current@FreeBSD.ORG List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2006 12:46:45 -0000 Craig Rodrigues wrote: > Scott Long wrote: > > So in your opinion and experience, what are the pros and cons of > > maintaining a table of magic numbers? > > One con: every time you add a new filesystem, you need to update > mount(8). Not a big deal, but it is something. How about this idea: Every filesystem registers a piece of "magic information" somewhere (maybe kenv or sysctl, or even a file somewhere in /etc or whatever). Then mount(8) just has to look at that list, compare in turn with the device in question, and call the respective filesystem if found (if the mount fails even though the magic matched, mount(8) could print a warning and continue looking at the remaining filesystems' magics). If a new filesystem is added, it registers its magic as explained above. No need to update mount(8) itself. For the case where multiple filesystems can share their structures (like UDF + ISO9660), a priority code could be assigned, so that the filesystem that's "more useful" (or more popular) is probed first. Also, filesystems that are difficult to recognize (like FAT) would get a low priority code, so they are probed last. Note that the user can always override the selection by manually specifying the filesystem with the -t flag of mount(8), so there shouldn't be any regression. Just my 2 cents. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "Being really good at C++ is like being really good at using rocks to sharpen sticks." -- Thant Tessman