Skip to contentSkip to conversation

procfs: parse mount options

RFC Superseded Vasiliy Kulikov 1 participant 1 message Jun 15, 2011 Proc filesystem

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

RFC v3 1/5 procfs: parse mount options

This patch adds support of procfs mount options. Actual mount options are comming in the next patches.

---
 fs/proc/inode.c    |   10 +++++++++
 fs/proc/internal.h |    1 +
 fs/proc/root.c     |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 65 insertions(+), 2 deletions(-)
fs/proc/inode.c +10 -0
index 74b48cf..b5f49eb 100644
@@ -7,6 +7,7 @@
 #include <linux/time.h>
 #include <linux/proc_fs.h>
 #include <linux/kernel.h>
+#include <linux/pid_namespace.h>
 #include <linux/mm.h>
 #include <linux/string.h>
 #include <linux/stat.h>
@@ -17,7 +18,9 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/sysctl.h>
+#include <linux/seq_file.h>
 #include <linux/slab.h>
+#include <linux/mount.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -102,12 +105,19 @@ void __init proc_init_inodecache(void)
 					     init_once);
 }
 
+static int proc_show_options(struct seq_file *seq, struct vfsmount *vfs)
+{
+	return 0;
+}
+
 static const struct super_operations proc_sops = {
 	.alloc_inode	= proc_alloc_inode,
 	.destroy_inode	= proc_destroy_inode,
 	.drop_inode	= generic_delete_inode,
 	.evict_inode	= proc_evict_inode,
 	.statfs		= simple_statfs,
+	.remount_fs	= proc_remount,
+	.show_options	= proc_show_options,
 };
 
 static void __pde_users_dec(struct proc_dir_entry *pde)
fs/proc/internal.h +1 -0
index 7838e5c..2925775 100644
@@ -117,6 +117,7 @@ void pde_put(struct proc_dir_entry *pde);
 
 int proc_fill_super(struct super_block *);
 struct inode *proc_get_inode(struct super_block *, struct proc_dir_entry *);
+int proc_remount(struct super_block *sb, int *flags, char *data);
 
 /*
  * These are generic /proc routines that use the internal
fs/proc/root.c +54 -2

83 lines not on this page · raw message

Signature · 1 line
1.7.0.4