diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2007-10-17 02:26:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:42:49 -0400 |
commit | d9c9bef1345e5d9258febce2a37e4d40319fa728 (patch) | |
tree | cf2d2539011d914fdf33355bb2f3eac1c29a2fdc /fs/ext4 | |
parent | 571beed8d698e20392e525ed7f360410e40d12e8 (diff) |
ext4: show all mount options
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/super.c | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index fc3eb79faa4..0e829cc8a18 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -596,9 +596,80 @@ static inline void ext4_show_quota_options(struct seq_file *seq, struct super_bl | |||
596 | #endif | 596 | #endif |
597 | } | 597 | } |
598 | 598 | ||
599 | /* | ||
600 | * Show an option if | ||
601 | * - it's set to a non-default value OR | ||
602 | * - if the per-sb default is different from the global default | ||
603 | */ | ||
599 | static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs) | 604 | static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs) |
600 | { | 605 | { |
601 | struct super_block *sb = vfs->mnt_sb; | 606 | struct super_block *sb = vfs->mnt_sb; |
607 | struct ext4_sb_info *sbi = EXT4_SB(sb); | ||
608 | struct ext4_super_block *es = sbi->s_es; | ||
609 | unsigned long def_mount_opts; | ||
610 | |||
611 | def_mount_opts = le32_to_cpu(es->s_default_mount_opts); | ||
612 | |||
613 | if (sbi->s_sb_block != 1) | ||
614 | seq_printf(seq, ",sb=%llu", sbi->s_sb_block); | ||
615 | if (test_opt(sb, MINIX_DF)) | ||
616 | seq_puts(seq, ",minixdf"); | ||
617 | if (test_opt(sb, GRPID)) | ||
618 | seq_puts(seq, ",grpid"); | ||
619 | if (!test_opt(sb, GRPID) && (def_mount_opts & EXT4_DEFM_BSDGROUPS)) | ||
620 | seq_puts(seq, ",nogrpid"); | ||
621 | if (sbi->s_resuid != EXT4_DEF_RESUID || | ||
622 | le16_to_cpu(es->s_def_resuid) != EXT4_DEF_RESUID) { | ||
623 | seq_printf(seq, ",resuid=%u", sbi->s_resuid); | ||
624 | } | ||
625 | if (sbi->s_resgid != EXT4_DEF_RESGID || | ||
626 | le16_to_cpu(es->s_def_resgid) != EXT4_DEF_RESGID) { | ||
627 | seq_printf(seq, ",resgid=%u", sbi->s_resgid); | ||
628 | } | ||
629 | if (test_opt(sb, ERRORS_CONT)) { | ||
630 | int def_errors = le16_to_cpu(es->s_errors); | ||
631 | |||
632 | if (def_errors == EXT4_ERRORS_PANIC || | ||
633 | def_errors == EXT4_ERRORS_RO) { | ||
634 | seq_puts(seq, ",errors=continue"); | ||
635 | } | ||
636 | } | ||
637 | if (test_opt(sb, ERRORS_RO)) | ||
638 | seq_puts(seq, ",errors=remount-ro"); | ||
639 | if (test_opt(sb, ERRORS_PANIC)) | ||
640 | seq_puts(seq, ",errors=panic"); | ||
641 | if (test_opt(sb, NO_UID32)) | ||
642 | seq_puts(seq, ",nouid32"); | ||
643 | if (test_opt(sb, DEBUG)) | ||
644 | seq_puts(seq, ",debug"); | ||
645 | if (test_opt(sb, OLDALLOC)) | ||
646 | seq_puts(seq, ",oldalloc"); | ||
647 | #ifdef CONFIG_EXT4_FS_XATTR | ||
648 | if (test_opt(sb, XATTR_USER)) | ||
649 | seq_puts(seq, ",user_xattr"); | ||
650 | if (!test_opt(sb, XATTR_USER) && | ||
651 | (def_mount_opts & EXT4_DEFM_XATTR_USER)) { | ||
652 | seq_puts(seq, ",nouser_xattr"); | ||
653 | } | ||
654 | #endif | ||
655 | #ifdef CONFIG_EXT4_FS_POSIX_ACL | ||
656 | if (test_opt(sb, POSIX_ACL)) | ||
657 | seq_puts(seq, ",acl"); | ||
658 | if (!test_opt(sb, POSIX_ACL) && (def_mount_opts & EXT4_DEFM_ACL)) | ||
659 | seq_puts(seq, ",noacl"); | ||
660 | #endif | ||
661 | if (!test_opt(sb, RESERVATION)) | ||
662 | seq_puts(seq, ",noreservation"); | ||
663 | if (sbi->s_commit_interval) { | ||
664 | seq_printf(seq, ",commit=%u", | ||
665 | (unsigned) (sbi->s_commit_interval / HZ)); | ||
666 | } | ||
667 | if (test_opt(sb, BARRIER)) | ||
668 | seq_puts(seq, ",barrier=1"); | ||
669 | if (test_opt(sb, NOBH)) | ||
670 | seq_puts(seq, ",nobh"); | ||
671 | if (!test_opt(sb, EXTENTS)) | ||
672 | seq_puts(seq, ",noextents"); | ||
602 | 673 | ||
603 | if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) | 674 | if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) |
604 | seq_puts(seq, ",data=journal"); | 675 | seq_puts(seq, ",data=journal"); |
@@ -1486,6 +1557,7 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
1486 | sbi->s_mount_opt = 0; | 1557 | sbi->s_mount_opt = 0; |
1487 | sbi->s_resuid = EXT4_DEF_RESUID; | 1558 | sbi->s_resuid = EXT4_DEF_RESUID; |
1488 | sbi->s_resgid = EXT4_DEF_RESGID; | 1559 | sbi->s_resgid = EXT4_DEF_RESGID; |
1560 | sbi->s_sb_block = sb_block; | ||
1489 | 1561 | ||
1490 | unlock_kernel(); | 1562 | unlock_kernel(); |
1491 | 1563 | ||