diff options
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 63 |
1 files changed, 42 insertions, 21 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 7d865608e817..0e661c569660 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -569,7 +569,7 @@ static struct inode *ext4_alloc_inode(struct super_block *sb) | |||
569 | ei = kmem_cache_alloc(ext4_inode_cachep, GFP_NOFS); | 569 | ei = kmem_cache_alloc(ext4_inode_cachep, GFP_NOFS); |
570 | if (!ei) | 570 | if (!ei) |
571 | return NULL; | 571 | return NULL; |
572 | #ifdef CONFIG_EXT4DEV_FS_POSIX_ACL | 572 | #ifdef CONFIG_EXT4_FS_POSIX_ACL |
573 | ei->i_acl = EXT4_ACL_NOT_CACHED; | 573 | ei->i_acl = EXT4_ACL_NOT_CACHED; |
574 | ei->i_default_acl = EXT4_ACL_NOT_CACHED; | 574 | ei->i_default_acl = EXT4_ACL_NOT_CACHED; |
575 | #endif | 575 | #endif |
@@ -605,7 +605,7 @@ static void init_once(void *foo) | |||
605 | struct ext4_inode_info *ei = (struct ext4_inode_info *) foo; | 605 | struct ext4_inode_info *ei = (struct ext4_inode_info *) foo; |
606 | 606 | ||
607 | INIT_LIST_HEAD(&ei->i_orphan); | 607 | INIT_LIST_HEAD(&ei->i_orphan); |
608 | #ifdef CONFIG_EXT4DEV_FS_XATTR | 608 | #ifdef CONFIG_EXT4_FS_XATTR |
609 | init_rwsem(&ei->xattr_sem); | 609 | init_rwsem(&ei->xattr_sem); |
610 | #endif | 610 | #endif |
611 | init_rwsem(&ei->i_data_sem); | 611 | init_rwsem(&ei->i_data_sem); |
@@ -631,7 +631,7 @@ static void destroy_inodecache(void) | |||
631 | 631 | ||
632 | static void ext4_clear_inode(struct inode *inode) | 632 | static void ext4_clear_inode(struct inode *inode) |
633 | { | 633 | { |
634 | #ifdef CONFIG_EXT4DEV_FS_POSIX_ACL | 634 | #ifdef CONFIG_EXT4_FS_POSIX_ACL |
635 | if (EXT4_I(inode)->i_acl && | 635 | if (EXT4_I(inode)->i_acl && |
636 | EXT4_I(inode)->i_acl != EXT4_ACL_NOT_CACHED) { | 636 | EXT4_I(inode)->i_acl != EXT4_ACL_NOT_CACHED) { |
637 | posix_acl_release(EXT4_I(inode)->i_acl); | 637 | posix_acl_release(EXT4_I(inode)->i_acl); |
@@ -720,7 +720,7 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs) | |||
720 | seq_puts(seq, ",debug"); | 720 | seq_puts(seq, ",debug"); |
721 | if (test_opt(sb, OLDALLOC)) | 721 | if (test_opt(sb, OLDALLOC)) |
722 | seq_puts(seq, ",oldalloc"); | 722 | seq_puts(seq, ",oldalloc"); |
723 | #ifdef CONFIG_EXT4DEV_FS_XATTR | 723 | #ifdef CONFIG_EXT4_FS_XATTR |
724 | if (test_opt(sb, XATTR_USER) && | 724 | if (test_opt(sb, XATTR_USER) && |
725 | !(def_mount_opts & EXT4_DEFM_XATTR_USER)) | 725 | !(def_mount_opts & EXT4_DEFM_XATTR_USER)) |
726 | seq_puts(seq, ",user_xattr"); | 726 | seq_puts(seq, ",user_xattr"); |
@@ -729,7 +729,7 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs) | |||
729 | seq_puts(seq, ",nouser_xattr"); | 729 | seq_puts(seq, ",nouser_xattr"); |
730 | } | 730 | } |
731 | #endif | 731 | #endif |
732 | #ifdef CONFIG_EXT4DEV_FS_POSIX_ACL | 732 | #ifdef CONFIG_EXT4_FS_POSIX_ACL |
733 | if (test_opt(sb, POSIX_ACL) && !(def_mount_opts & EXT4_DEFM_ACL)) | 733 | if (test_opt(sb, POSIX_ACL) && !(def_mount_opts & EXT4_DEFM_ACL)) |
734 | seq_puts(seq, ",acl"); | 734 | seq_puts(seq, ",acl"); |
735 | if (!test_opt(sb, POSIX_ACL) && (def_mount_opts & EXT4_DEFM_ACL)) | 735 | if (!test_opt(sb, POSIX_ACL) && (def_mount_opts & EXT4_DEFM_ACL)) |
@@ -1078,7 +1078,7 @@ static int parse_options(char *options, struct super_block *sb, | |||
1078 | case Opt_orlov: | 1078 | case Opt_orlov: |
1079 | clear_opt(sbi->s_mount_opt, OLDALLOC); | 1079 | clear_opt(sbi->s_mount_opt, OLDALLOC); |
1080 | break; | 1080 | break; |
1081 | #ifdef CONFIG_EXT4DEV_FS_XATTR | 1081 | #ifdef CONFIG_EXT4_FS_XATTR |
1082 | case Opt_user_xattr: | 1082 | case Opt_user_xattr: |
1083 | set_opt(sbi->s_mount_opt, XATTR_USER); | 1083 | set_opt(sbi->s_mount_opt, XATTR_USER); |
1084 | break; | 1084 | break; |
@@ -1092,7 +1092,7 @@ static int parse_options(char *options, struct super_block *sb, | |||
1092 | "not supported\n"); | 1092 | "not supported\n"); |
1093 | break; | 1093 | break; |
1094 | #endif | 1094 | #endif |
1095 | #ifdef CONFIG_EXT4DEV_FS_POSIX_ACL | 1095 | #ifdef CONFIG_EXT4_FS_POSIX_ACL |
1096 | case Opt_acl: | 1096 | case Opt_acl: |
1097 | set_opt(sbi->s_mount_opt, POSIX_ACL); | 1097 | set_opt(sbi->s_mount_opt, POSIX_ACL); |
1098 | break; | 1098 | break; |
@@ -1987,11 +1987,11 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
1987 | set_opt(sbi->s_mount_opt, GRPID); | 1987 | set_opt(sbi->s_mount_opt, GRPID); |
1988 | if (def_mount_opts & EXT4_DEFM_UID16) | 1988 | if (def_mount_opts & EXT4_DEFM_UID16) |
1989 | set_opt(sbi->s_mount_opt, NO_UID32); | 1989 | set_opt(sbi->s_mount_opt, NO_UID32); |
1990 | #ifdef CONFIG_EXT4DEV_FS_XATTR | 1990 | #ifdef CONFIG_EXT4_FS_XATTR |
1991 | if (def_mount_opts & EXT4_DEFM_XATTR_USER) | 1991 | if (def_mount_opts & EXT4_DEFM_XATTR_USER) |
1992 | set_opt(sbi->s_mount_opt, XATTR_USER); | 1992 | set_opt(sbi->s_mount_opt, XATTR_USER); |
1993 | #endif | 1993 | #endif |
1994 | #ifdef CONFIG_EXT4DEV_FS_POSIX_ACL | 1994 | #ifdef CONFIG_EXT4_FS_POSIX_ACL |
1995 | if (def_mount_opts & EXT4_DEFM_ACL) | 1995 | if (def_mount_opts & EXT4_DEFM_ACL) |
1996 | set_opt(sbi->s_mount_opt, POSIX_ACL); | 1996 | set_opt(sbi->s_mount_opt, POSIX_ACL); |
1997 | #endif | 1997 | #endif |
@@ -2050,16 +2050,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
2050 | "running e2fsck is recommended\n"); | 2050 | "running e2fsck is recommended\n"); |
2051 | 2051 | ||
2052 | /* | 2052 | /* |
2053 | * Since ext4 is still considered development code, we require | ||
2054 | * that the TEST_FILESYS flag in s->flags be set. | ||
2055 | */ | ||
2056 | if (!(le32_to_cpu(es->s_flags) & EXT2_FLAGS_TEST_FILESYS)) { | ||
2057 | printk(KERN_WARNING "EXT4-fs: %s: not marked " | ||
2058 | "OK to use with test code.\n", sb->s_id); | ||
2059 | goto failed_mount; | ||
2060 | } | ||
2061 | |||
2062 | /* | ||
2063 | * Check feature flags regardless of the revision level, since we | 2053 | * Check feature flags regardless of the revision level, since we |
2064 | * previously didn't change the revision level when setting the flags, | 2054 | * previously didn't change the revision level when setting the flags, |
2065 | * so there is a chance incompat flags are set on a rev 0 filesystem. | 2055 | * so there is a chance incompat flags are set on a rev 0 filesystem. |
@@ -3580,13 +3570,34 @@ const struct file_operations ext4_ui_proc_fops = { | |||
3580 | }; | 3570 | }; |
3581 | #endif | 3571 | #endif |
3582 | 3572 | ||
3573 | static struct file_system_type ext4_fs_type = { | ||
3574 | .owner = THIS_MODULE, | ||
3575 | .name = "ext4", | ||
3576 | .get_sb = ext4_get_sb, | ||
3577 | .kill_sb = kill_block_super, | ||
3578 | .fs_flags = FS_REQUIRES_DEV, | ||
3579 | }; | ||
3580 | |||
3581 | #ifdef CONFIG_EXT4DEV_COMPAT | ||
3582 | static int ext4dev_get_sb(struct file_system_type *fs_type, | ||
3583 | int flags, const char *dev_name, void *data, struct vfsmount *mnt) | ||
3584 | { | ||
3585 | printk(KERN_WARNING "EXT4-fs: Update your userspace programs " | ||
3586 | "to mount using ext4\n"); | ||
3587 | printk(KERN_WARNING "EXT4-fs: ext4dev backwards compatibility " | ||
3588 | "will go away by 2.6.31\n"); | ||
3589 | return get_sb_bdev(fs_type, flags, dev_name, data, ext4_fill_super, mnt); | ||
3590 | } | ||
3591 | |||
3583 | static struct file_system_type ext4dev_fs_type = { | 3592 | static struct file_system_type ext4dev_fs_type = { |
3584 | .owner = THIS_MODULE, | 3593 | .owner = THIS_MODULE, |
3585 | .name = "ext4dev", | 3594 | .name = "ext4dev", |
3586 | .get_sb = ext4_get_sb, | 3595 | .get_sb = ext4dev_get_sb, |
3587 | .kill_sb = kill_block_super, | 3596 | .kill_sb = kill_block_super, |
3588 | .fs_flags = FS_REQUIRES_DEV, | 3597 | .fs_flags = FS_REQUIRES_DEV, |
3589 | }; | 3598 | }; |
3599 | MODULE_ALIAS("ext4dev"); | ||
3600 | #endif | ||
3590 | 3601 | ||
3591 | static int __init init_ext4_fs(void) | 3602 | static int __init init_ext4_fs(void) |
3592 | { | 3603 | { |
@@ -3603,9 +3614,16 @@ static int __init init_ext4_fs(void) | |||
3603 | err = init_inodecache(); | 3614 | err = init_inodecache(); |
3604 | if (err) | 3615 | if (err) |
3605 | goto out1; | 3616 | goto out1; |
3606 | err = register_filesystem(&ext4dev_fs_type); | 3617 | err = register_filesystem(&ext4_fs_type); |
3607 | if (err) | 3618 | if (err) |
3608 | goto out; | 3619 | goto out; |
3620 | #ifdef CONFIG_EXT4DEV_COMPAT | ||
3621 | err = register_filesystem(&ext4dev_fs_type); | ||
3622 | if (err) { | ||
3623 | unregister_filesystem(&ext4_fs_type); | ||
3624 | goto out; | ||
3625 | } | ||
3626 | #endif | ||
3609 | return 0; | 3627 | return 0; |
3610 | out: | 3628 | out: |
3611 | destroy_inodecache(); | 3629 | destroy_inodecache(); |
@@ -3618,7 +3636,10 @@ out2: | |||
3618 | 3636 | ||
3619 | static void __exit exit_ext4_fs(void) | 3637 | static void __exit exit_ext4_fs(void) |
3620 | { | 3638 | { |
3639 | unregister_filesystem(&ext4_fs_type); | ||
3640 | #ifdef CONFIG_EXT4DEV_COMPAT | ||
3621 | unregister_filesystem(&ext4dev_fs_type); | 3641 | unregister_filesystem(&ext4dev_fs_type); |
3642 | #endif | ||
3622 | destroy_inodecache(); | 3643 | destroy_inodecache(); |
3623 | exit_ext4_xattr(); | 3644 | exit_ext4_xattr(); |
3624 | exit_ext4_mballoc(); | 3645 | exit_ext4_mballoc(); |