From owner-freebsd-bugs@FreeBSD.ORG Sun Jan 10 21:20:02 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D70D1065676 for ; Sun, 10 Jan 2010 21:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 42F678FC14 for ; Sun, 10 Jan 2010 21:20:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o0ALK2we046905 for ; Sun, 10 Jan 2010 21:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o0ALK2sn046904; Sun, 10 Jan 2010 21:20:02 GMT (envelope-from gnats) Resent-Date: Sun, 10 Jan 2010 21:20:02 GMT Resent-Message-Id: <201001102120.o0ALK2sn046904@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Fernando Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76B5C106566B for ; Sun, 10 Jan 2010 21:19:34 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 656778FC08 for ; Sun, 10 Jan 2010 21:19:34 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o0ALJYl9076399 for ; Sun, 10 Jan 2010 21:19:34 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o0ALJYB6076398; Sun, 10 Jan 2010 21:19:34 GMT (envelope-from nobody) Message-Id: <201001102119.o0ALJYB6076398@www.freebsd.org> Date: Sun, 10 Jan 2010 21:19:34 GMT From: Fernando To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/142595: Implementation of "filesystems" file in linprocfs X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 21:20:02 -0000 >Number: 142595 >Category: misc >Synopsis: Implementation of "filesystems" file in linprocfs >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jan 10 21:20:01 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Fernando >Release: 8.0-RELEASE >Organization: >Environment: FreeBSD hammer 8.0-RELEASE-p1 FreeBSD 8.0-RELEASE-p1 #11: Fri Jan 1 21:00:36 CET 2010 root@hammer:/usr/obj/usr/src/sys/APEKERNEL amd64 >Description: This patch implements the "filesystems" file for the linux procfs. Few programs use this file but some exceptions as "procinfo" and other system information utilities. >How-To-Repeat: >Fix: The attached patch implements the mentioned file. It was tested against 8.0-RELEASE-p1. Patch attached with submission follows: --- sys/compat/linprocfs/linprocfs.c 2009-12-28 21:48:50.000000000 +0100 +++ /home/fernape/kernel_devel/linprocfs/linprocfs.c 2009-12-28 21:44:46.000000000 +0100 @@ -881,6 +881,33 @@ } /* + * Filler function for proc/filesystems + */ +static int +linprocfs_dofilesystems(PFS_FILL_ARGS) +{ + + /* + * Traverse the mountlist to get the in-use + * filesystems + */ + + struct mount *iterator; + struct vfsconf *tmp; + + mtx_lock(&mountlist_mtx); + + TAILQ_FOREACH(iterator, &mountlist, mnt_list){ + tmp = iterator->mnt_vfc; + sbuf_printf(sb, "\t%s\n",tmp->vfc_name); + } + + mtx_unlock(&mountlist_mtx); + + return 0; +} + +/* * Filler function for proc/pid/cmdline */ static int @@ -1262,6 +1289,8 @@ NULL, NULL, NULL, PFS_RD); pfs_create_file(root, "devices", &linprocfs_dodevices, NULL, NULL, NULL, PFS_RD); + pfs_create_file(root, "filesystems", &linprocfs_dofilesystems, + NULL, NULL, NULL, PFS_RD); pfs_create_file(root, "loadavg", &linprocfs_doloadavg, NULL, NULL, NULL, PFS_RD); pfs_create_file(root, "meminfo", &linprocfs_domeminfo, >Release-Note: >Audit-Trail: >Unformatted: