aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/super.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-03-16 06:59:40 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-03-16 16:48:06 -0400
commitc7f404b40a3665d9f4e9a927cc5c1ee0479ed8f9 (patch)
tree2d6fa2bef00efa759f36b17f3be0d4fab3ac9bb5 /fs/nfs/super.c
parentf8ad9c4bae99854c961ca79ed130a0d11d9ab53c (diff)
vfs: new superblock methods to override /proc/*/mount{s,info}
a) ->show_devname(m, mnt) - what to put into devname columns in mounts, mountinfo and mountstats b) ->show_path(m, mnt) - what to put into relative path column in mountinfo Leaving those NULL gives old behaviour. NFS switched to using those. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r--fs/nfs/super.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index a6ab483c9ad0..79bc61fe2868 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -263,6 +263,8 @@ static match_table_t nfs_local_lock_tokens = {
263static void nfs_umount_begin(struct super_block *); 263static void nfs_umount_begin(struct super_block *);
264static int nfs_statfs(struct dentry *, struct kstatfs *); 264static int nfs_statfs(struct dentry *, struct kstatfs *);
265static int nfs_show_options(struct seq_file *, struct vfsmount *); 265static int nfs_show_options(struct seq_file *, struct vfsmount *);
266static int nfs_show_devname(struct seq_file *, struct vfsmount *);
267static int nfs_show_path(struct seq_file *, struct vfsmount *);
266static int nfs_show_stats(struct seq_file *, struct vfsmount *); 268static int nfs_show_stats(struct seq_file *, struct vfsmount *);
267static int nfs_get_sb(struct file_system_type *, int, const char *, void *, struct vfsmount *); 269static int nfs_get_sb(struct file_system_type *, int, const char *, void *, struct vfsmount *);
268static struct dentry *nfs_xdev_mount(struct file_system_type *fs_type, 270static struct dentry *nfs_xdev_mount(struct file_system_type *fs_type,
@@ -296,6 +298,8 @@ static const struct super_operations nfs_sops = {
296 .evict_inode = nfs_evict_inode, 298 .evict_inode = nfs_evict_inode,
297 .umount_begin = nfs_umount_begin, 299 .umount_begin = nfs_umount_begin,
298 .show_options = nfs_show_options, 300 .show_options = nfs_show_options,
301 .show_devname = nfs_show_devname,
302 .show_path = nfs_show_path,
299 .show_stats = nfs_show_stats, 303 .show_stats = nfs_show_stats,
300 .remount_fs = nfs_remount, 304 .remount_fs = nfs_remount,
301}; 305};
@@ -366,6 +370,8 @@ static const struct super_operations nfs4_sops = {
366 .evict_inode = nfs4_evict_inode, 370 .evict_inode = nfs4_evict_inode,
367 .umount_begin = nfs_umount_begin, 371 .umount_begin = nfs_umount_begin,
368 .show_options = nfs_show_options, 372 .show_options = nfs_show_options,
373 .show_devname = nfs_show_devname,
374 .show_path = nfs_show_path,
369 .show_stats = nfs_show_stats, 375 .show_stats = nfs_show_stats,
370 .remount_fs = nfs_remount, 376 .remount_fs = nfs_remount,
371}; 377};
@@ -726,6 +732,28 @@ static int nfs_show_options(struct seq_file *m, struct vfsmount *mnt)
726 return 0; 732 return 0;
727} 733}
728 734
735static int nfs_show_devname(struct seq_file *m, struct vfsmount *mnt)
736{
737 char *page = (char *) __get_free_page(GFP_KERNEL);
738 char *devname, *dummy;
739 int err = 0;
740 if (!page)
741 return -ENOMEM;
742 devname = nfs_path(&dummy, mnt->mnt_root, page, PAGE_SIZE);
743 if (IS_ERR(devname))
744 err = PTR_ERR(devname);
745 else
746 seq_escape(m, devname, " \t\n\\");
747 free_page((unsigned long)page);
748 return err;
749}
750
751static int nfs_show_path(struct seq_file *m, struct vfsmount *mnt)
752{
753 seq_puts(m, "/");
754 return 0;
755}
756
729/* 757/*
730 * Present statistical information for this VFS mountpoint 758 * Present statistical information for this VFS mountpoint
731 */ 759 */