Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jan 2010 21:19:34 GMT
From:      Fernando <fernando.apesteguia@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/142595: Implementation of "filesystems" file in linprocfs
Message-ID:  <201001102119.o0ALJYB6076398@www.freebsd.org>
Resent-Message-ID: <201001102120.o0ALK2sn046904@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001102119.o0ALJYB6076398>