Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Miklos Szeredi and committed by
Linus Torvalds
571beed8 93d44cb2

+71
+70
fs/ext3/super.c
··· 545 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 553 static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs) 549 554 { 550 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 621 if (test_opt(sb, DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA) 553 622 seq_puts(seq, ",data=journal"); ··· 1494 1425 sbi->s_mount_opt = 0; 1495 1426 sbi->s_resuid = EXT3_DEF_RESUID; 1496 1427 sbi->s_resgid = EXT3_DEF_RESGID; 1428 + sbi->s_sb_block = sb_block; 1497 1429 1498 1430 unlock_kernel(); 1499 1431
+1
include/linux/ext3_fs_sb.h
··· 44 44 struct ext3_super_block * s_es; /* Pointer to the super block in the buffer */ 45 45 struct buffer_head ** s_group_desc; 46 46 unsigned long s_mount_opt; 47 + ext3_fsblk_t s_sb_block; 47 48 uid_t s_resuid; 48 49 gid_t s_resgid; 49 50 unsigned short s_mount_state;