History

ext4: show all mount options

Miklos Szeredi committed 19 years ago

Commit d9c9bef1 parent 571beed2 files · +73 −0Browse files

Unified · Split

2 files
  1. fs/ext4/super.c +72 −0
  2. include/linux/ext4_fs_sb.h +1 −0
fs/ext4/super.c+72−0
@@ -596,9 +596,80 @@ static inline void ext4_show_quota_options(struct seq_file *seq, struct super_bl · 595 unmodified lines
596596 #endif
597597 }
598598
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+ */
599604 static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
600605 {
601606 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");
602673
603674 if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)
604675 seq_puts(seq, ",data=journal");
@@ -1486,6 +1557,7 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) · 881 unmodified lines
14861557 sbi->s_mount_opt = 0;
14871558 sbi->s_resuid = EXT4_DEF_RESUID;
14881559 sbi->s_resgid = EXT4_DEF_RESGID;
1560+ sbi->s_sb_block = sb_block;
14891561
14901562 unlock_kernel();
14911563
include/linux/ext4_fs_sb.h+1−0
@@ -45,6 +45,7 @@ struct ext4_sb_info { · 44 unmodified lines
4545 struct ext4_super_block * s_es; /* Pointer to the super block in the buffer */
4646 struct buffer_head ** s_group_desc;
4747 unsigned long s_mount_opt;
48+ ext4_fsblk_t s_sb_block;
4849 uid_t s_resuid;
4950 gid_t s_resgid;
5051 unsigned short s_mount_state;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t