diff options
Diffstat (limited to 'fs/ocfs2/super.c')
| -rw-r--r-- | fs/ocfs2/super.c | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 2c26ce251cb3..0eaa929a4dbf 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
| @@ -879,13 +879,15 @@ static int ocfs2_susp_quotas(struct ocfs2_super *osb, int unsuspend) | |||
| 879 | if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type])) | 879 | if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type])) |
| 880 | continue; | 880 | continue; |
| 881 | if (unsuspend) | 881 | if (unsuspend) |
| 882 | status = vfs_quota_enable( | 882 | status = dquot_resume(sb, type); |
| 883 | sb_dqopt(sb)->files[type], | 883 | else { |
| 884 | type, QFMT_OCFS2, | 884 | struct ocfs2_mem_dqinfo *oinfo; |
| 885 | DQUOT_SUSPENDED); | 885 | |
| 886 | else | 886 | /* Cancel periodic syncing before suspending */ |
| 887 | status = vfs_quota_disable(sb, type, | 887 | oinfo = sb_dqinfo(sb, type)->dqi_priv; |
| 888 | DQUOT_SUSPENDED); | 888 | cancel_delayed_work_sync(&oinfo->dqi_sync_work); |
| 889 | status = dquot_suspend(sb, type); | ||
| 890 | } | ||
| 889 | if (status < 0) | 891 | if (status < 0) |
| 890 | break; | 892 | break; |
| 891 | } | 893 | } |
| @@ -916,8 +918,8 @@ static int ocfs2_enable_quotas(struct ocfs2_super *osb) | |||
| 916 | status = -ENOENT; | 918 | status = -ENOENT; |
| 917 | goto out_quota_off; | 919 | goto out_quota_off; |
| 918 | } | 920 | } |
| 919 | status = vfs_quota_enable(inode[type], type, QFMT_OCFS2, | 921 | status = dquot_enable(inode[type], type, QFMT_OCFS2, |
| 920 | DQUOT_USAGE_ENABLED); | 922 | DQUOT_USAGE_ENABLED); |
| 921 | if (status < 0) | 923 | if (status < 0) |
| 922 | goto out_quota_off; | 924 | goto out_quota_off; |
| 923 | } | 925 | } |
| @@ -952,8 +954,8 @@ static void ocfs2_disable_quotas(struct ocfs2_super *osb) | |||
| 952 | /* Turn off quotas. This will remove all dquot structures from | 954 | /* Turn off quotas. This will remove all dquot structures from |
| 953 | * memory and so they will be automatically synced to global | 955 | * memory and so they will be automatically synced to global |
| 954 | * quota files */ | 956 | * quota files */ |
| 955 | vfs_quota_disable(sb, type, DQUOT_USAGE_ENABLED | | 957 | dquot_disable(sb, type, DQUOT_USAGE_ENABLED | |
| 956 | DQUOT_LIMITS_ENABLED); | 958 | DQUOT_LIMITS_ENABLED); |
| 957 | if (!inode) | 959 | if (!inode) |
| 958 | continue; | 960 | continue; |
| 959 | iput(inode); | 961 | iput(inode); |
| @@ -962,7 +964,7 @@ static void ocfs2_disable_quotas(struct ocfs2_super *osb) | |||
| 962 | 964 | ||
| 963 | /* Handle quota on quotactl */ | 965 | /* Handle quota on quotactl */ |
| 964 | static int ocfs2_quota_on(struct super_block *sb, int type, int format_id, | 966 | static int ocfs2_quota_on(struct super_block *sb, int type, int format_id, |
| 965 | char *path, int remount) | 967 | char *path) |
| 966 | { | 968 | { |
| 967 | unsigned int feature[MAXQUOTAS] = { OCFS2_FEATURE_RO_COMPAT_USRQUOTA, | 969 | unsigned int feature[MAXQUOTAS] = { OCFS2_FEATURE_RO_COMPAT_USRQUOTA, |
| 968 | OCFS2_FEATURE_RO_COMPAT_GRPQUOTA}; | 970 | OCFS2_FEATURE_RO_COMPAT_GRPQUOTA}; |
| @@ -970,30 +972,24 @@ static int ocfs2_quota_on(struct super_block *sb, int type, int format_id, | |||
| 970 | if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type])) | 972 | if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type])) |
| 971 | return -EINVAL; | 973 | return -EINVAL; |
| 972 | 974 | ||
| 973 | if (remount) | 975 | return dquot_enable(sb_dqopt(sb)->files[type], type, |
| 974 | return 0; /* Just ignore it has been handled in | 976 | format_id, DQUOT_LIMITS_ENABLED); |
| 975 | * ocfs2_remount() */ | ||
| 976 | return vfs_quota_enable(sb_dqopt(sb)->files[type], type, | ||
| 977 | format_id, DQUOT_LIMITS_ENABLED); | ||
| 978 | } | 977 | } |
| 979 | 978 | ||
| 980 | /* Handle quota off quotactl */ | 979 | /* Handle quota off quotactl */ |
| 981 | static int ocfs2_quota_off(struct super_block *sb, int type, int remount) | 980 | static int ocfs2_quota_off(struct super_block *sb, int type) |
| 982 | { | 981 | { |
| 983 | if (remount) | 982 | return dquot_disable(sb, type, DQUOT_LIMITS_ENABLED); |
| 984 | return 0; /* Ignore now and handle later in | ||
| 985 | * ocfs2_remount() */ | ||
| 986 | return vfs_quota_disable(sb, type, DQUOT_LIMITS_ENABLED); | ||
| 987 | } | 983 | } |
| 988 | 984 | ||
| 989 | static const struct quotactl_ops ocfs2_quotactl_ops = { | 985 | static const struct quotactl_ops ocfs2_quotactl_ops = { |
| 990 | .quota_on = ocfs2_quota_on, | 986 | .quota_on = ocfs2_quota_on, |
| 991 | .quota_off = ocfs2_quota_off, | 987 | .quota_off = ocfs2_quota_off, |
| 992 | .quota_sync = vfs_quota_sync, | 988 | .quota_sync = dquot_quota_sync, |
| 993 | .get_info = vfs_get_dqinfo, | 989 | .get_info = dquot_get_dqinfo, |
| 994 | .set_info = vfs_set_dqinfo, | 990 | .set_info = dquot_set_dqinfo, |
| 995 | .get_dqblk = vfs_get_dqblk, | 991 | .get_dqblk = dquot_get_dqblk, |
| 996 | .set_dqblk = vfs_set_dqblk, | 992 | .set_dqblk = dquot_set_dqblk, |
| 997 | }; | 993 | }; |
| 998 | 994 | ||
| 999 | static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) | 995 | static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) |
