diff options
author | Sunil Mushran <sunil.mushran@oracle.com> | 2007-09-06 16:34:16 -0400 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2007-10-12 14:54:33 -0400 |
commit | d550071c03f129a60dfad60d23dab73f894129a9 (patch) | |
tree | 883fc5365e66ac312996a5fcedc35ce60a394926 /fs/ocfs2/super.c | |
parent | 19b613d41051296be628581e7e21b847e9eaba80 (diff) |
ocfs2: Implement show_options()
Implement sops->show_options() so as to allow /proc/mounts to show the mount
options.
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r-- | fs/ocfs2/super.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 19436d1ff57f..e5ac0714dab2 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/parser.h> | 39 | #include <linux/parser.h> |
40 | #include <linux/crc32.h> | 40 | #include <linux/crc32.h> |
41 | #include <linux/debugfs.h> | 41 | #include <linux/debugfs.h> |
42 | #include <linux/mount.h> | ||
42 | 43 | ||
43 | #include <cluster/nodemanager.h> | 44 | #include <cluster/nodemanager.h> |
44 | 45 | ||
@@ -91,6 +92,7 @@ struct mount_options | |||
91 | static int ocfs2_parse_options(struct super_block *sb, char *options, | 92 | static int ocfs2_parse_options(struct super_block *sb, char *options, |
92 | struct mount_options *mopt, | 93 | struct mount_options *mopt, |
93 | int is_remount); | 94 | int is_remount); |
95 | static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt); | ||
94 | static void ocfs2_put_super(struct super_block *sb); | 96 | static void ocfs2_put_super(struct super_block *sb); |
95 | static int ocfs2_mount_volume(struct super_block *sb); | 97 | static int ocfs2_mount_volume(struct super_block *sb); |
96 | static int ocfs2_remount(struct super_block *sb, int *flags, char *data); | 98 | static int ocfs2_remount(struct super_block *sb, int *flags, char *data); |
@@ -133,6 +135,7 @@ static const struct super_operations ocfs2_sops = { | |||
133 | .write_super = ocfs2_write_super, | 135 | .write_super = ocfs2_write_super, |
134 | .put_super = ocfs2_put_super, | 136 | .put_super = ocfs2_put_super, |
135 | .remount_fs = ocfs2_remount, | 137 | .remount_fs = ocfs2_remount, |
138 | .show_options = ocfs2_show_options, | ||
136 | }; | 139 | }; |
137 | 140 | ||
138 | enum { | 141 | enum { |
@@ -830,6 +833,41 @@ bail: | |||
830 | return status; | 833 | return status; |
831 | } | 834 | } |
832 | 835 | ||
836 | static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt) | ||
837 | { | ||
838 | struct ocfs2_super *osb = OCFS2_SB(mnt->mnt_sb); | ||
839 | unsigned long opts = osb->s_mount_opt; | ||
840 | |||
841 | if (opts & OCFS2_MOUNT_HB_LOCAL) | ||
842 | seq_printf(s, ",_netdev,heartbeat=local"); | ||
843 | else | ||
844 | seq_printf(s, ",heartbeat=none"); | ||
845 | |||
846 | if (opts & OCFS2_MOUNT_NOINTR) | ||
847 | seq_printf(s, ",nointr"); | ||
848 | |||
849 | if (opts & OCFS2_MOUNT_DATA_WRITEBACK) | ||
850 | seq_printf(s, ",data=writeback"); | ||
851 | else | ||
852 | seq_printf(s, ",data=ordered"); | ||
853 | |||
854 | if (opts & OCFS2_MOUNT_BARRIER) | ||
855 | seq_printf(s, ",barrier=1"); | ||
856 | |||
857 | if (opts & OCFS2_MOUNT_ERRORS_PANIC) | ||
858 | seq_printf(s, ",errors=panic"); | ||
859 | else | ||
860 | seq_printf(s, ",errors=remount-ro"); | ||
861 | |||
862 | if (osb->preferred_slot != OCFS2_INVALID_SLOT) | ||
863 | seq_printf(s, ",preferred_slot=%d", osb->preferred_slot); | ||
864 | |||
865 | if (osb->s_atime_quantum != OCFS2_DEFAULT_ATIME_QUANTUM) | ||
866 | seq_printf(s, ",atime_quantum=%u", osb->s_atime_quantum); | ||
867 | |||
868 | return 0; | ||
869 | } | ||
870 | |||
833 | static int __init ocfs2_init(void) | 871 | static int __init ocfs2_init(void) |
834 | { | 872 | { |
835 | int status; | 873 | int status; |