From nobody@FreeBSD.org  Sun Jan 10 21:19:34 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 76B5C106566B
	for <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <fernando.apesteguia@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Implementation of "filesystems" file in linprocfs
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         142595
>Category:       kern
>Synopsis:       Implementation of "filesystems" file in linprocfs(5)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jhb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 10 21:20:01 UTC 2010
>Closed-Date:    Mon Mar 04 18:28:36 UTC 2013
>Last-Modified:  Mon Mar  4 18:30:00 UTC 2013
>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:
Responsible-Changed-From-To: freebsd-bugs->freebsd-emulation 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Jan 10 21:22:57 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=142595 

From: Alexander Best <alexbestms@wwu.de>
To: <bug-followup@FreeBSD.org>
Cc:  
Subject: Re: kern/142595: Implementation of "filesystems" file in
 linprocfs(5)
Date: Wed, 24 Mar 2010 17:41:26 +0100 (CET)

 committed by jhb@ in HEAD with r205541. please mark patched and assign to him.
 
 -- 
 Alexander Best
State-Changed-From-To: open->patched 
State-Changed-By: gavin 
State-Changed-When: Wed Mar 24 17:17:54 UTC 2010 
State-Changed-Why:  
Fixed in head in r205541. 


Responsible-Changed-From-To: freebsd-emulation->jhb 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Wed Mar 24 17:17:54 UTC 2010 
Responsible-Changed-Why:  
Over to jhb@ for MFC consideration 

http://www.freebsd.org/cgi/query-pr.cgi?pr=142595 
State-Changed-From-To: patched->closed 
State-Changed-By: jhb 
State-Changed-When: Mon Mar 4 18:28:28 UTC 2013 
State-Changed-Why:  
Merged to 8. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=142595 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/142595: commit references a PR
Date: Mon,  4 Mar 2013 18:28:31 +0000 (UTC)

 Author: jhb
 Date: Mon Mar  4 18:28:24 2013
 New Revision: 247808
 URL: http://svnweb.freebsd.org/changeset/base/247808
 
 Log:
   MFC 205541,205592:
   Implement /proc/filesystems.
   
   PR:		kern/142595
 
 Modified:
   stable/8/sys/compat/linprocfs/linprocfs.c
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/compat/   (props changed)
 
 Modified: stable/8/sys/compat/linprocfs/linprocfs.c
 ==============================================================================
 --- stable/8/sys/compat/linprocfs/linprocfs.c	Mon Mar  4 18:07:28 2013	(r247807)
 +++ stable/8/sys/compat/linprocfs/linprocfs.c	Mon Mar  4 18:28:24 2013	(r247808)
 @@ -1427,6 +1427,24 @@ linprocfs_docmdline(PFS_FILL_ARGS)
  	return (0);
  }
  
 +/*
 + * Filler function for proc/filesystems
 + */
 +static int
 +linprocfs_dofilesystems(PFS_FILL_ARGS)
 +{
 +	struct vfsconf *vfsp;
 +
 +	mtx_lock(&Giant);
 +	TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) {
 +		if (vfsp->vfc_flags & VFCF_SYNTHETIC)
 +			sbuf_printf(sb, "nodev");
 +		sbuf_printf(sb, "\t%s\n", vfsp->vfc_name);
 +	}
 +	mtx_unlock(&Giant);
 +	return(0);
 +}
 +
  #if 0
  /*
   * Filler function for proc/modules
 @@ -1462,6 +1480,8 @@ linprocfs_init(PFS_INIT_ARGS)
  	    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,
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
