kern/78464: Rename /proc/mtab to /proc/mounts

Robert Millan rmh at debian.org
Sat Mar 5 20:50:19 GMT 2005


>Number:         78464
>Category:       kern
>Synopsis:       Rename /proc/mtab to /proc/mounts
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 05 20:50:17 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Robert Millan
>Release:        GNU/kFreeBSD 5.3-3 i686
>Organization:
Debian
>Environment:
System: GNU/kFreeBSD aragorn 5.3-3 #0: Thu Feb 10 15:39:57 CET 2005 i686 GNU/KFreeBSD

>Description:
Linux procfs implements /proc/mounts, which outputs suitable information to construct /etc/mtab.

In FreeBSD's linprocfs, /proc/mtab exists instead, which does exactly the same.  This simple patch
renames the device so that it matches with the one provided by Linux.

>How-To-Repeat:
	
>Fix:

--- src.old/sys/compat/linprocfs/linprocfs.c	2005-03-03 12:44:21.000000000 +0100
+++ src/sys/compat/linprocfs/linprocfs.c	2005-03-05 19:47:40.000000000 +0100
@@ -345,13 +345,11 @@
 #endif /* __i386__ || __amd64__ */
 
 /*
- * Filler function for proc/mtab
+ * Filler function for proc/mounts
  *
- * This file doesn't exist in Linux' procfs, but is included here so
- * users can symlink /compat/linux/etc/mtab to /proc/mtab
  */
 static int
-linprocfs_domtab(PFS_FILL_ARGS)
+linprocfs_domounts(PFS_FILL_ARGS)
 {
 	struct nameidata nd;
 	struct mount *mp;
@@ -402,7 +400,7 @@
 		ADD_OPTION(MNT_NOSYMFOLLOW,	"nosymfollow");
 		ADD_OPTION(MNT_NOATIME,		"noatime");
 #undef ADD_OPTION
-		/* a real Linux mtab will also show NFS options */
+		/* a real Linux mounts will also show NFS options */
 		sbuf_printf(sb, " 0 0\n");
 	}
 	mtx_unlock(&mountlist_mtx);
@@ -1031,7 +1029,7 @@
 	pfs_create_file(root, "modules", &linprocfs_domodules,
 	    NULL, NULL, PFS_RD);
 #endif
-	pfs_create_file(root, "mtab", &linprocfs_domtab,
+	pfs_create_file(root, "mounts", &linprocfs_domounts,
 	    NULL, NULL, PFS_RD);
 	pfs_create_link(root, "self", &procfs_docurproc,
 	    NULL, NULL, 0);
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list