diff options
Diffstat (limited to 'fs/ext3/super.c')
-rw-r--r-- | fs/ext3/super.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 0fc1293d0e96..6c953bb255e7 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -410,6 +410,8 @@ static void ext3_put_super (struct super_block * sb) | |||
410 | struct ext3_super_block *es = sbi->s_es; | 410 | struct ext3_super_block *es = sbi->s_es; |
411 | int i, err; | 411 | int i, err; |
412 | 412 | ||
413 | dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED); | ||
414 | |||
413 | lock_kernel(); | 415 | lock_kernel(); |
414 | 416 | ||
415 | ext3_xattr_put_super(sb); | 417 | ext3_xattr_put_super(sb); |
@@ -748,7 +750,7 @@ static int ext3_release_dquot(struct dquot *dquot); | |||
748 | static int ext3_mark_dquot_dirty(struct dquot *dquot); | 750 | static int ext3_mark_dquot_dirty(struct dquot *dquot); |
749 | static int ext3_write_info(struct super_block *sb, int type); | 751 | static int ext3_write_info(struct super_block *sb, int type); |
750 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, | 752 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, |
751 | char *path, int remount); | 753 | char *path); |
752 | static int ext3_quota_on_mount(struct super_block *sb, int type); | 754 | static int ext3_quota_on_mount(struct super_block *sb, int type); |
753 | static ssize_t ext3_quota_read(struct super_block *sb, int type, char *data, | 755 | static ssize_t ext3_quota_read(struct super_block *sb, int type, char *data, |
754 | size_t len, loff_t off); | 756 | size_t len, loff_t off); |
@@ -767,12 +769,12 @@ static const struct dquot_operations ext3_quota_operations = { | |||
767 | 769 | ||
768 | static const struct quotactl_ops ext3_qctl_operations = { | 770 | static const struct quotactl_ops ext3_qctl_operations = { |
769 | .quota_on = ext3_quota_on, | 771 | .quota_on = ext3_quota_on, |
770 | .quota_off = vfs_quota_off, | 772 | .quota_off = dquot_quota_off, |
771 | .quota_sync = vfs_quota_sync, | 773 | .quota_sync = dquot_quota_sync, |
772 | .get_info = vfs_get_dqinfo, | 774 | .get_info = dquot_get_dqinfo, |
773 | .set_info = vfs_set_dqinfo, | 775 | .set_info = dquot_set_dqinfo, |
774 | .get_dqblk = vfs_get_dqblk, | 776 | .get_dqblk = dquot_get_dqblk, |
775 | .set_dqblk = vfs_set_dqblk | 777 | .set_dqblk = dquot_set_dqblk |
776 | }; | 778 | }; |
777 | #endif | 779 | #endif |
778 | 780 | ||
@@ -1527,7 +1529,7 @@ static void ext3_orphan_cleanup (struct super_block * sb, | |||
1527 | /* Turn quotas off */ | 1529 | /* Turn quotas off */ |
1528 | for (i = 0; i < MAXQUOTAS; i++) { | 1530 | for (i = 0; i < MAXQUOTAS; i++) { |
1529 | if (sb_dqopt(sb)->files[i]) | 1531 | if (sb_dqopt(sb)->files[i]) |
1530 | vfs_quota_off(sb, i, 0); | 1532 | dquot_quota_off(sb, i); |
1531 | } | 1533 | } |
1532 | #endif | 1534 | #endif |
1533 | sb->s_flags = s_flags; /* Restore MS_RDONLY status */ | 1535 | sb->s_flags = s_flags; /* Restore MS_RDONLY status */ |
@@ -2551,6 +2553,7 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data) | |||
2551 | ext3_fsblk_t n_blocks_count = 0; | 2553 | ext3_fsblk_t n_blocks_count = 0; |
2552 | unsigned long old_sb_flags; | 2554 | unsigned long old_sb_flags; |
2553 | struct ext3_mount_options old_opts; | 2555 | struct ext3_mount_options old_opts; |
2556 | int enable_quota = 0; | ||
2554 | int err; | 2557 | int err; |
2555 | #ifdef CONFIG_QUOTA | 2558 | #ifdef CONFIG_QUOTA |
2556 | int i; | 2559 | int i; |
@@ -2597,6 +2600,10 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data) | |||
2597 | } | 2600 | } |
2598 | 2601 | ||
2599 | if (*flags & MS_RDONLY) { | 2602 | if (*flags & MS_RDONLY) { |
2603 | err = dquot_suspend(sb, -1); | ||
2604 | if (err < 0) | ||
2605 | goto restore_opts; | ||
2606 | |||
2600 | /* | 2607 | /* |
2601 | * First of all, the unconditional stuff we have to do | 2608 | * First of all, the unconditional stuff we have to do |
2602 | * to disable replay of the journal when we next remount | 2609 | * to disable replay of the journal when we next remount |
@@ -2651,6 +2658,7 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data) | |||
2651 | goto restore_opts; | 2658 | goto restore_opts; |
2652 | if (!ext3_setup_super (sb, es, 0)) | 2659 | if (!ext3_setup_super (sb, es, 0)) |
2653 | sb->s_flags &= ~MS_RDONLY; | 2660 | sb->s_flags &= ~MS_RDONLY; |
2661 | enable_quota = 1; | ||
2654 | } | 2662 | } |
2655 | } | 2663 | } |
2656 | #ifdef CONFIG_QUOTA | 2664 | #ifdef CONFIG_QUOTA |
@@ -2662,6 +2670,9 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data) | |||
2662 | #endif | 2670 | #endif |
2663 | unlock_super(sb); | 2671 | unlock_super(sb); |
2664 | unlock_kernel(); | 2672 | unlock_kernel(); |
2673 | |||
2674 | if (enable_quota) | ||
2675 | dquot_resume(sb, -1); | ||
2665 | return 0; | 2676 | return 0; |
2666 | restore_opts: | 2677 | restore_opts: |
2667 | sb->s_flags = old_sb_flags; | 2678 | sb->s_flags = old_sb_flags; |
@@ -2851,24 +2862,21 @@ static int ext3_write_info(struct super_block *sb, int type) | |||
2851 | */ | 2862 | */ |
2852 | static int ext3_quota_on_mount(struct super_block *sb, int type) | 2863 | static int ext3_quota_on_mount(struct super_block *sb, int type) |
2853 | { | 2864 | { |
2854 | return vfs_quota_on_mount(sb, EXT3_SB(sb)->s_qf_names[type], | 2865 | return dquot_quota_on_mount(sb, EXT3_SB(sb)->s_qf_names[type], |
2855 | EXT3_SB(sb)->s_jquota_fmt, type); | 2866 | EXT3_SB(sb)->s_jquota_fmt, type); |
2856 | } | 2867 | } |
2857 | 2868 | ||
2858 | /* | 2869 | /* |
2859 | * Standard function to be called on quota_on | 2870 | * Standard function to be called on quota_on |
2860 | */ | 2871 | */ |
2861 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, | 2872 | static int ext3_quota_on(struct super_block *sb, int type, int format_id, |
2862 | char *name, int remount) | 2873 | char *name) |
2863 | { | 2874 | { |
2864 | int err; | 2875 | int err; |
2865 | struct path path; | 2876 | struct path path; |
2866 | 2877 | ||
2867 | if (!test_opt(sb, QUOTA)) | 2878 | if (!test_opt(sb, QUOTA)) |
2868 | return -EINVAL; | 2879 | return -EINVAL; |
2869 | /* When remounting, no checks are needed and in fact, name is NULL */ | ||
2870 | if (remount) | ||
2871 | return vfs_quota_on(sb, type, format_id, name, remount); | ||
2872 | 2880 | ||
2873 | err = kern_path(name, LOOKUP_FOLLOW, &path); | 2881 | err = kern_path(name, LOOKUP_FOLLOW, &path); |
2874 | if (err) | 2882 | if (err) |
@@ -2906,7 +2914,7 @@ static int ext3_quota_on(struct super_block *sb, int type, int format_id, | |||
2906 | } | 2914 | } |
2907 | } | 2915 | } |
2908 | 2916 | ||
2909 | err = vfs_quota_on_path(sb, type, format_id, &path); | 2917 | err = dquot_quota_on_path(sb, type, format_id, &path); |
2910 | path_put(&path); | 2918 | path_put(&path); |
2911 | return err; | 2919 | return err; |
2912 | } | 2920 | } |