diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2007-10-17 02:26:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:42:48 -0400 |
commit | 571beed8d698e20392e525ed7f360410e40d12e8 (patch) | |
tree | 4251ac5806885becec7926f03cec485cbb990f99 | |
parent | 93d44cb275f3eba720617a8c5b00d51a8e0e9049 (diff) |
ext3: 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>
-rw-r--r-- | fs/ext3/super.c | 70 | ||||
-rw-r--r-- | include/linux/ext3_fs_sb.h | 1 |
2 files changed, 71 insertions, 0 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 775d0bb0bd13..141573de7a9a 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -545,9 +545,78 @@ static inline void ext3_show_quota_options(struct seq_file *seq, struct super_bl | |||
545 | #endif | 545 | #endif |
546 | } | 546 | } |
547 | 547 | ||
548 | /* | ||
549 | * Show an option if | ||
550 | * - it's set to a non-default value OR | ||
551 | * - if the per-sb default is different from the global default | ||
552 | */ | ||
548 | static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs) | 553 | static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs) |
549 | { | 554 | { |
550 | struct super_block *sb = vfs->mnt_sb; | 555 | struct super_block *sb = vfs->mnt_sb; |
556 | struct ext3_sb_info *sbi = EXT3_SB(sb); | ||
557 | struct ext3_super_block *es = sbi->s_es; | ||
558 | unsigned long def_mount_opts; | ||
559 | |||
560 | def_mount_opts = le32_to_cpu(es->s_default_mount_opts); | ||
561 | |||
562 | if (sbi->s_sb_block != 1) | ||
563 | seq_printf(seq, ",sb=%lu", sbi->s_sb_block); | ||
564 | if (test_opt(sb, MINIX_DF)) | ||
565 | seq_puts(seq, ",minixdf"); | ||
566 | if (test_opt(sb, GRPID)) | ||
567 | seq_puts(seq, ",grpid"); | ||
568 | if (!test_opt(sb, GRPID) && (def_mount_opts & EXT3_DEFM_BSDGROUPS)) | ||
569 | seq_puts(seq, ",nogrpid"); | ||
570 | if (sbi->s_resuid != EXT3_DEF_RESUID || | ||
571 | le16_to_cpu(es->s_def_resuid) != EXT3_DEF_RESUID) { | ||
572 | seq_printf(seq, ",resuid=%u", sbi->s_resuid); | ||
573 | } | ||
574 | if (sbi->s_resgid != EXT3_DEF_RESGID || | ||
575 | le16_to_cpu(es->s_def_resgid) != EXT3_DEF_RESGID) { | ||
576 | seq_printf(seq, ",resgid=%u", sbi->s_resgid); | ||
577 | } | ||
578 | if (test_opt(sb, ERRORS_CONT)) { | ||
579 | int def_errors = le16_to_cpu(es->s_errors); | ||
580 | |||
581 | if (def_errors == EXT3_ERRORS_PANIC || | ||
582 | def_errors == EXT3_ERRORS_RO) { | ||
583 | seq_puts(seq, ",errors=continue"); | ||
584 | } | ||
585 | } | ||
586 | if (test_opt(sb, ERRORS_RO)) | ||
587 | seq_puts(seq, ",errors=remount-ro"); | ||
588 | if (test_opt(sb, ERRORS_PANIC)) | ||
589 | seq_puts(seq, ",errors=panic"); | ||
590 | if (test_opt(sb, NO_UID32)) | ||
591 | seq_puts(seq, ",nouid32"); | ||
592 | if (test_opt(sb, DEBUG)) | ||
593 | seq_puts(seq, ",debug"); | ||
594 | if (test_opt(sb, OLDALLOC)) | ||
595 | seq_puts(seq, ",oldalloc"); | ||
596 | #ifdef CONFIG_EXT3_FS_XATTR | ||
597 | if (test_opt(sb, XATTR_USER)) | ||
598 | seq_puts(seq, ",user_xattr"); | ||
599 | if (!test_opt(sb, XATTR_USER) && | ||
600 | (def_mount_opts & EXT3_DEFM_XATTR_USER)) { | ||
601 | seq_puts(seq, ",nouser_xattr"); | ||
602 | } | ||
603 | #endif | ||
604 | #ifdef CONFIG_EXT3_FS_POSIX_ACL | ||
605 | if (test_opt(sb, POSIX_ACL)) | ||
606 | seq_puts(seq, ",acl"); | ||
607 | if (!test_opt(sb, POSIX_ACL) && (def_mount_opts & EXT3_DEFM_ACL)) | ||
608 | seq_puts(seq, ",noacl"); | ||
609 | #endif | ||
610 | if (!test_opt(sb, RESERVATION)) | ||
611 | seq_puts(seq, ",noreservation"); | ||
612 | if (sbi->s_commit_interval) { | ||
613 | seq_printf(seq, ",commit=%u", | ||
614 | (unsigned) (sbi->s_commit_interval / HZ)); | ||
615 | } | ||
616 | if (test_opt(sb, BARRIER)) | ||
617 | seq_puts(seq, ",barrier=1"); | ||
618 | if (test_opt(sb, NOBH)) | ||
619 | seq_puts(seq, ",nobh"); | ||
551 | 620 | ||
552 | if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA) | 621 | if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA) |
553 | seq_puts(seq, ",data=journal"); | 622 | seq_puts(seq, ",data=journal"); |
@@ -1425,6 +1494,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) | |||
1425 | sbi->s_mount_opt = 0; | 1494 | sbi->s_mount_opt = 0; |
1426 | sbi->s_resuid = EXT3_DEF_RESUID; | 1495 | sbi->s_resuid = EXT3_DEF_RESUID; |
1427 | sbi->s_resgid = EXT3_DEF_RESGID; | 1496 | sbi->s_resgid = EXT3_DEF_RESGID; |
1497 | sbi->s_sb_block = sb_block; | ||
1428 | 1498 | ||
1429 | unlock_kernel(); | 1499 | unlock_kernel(); |
1430 | 1500 | ||
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h index d3c08353edf6..b65f0288b842 100644 --- a/include/linux/ext3_fs_sb.h +++ b/include/linux/ext3_fs_sb.h | |||
@@ -44,6 +44,7 @@ struct ext3_sb_info { | |||
44 | struct ext3_super_block * s_es; /* Pointer to the super block in the buffer */ | 44 | struct ext3_super_block * s_es; /* Pointer to the super block in the buffer */ |
45 | struct buffer_head ** s_group_desc; | 45 | struct buffer_head ** s_group_desc; |
46 | unsigned long s_mount_opt; | 46 | unsigned long s_mount_opt; |
47 | ext3_fsblk_t s_sb_block; | ||
47 | uid_t s_resuid; | 48 | uid_t s_resuid; |
48 | gid_t s_resgid; | 49 | gid_t s_resgid; |
49 | unsigned short s_mount_state; | 50 | unsigned short s_mount_state; |