diff options
author | Jiro SEKIBA <jir@unicus.jp> | 2009-06-24 07:06:34 -0400 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-09-14 05:27:13 -0400 |
commit | b58a285ba40866e22e5876969a8f796a74311d9e (patch) | |
tree | 9a667fdb99c0429c1871da626cb7589dec54adb7 /fs/nilfs2 | |
parent | 143511046765504d2d1be633efd710f8d84e0407 (diff) |
nilfs2: implement nilfs_show_options to display mount options in /proc/mounts
This is a patch to display mount options in procfs.
Mount options will show up in the /proc/mounts as other fs does.
...
/dev/sda6 /mnt nilfs2 ro,relatime,barrier=off,cp=3,order=strict 0 0
...
Signed-off-by: Jiro SEKIBA <jir@unicus.jp>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2')
-rw-r--r-- | fs/nilfs2/super.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 151964f0de4c..ebbefb9d26c9 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c | |||
@@ -50,6 +50,8 @@ | |||
50 | #include <linux/writeback.h> | 50 | #include <linux/writeback.h> |
51 | #include <linux/kobject.h> | 51 | #include <linux/kobject.h> |
52 | #include <linux/exportfs.h> | 52 | #include <linux/exportfs.h> |
53 | #include <linux/seq_file.h> | ||
54 | #include <linux/mount.h> | ||
53 | #include "nilfs.h" | 55 | #include "nilfs.h" |
54 | #include "mdt.h" | 56 | #include "mdt.h" |
55 | #include "alloc.h" | 57 | #include "alloc.h" |
@@ -529,6 +531,26 @@ static int nilfs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
529 | return 0; | 531 | return 0; |
530 | } | 532 | } |
531 | 533 | ||
534 | static int nilfs_show_options(struct seq_file *seq, struct vfsmount *vfs) | ||
535 | { | ||
536 | struct super_block *sb = vfs->mnt_sb; | ||
537 | struct nilfs_sb_info *sbi = NILFS_SB(sb); | ||
538 | |||
539 | if (!nilfs_test_opt(sbi, BARRIER)) | ||
540 | seq_printf(seq, ",barrier=off"); | ||
541 | if (nilfs_test_opt(sbi, SNAPSHOT)) | ||
542 | seq_printf(seq, ",cp=%llu", | ||
543 | (unsigned long long int)sbi->s_snapshot_cno); | ||
544 | if (nilfs_test_opt(sbi, ERRORS_RO)) | ||
545 | seq_printf(seq, ",errors=remount-ro"); | ||
546 | if (nilfs_test_opt(sbi, ERRORS_PANIC)) | ||
547 | seq_printf(seq, ",errors=panic"); | ||
548 | if (nilfs_test_opt(sbi, STRICT_ORDER)) | ||
549 | seq_printf(seq, ",order=strict"); | ||
550 | |||
551 | return 0; | ||
552 | } | ||
553 | |||
532 | static struct super_operations nilfs_sops = { | 554 | static struct super_operations nilfs_sops = { |
533 | .alloc_inode = nilfs_alloc_inode, | 555 | .alloc_inode = nilfs_alloc_inode, |
534 | .destroy_inode = nilfs_destroy_inode, | 556 | .destroy_inode = nilfs_destroy_inode, |
@@ -546,7 +568,7 @@ static struct super_operations nilfs_sops = { | |||
546 | .remount_fs = nilfs_remount, | 568 | .remount_fs = nilfs_remount, |
547 | .clear_inode = nilfs_clear_inode, | 569 | .clear_inode = nilfs_clear_inode, |
548 | /* .umount_begin */ | 570 | /* .umount_begin */ |
549 | /* .show_options */ | 571 | .show_options = nilfs_show_options |
550 | }; | 572 | }; |
551 | 573 | ||
552 | static struct inode * | 574 | static struct inode * |