diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-30 12:11:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-30 12:11:11 -0400 |
commit | d28619f1563140526e2f84eae436f39206f40a69 (patch) | |
tree | d93284016a0983c8f27b745a3c50738617e50995 /fs/ext4/super.c | |
parent | 021fad8b706849c091f6e682bc5df3ce4f9ab4d7 (diff) | |
parent | f32764bd2bbb6ea003c158b1d276b4dc9f900348 (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6:
quota: Convert quota statistics to generic percpu_counter
ext3 uses rb_node = NULL; to zero rb_root.
quota: Fixup dquot_transfer
reiserfs: Fix resuming of quotas on remount read-write
pohmelfs: Remove dead quota code
ufs: Remove dead quota code
udf: Remove dead quota code
quota: rename default quotactl methods to dquot_
quota: explicitly set ->dq_op and ->s_qcop
quota: drop remount argument to ->quota_on and ->quota_off
quota: move unmount handling into the filesystem
quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers
quota: move remount handling into the filesystem
ocfs2: Fix use after free on remount read-only
Fix up conflicts in fs/ext4/super.c and fs/ufs/file.c
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 49d88c0597c4..4e8983a9811b 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -646,6 +646,8 @@ static void ext4_put_super(struct super_block *sb) | |||
646 | struct ext4_super_block *es = sbi->s_es; | 646 | struct ext4_super_block *es = sbi->s_es; |
647 | int i, err; | 647 | int i, err; |
648 | 648 | ||
649 | dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED); | ||
650 | |||
649 | flush_workqueue(sbi->dio_unwritten_wq); | 651 | flush_workqueue(sbi->dio_unwritten_wq); |
650 | destroy_workqueue(sbi->dio_unwritten_wq); | 652 | destroy_workqueue(sbi->dio_unwritten_wq); |
651 | 653 | ||
@@ -1062,7 +1064,7 @@ static int ext4_release_dquot(struct dquot *dquot); | |||
1062 | static int ext4_mark_dquot_dirty(struct dquot *dquot); | 1064 | static int ext4_mark_dquot_dirty(struct dquot *dquot); |
1063 | static int ext4_write_info(struct super_block *sb, int type); | 1065 | static int ext4_write_info(struct super_block *sb, int type); |
1064 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, | 1066 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, |
1065 | char *path, int remount); | 1067 | char *path); |
1066 | static int ext4_quota_on_mount(struct super_block *sb, int type); | 1068 | static int ext4_quota_on_mount(struct super_block *sb, int type); |
1067 | static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data, | 1069 | static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data, |
1068 | size_t len, loff_t off); | 1070 | size_t len, loff_t off); |
@@ -1084,12 +1086,12 @@ static const struct dquot_operations ext4_quota_operations = { | |||
1084 | 1086 | ||
1085 | static const struct quotactl_ops ext4_qctl_operations = { | 1087 | static const struct quotactl_ops ext4_qctl_operations = { |
1086 | .quota_on = ext4_quota_on, | 1088 | .quota_on = ext4_quota_on, |
1087 | .quota_off = vfs_quota_off, | 1089 | .quota_off = dquot_quota_off, |
1088 | .quota_sync = vfs_quota_sync, | 1090 | .quota_sync = dquot_quota_sync, |
1089 | .get_info = vfs_get_dqinfo, | 1091 | .get_info = dquot_get_dqinfo, |
1090 | .set_info = vfs_set_dqinfo, | 1092 | .set_info = dquot_set_dqinfo, |
1091 | .get_dqblk = vfs_get_dqblk, | 1093 | .get_dqblk = dquot_get_dqblk, |
1092 | .set_dqblk = vfs_set_dqblk | 1094 | .set_dqblk = dquot_set_dqblk |
1093 | }; | 1095 | }; |
1094 | #endif | 1096 | #endif |
1095 | 1097 | ||
@@ -2054,7 +2056,7 @@ static void ext4_orphan_cleanup(struct super_block *sb, | |||
2054 | /* Turn quotas off */ | 2056 | /* Turn quotas off */ |
2055 | for (i = 0; i < MAXQUOTAS; i++) { | 2057 | for (i = 0; i < MAXQUOTAS; i++) { |
2056 | if (sb_dqopt(sb)->files[i]) | 2058 | if (sb_dqopt(sb)->files[i]) |
2057 | vfs_quota_off(sb, i, 0); | 2059 | dquot_quota_off(sb, i); |
2058 | } | 2060 | } |
2059 | #endif | 2061 | #endif |
2060 | sb->s_flags = s_flags; /* Restore MS_RDONLY status */ | 2062 | sb->s_flags = s_flags; /* Restore MS_RDONLY status */ |
@@ -3576,6 +3578,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) | |||
3576 | ext4_fsblk_t n_blocks_count = 0; | 3578 | ext4_fsblk_t n_blocks_count = 0; |
3577 | unsigned long old_sb_flags; | 3579 | unsigned long old_sb_flags; |
3578 | struct ext4_mount_options old_opts; | 3580 | struct ext4_mount_options old_opts; |
3581 | int enable_quota = 0; | ||
3579 | ext4_group_t g; | 3582 | ext4_group_t g; |
3580 | unsigned int journal_ioprio = DEFAULT_JOURNAL_IOPRIO; | 3583 | unsigned int journal_ioprio = DEFAULT_JOURNAL_IOPRIO; |
3581 | int err; | 3584 | int err; |
@@ -3633,6 +3636,10 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) | |||
3633 | } | 3636 | } |
3634 | 3637 | ||
3635 | if (*flags & MS_RDONLY) { | 3638 | if (*flags & MS_RDONLY) { |
3639 | err = dquot_suspend(sb, -1); | ||
3640 | if (err < 0) | ||
3641 | goto restore_opts; | ||
3642 | |||
3636 | /* | 3643 | /* |
3637 | * First of all, the unconditional stuff we have to do | 3644 | * First of all, the unconditional stuff we have to do |
3638 | * to disable replay of the journal when we next remount | 3645 | * to disable replay of the journal when we next remount |
@@ -3701,6 +3708,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) | |||
3701 | goto restore_opts; | 3708 | goto restore_opts; |
3702 | if (!ext4_setup_super(sb, es, 0)) | 3709 | if (!ext4_setup_super(sb, es, 0)) |
3703 | sb->s_flags &= ~MS_RDONLY; | 3710 | sb->s_flags &= ~MS_RDONLY; |
3711 | enable_quota = 1; | ||
3704 | } | 3712 | } |
3705 | } | 3713 | } |
3706 | ext4_setup_system_zone(sb); | 3714 | ext4_setup_system_zone(sb); |
@@ -3716,6 +3724,8 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) | |||
3716 | #endif | 3724 | #endif |
3717 | unlock_super(sb); | 3725 | unlock_super(sb); |
3718 | unlock_kernel(); | 3726 | unlock_kernel(); |
3727 | if (enable_quota) | ||
3728 | dquot_resume(sb, -1); | ||
3719 | 3729 | ||
3720 | ext4_msg(sb, KERN_INFO, "re-mounted. Opts: %s", orig_data); | 3730 | ext4_msg(sb, KERN_INFO, "re-mounted. Opts: %s", orig_data); |
3721 | kfree(orig_data); | 3731 | kfree(orig_data); |
@@ -3913,24 +3923,21 @@ static int ext4_write_info(struct super_block *sb, int type) | |||
3913 | */ | 3923 | */ |
3914 | static int ext4_quota_on_mount(struct super_block *sb, int type) | 3924 | static int ext4_quota_on_mount(struct super_block *sb, int type) |
3915 | { | 3925 | { |
3916 | return vfs_quota_on_mount(sb, EXT4_SB(sb)->s_qf_names[type], | 3926 | return dquot_quota_on_mount(sb, EXT4_SB(sb)->s_qf_names[type], |
3917 | EXT4_SB(sb)->s_jquota_fmt, type); | 3927 | EXT4_SB(sb)->s_jquota_fmt, type); |
3918 | } | 3928 | } |
3919 | 3929 | ||
3920 | /* | 3930 | /* |
3921 | * Standard function to be called on quota_on | 3931 | * Standard function to be called on quota_on |
3922 | */ | 3932 | */ |
3923 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, | 3933 | static int ext4_quota_on(struct super_block *sb, int type, int format_id, |
3924 | char *name, int remount) | 3934 | char *name) |
3925 | { | 3935 | { |
3926 | int err; | 3936 | int err; |
3927 | struct path path; | 3937 | struct path path; |
3928 | 3938 | ||
3929 | if (!test_opt(sb, QUOTA)) | 3939 | if (!test_opt(sb, QUOTA)) |
3930 | return -EINVAL; | 3940 | return -EINVAL; |
3931 | /* When remounting, no checks are needed and in fact, name is NULL */ | ||
3932 | if (remount) | ||
3933 | return vfs_quota_on(sb, type, format_id, name, remount); | ||
3934 | 3941 | ||
3935 | err = kern_path(name, LOOKUP_FOLLOW, &path); | 3942 | err = kern_path(name, LOOKUP_FOLLOW, &path); |
3936 | if (err) | 3943 | if (err) |
@@ -3969,7 +3976,7 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id, | |||
3969 | } | 3976 | } |
3970 | } | 3977 | } |
3971 | 3978 | ||
3972 | err = vfs_quota_on_path(sb, type, format_id, &path); | 3979 | err = dquot_quota_on_path(sb, type, format_id, &path); |
3973 | path_put(&path); | 3980 | path_put(&path); |
3974 | return err; | 3981 | return err; |
3975 | } | 3982 | } |