From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 27 21:30:46 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 496811065670 for ; Wed, 27 Jan 2010 21:30:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 07F708FC12 for ; Wed, 27 Jan 2010 21:30:46 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 9A16046B38; Wed, 27 Jan 2010 16:30:45 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id D20FD8A01F; Wed, 27 Jan 2010 16:30:44 -0500 (EST) From: John Baldwin To: Fernando =?iso-8859-1?q?Apestegu=EDa?= Date: Wed, 27 Jan 2010 16:10:33 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20100120; KDE/4.3.1; amd64; ; ) References: <1bd550a01001080919p20ec1b20t82b3761705cd1ff3@mail.gmail.com> <201001270856.24324.jhb@freebsd.org> <1bd550a01001271232r3131a00ci8cf08e0a4ff21816@mail.gmail.com> In-Reply-To: <1bd550a01001271232r3131a00ci8cf08e0a4ff21816@mail.gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201001271610.33621.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 27 Jan 2010 16:30:44 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] linprocfs dofilesystems X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2010 21:30:46 -0000 On Wednesday 27 January 2010 3:32:17 pm Fernando Apestegu=EDa wrote: > 2010/1/27 John Baldwin : > > On Tuesday 26 January 2010 4:52:35 pm Fernando Apestegu=EDa wrote: > >> 2010/1/15 John Baldwin : > >> > On Friday 08 January 2010 12:19:29 pm Fernando Apestegu=EDa wrote: > >> >> Hi all, > >> >> > >> >> This patch implements the "filesystems" file in the linux proc fs. > >> >> I have used it for some time without seeing any problems. Let me > >> >> know in case this is useful. > >> >> > >> >> Tested against 8.0-RELEASE-p1 > >> > > >> > This patch is not correct. It seems that /proc/filesystems is a lis= t of > >> > available filesystems, not a list of mounted filesystems. E.g.: > >> > > >> >> cat /proc/filesystems > >> > nodev sysfs > >> > nodev rootfs > >> > nodev bdev > >> > nodev proc > >> > nodev sockfs > >> > nodev binfmt_misc > >> > nodev usbfs > >> > nodev usbdevfs > >> > nodev futexfs > >> > nodev tmpfs > >> > nodev pipefs > >> > nodev eventpollfs > >> > nodev devpts > >> > ext2 > >> > nodev ramfs > >> > nodev hugetlbfs > >> > iso9660 > >> > nodev relayfs > >> > nodev mqueue > >> > ext3 > >> > nodev rpc_pipefs > >> > nodev nfs > >> > nodev nfs4 > >> > nodev autofs > >> > > >> > To do the same thing in FreeBSD you would need to walk the vfsconf l= ist > >> > instead. However, I'm not sure it is worth it to add this unless th= ere > >> > are apps people commonly use that need it. > >> > >> You are right. I have another patch to do the right thing. However as > >> you pointed > >> out maybe it is not useful after all. Is it possible to delete the PR? > >> > >> Sorry for the noise > >> > >> PS: My current patch does not distinguish between common filesystems > >> and pseudo filesystems, where could I find that info? > >> > >> Cheers > > > > Hmm, I'm not sure if there is an easy way to distinguish psuedo filesys= tems > > from device-backed filesystems. Hmm, maybe the VFCF_SYNTHETIC flag? If > > you have an updated patch I'm ok with reviewing it. What programs are = you > > using that use this file in linprocfs? >=20 > I don't need the file right now. I did it for completeness although it > could help to > procinfo[1] gsysinfo[2] and a personal application I wrote some time ago[= 3]. > I am not a kernel developer, but I found this interesting as an exercise. > That is the main reason I tried to implement this file. >=20 > The new patch is attached. VFCF_SYNTHETIC seems to work fine as this patc= h shows > in my system: >=20 > $ cat /compat/linux/proc/filesystems > nodev procfs > cd9660 > nfs > nodev devfs > ufs > msdosfs > nodev linprocfs > ntfs >=20 > I suspect using procfs is not the most portable way of gathering > information in a UNIX system > Am I right? If so, what is the preferred way? Using sysctl? I'm not aware of a portable way to obtain this information across all UNIX variants. For FreeBSD, there isn't a way for userland to obtain the list of filesystems cleanly. The patch looks good to me. I'll probably commit = it after some testing it locally. =2D-=20 John Baldwin