diff options
| author | Christoph Hellwig <hch@infradead.org> | 2010-05-19 07:16:41 -0400 |
|---|---|---|
| committer | Jan Kara <jack@suse.cz> | 2010-05-24 08:06:40 -0400 |
| commit | 0f0dd62fddcbd0f6830ed8ef3d3426ccc46b9250 (patch) | |
| tree | 295ac31b109f78873cb191867603943d8562ead0 | |
| parent | c79d967de3741ceb60c5bbbf1b6f97eab9a89838 (diff) | |
quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers
Instead of having wrappers in the VFS namespace export the dquot_suspend
and dquot_resume helpers directly. Also rename vfs_quota_disable to
dquot_disable while we're at it.
[Jan Kara: Moved dquot_suspend to quotaops.h and made it inline]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
| -rw-r--r-- | fs/ext2/super.c | 7 | ||||
| -rw-r--r-- | fs/ext3/super.c | 8 | ||||
| -rw-r--r-- | fs/ext4/super.c | 8 | ||||
| -rw-r--r-- | fs/jfs/super.c | 8 | ||||
| -rw-r--r-- | fs/ocfs2/super.c | 14 | ||||
| -rw-r--r-- | fs/quota/dquot.c | 77 | ||||
| -rw-r--r-- | fs/reiserfs/super.c | 8 | ||||
| -rw-r--r-- | fs/udf/super.c | 6 | ||||
| -rw-r--r-- | fs/ufs/super.c | 8 | ||||
| -rw-r--r-- | include/linux/quotaops.h | 31 |
10 files changed, 85 insertions, 90 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 73346de9af5c..318ebc58bb7b 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
| @@ -1250,9 +1250,8 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data) | |||
| 1250 | es->s_mtime = cpu_to_le32(get_seconds()); | 1250 | es->s_mtime = cpu_to_le32(get_seconds()); |
| 1251 | spin_unlock(&sbi->s_lock); | 1251 | spin_unlock(&sbi->s_lock); |
| 1252 | 1252 | ||
| 1253 | err = vfs_dq_off(sb, 1); | 1253 | err = dquot_suspend(sb, -1); |
| 1254 | if (err < 0 && err != -ENOSYS) { | 1254 | if (err < 0) { |
| 1255 | err = -EBUSY; | ||
| 1256 | spin_lock(&sbi->s_lock); | 1255 | spin_lock(&sbi->s_lock); |
| 1257 | goto restore_opts; | 1256 | goto restore_opts; |
| 1258 | } | 1257 | } |
| @@ -1281,7 +1280,7 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data) | |||
| 1281 | 1280 | ||
| 1282 | ext2_write_super(sb); | 1281 | ext2_write_super(sb); |
| 1283 | 1282 | ||
| 1284 | vfs_dq_quota_on_remount(sb); | 1283 | dquot_resume(sb, -1); |
| 1285 | } | 1284 | } |
| 1286 | 1285 | ||
| 1287 | return 0; | 1286 | return 0; |
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index d0f8837b6255..9d5e582b514a 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
| @@ -2598,11 +2598,9 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data) | |||
| 2598 | } | 2598 | } |
| 2599 | 2599 | ||
| 2600 | if (*flags & MS_RDONLY) { | 2600 | if (*flags & MS_RDONLY) { |
| 2601 | err = vfs_dq_off(sb, 1); | 2601 | err = dquot_suspend(sb, -1); |
| 2602 | if (err < 0 && err != -ENOSYS) { | 2602 | if (err < 0) |
| 2603 | err = -EBUSY; | ||
| 2604 | goto restore_opts; | 2603 | goto restore_opts; |
| 2605 | } | ||
| 2606 | 2604 | ||
| 2607 | /* | 2605 | /* |
| 2608 | * First of all, the unconditional stuff we have to do | 2606 | * First of all, the unconditional stuff we have to do |
| @@ -2672,7 +2670,7 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data) | |||
| 2672 | unlock_kernel(); | 2670 | unlock_kernel(); |
| 2673 | 2671 | ||
| 2674 | if (enable_quota) | 2672 | if (enable_quota) |
| 2675 | vfs_dq_quota_on_remount(sb); | 2673 | dquot_resume(sb, -1); |
| 2676 | return 0; | 2674 | return 0; |
| 2677 | restore_opts: | 2675 | restore_opts: |
| 2678 | sb->s_flags = old_sb_flags; | 2676 | sb->s_flags = old_sb_flags; |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index fb1e191d0fa9..08d31101eb05 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
| @@ -3631,11 +3631,9 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) | |||
| 3631 | } | 3631 | } |
| 3632 | 3632 | ||
| 3633 | if (*flags & MS_RDONLY) { | 3633 | if (*flags & MS_RDONLY) { |
| 3634 | err = vfs_dq_off(sb, 1); | 3634 | err = dquot_suspend(sb, -1); |
| 3635 | if (err < 0 && err != -ENOSYS) { | 3635 | if (err < 0) |
| 3636 | err = -EBUSY; | ||
| 3637 | goto restore_opts; | 3636 | goto restore_opts; |
| 3638 | } | ||
| 3639 | 3637 | ||
| 3640 | /* | 3638 | /* |
| 3641 | * First of all, the unconditional stuff we have to do | 3639 | * First of all, the unconditional stuff we have to do |
| @@ -3722,7 +3720,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) | |||
| 3722 | unlock_super(sb); | 3720 | unlock_super(sb); |
| 3723 | unlock_kernel(); | 3721 | unlock_kernel(); |
| 3724 | if (enable_quota) | 3722 | if (enable_quota) |
| 3725 | vfs_dq_quota_on_remount(sb); | 3723 | dquot_resume(sb, -1); |
| 3726 | return 0; | 3724 | return 0; |
| 3727 | 3725 | ||
| 3728 | restore_opts: | 3726 | restore_opts: |
diff --git a/fs/jfs/super.c b/fs/jfs/super.c index 5329d66a9704..b8a07d4c108e 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c | |||
| @@ -401,14 +401,14 @@ static int jfs_remount(struct super_block *sb, int *flags, char *data) | |||
| 401 | sb->s_flags &= ~MS_RDONLY; | 401 | sb->s_flags &= ~MS_RDONLY; |
| 402 | 402 | ||
| 403 | unlock_kernel(); | 403 | unlock_kernel(); |
| 404 | vfs_dq_quota_on_remount(sb); | 404 | dquot_resume(sb, -1); |
| 405 | return ret; | 405 | return ret; |
| 406 | } | 406 | } |
| 407 | if ((!(sb->s_flags & MS_RDONLY)) && (*flags & MS_RDONLY)) { | 407 | if ((!(sb->s_flags & MS_RDONLY)) && (*flags & MS_RDONLY)) { |
| 408 | rc = vfs_dq_off(sb, 1); | 408 | rc = dquot_suspend(sb, -1); |
| 409 | if (rc < 0 && rc != -ENOSYS) { | 409 | if (rc < 0) { |
| 410 | unlock_kernel(); | 410 | unlock_kernel(); |
| 411 | return -EBUSY; | 411 | return rc; |
| 412 | } | 412 | } |
| 413 | rc = jfs_umount_rw(sb); | 413 | rc = jfs_umount_rw(sb); |
| 414 | JFS_SBI(sb)->flag = flag; | 414 | JFS_SBI(sb)->flag = flag; |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 66f9984a983c..0773873d590a 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
| @@ -879,18 +879,14 @@ 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], | ||
| 884 | type, QFMT_OCFS2, | ||
| 885 | DQUOT_SUSPENDED); | ||
| 886 | else { | 883 | else { |
| 887 | struct ocfs2_mem_dqinfo *oinfo; | 884 | struct ocfs2_mem_dqinfo *oinfo; |
| 888 | 885 | ||
| 889 | /* Cancel periodic syncing before suspending */ | 886 | /* Cancel periodic syncing before suspending */ |
| 890 | oinfo = sb_dqinfo(sb, type)->dqi_priv; | 887 | oinfo = sb_dqinfo(sb, type)->dqi_priv; |
| 891 | cancel_delayed_work_sync(&oinfo->dqi_sync_work); | 888 | cancel_delayed_work_sync(&oinfo->dqi_sync_work); |
| 892 | status = vfs_quota_disable(sb, type, | 889 | status = dquot_suspend(sb, type); |
| 893 | DQUOT_SUSPENDED); | ||
| 894 | } | 890 | } |
| 895 | if (status < 0) | 891 | if (status < 0) |
| 896 | break; | 892 | break; |
| @@ -958,8 +954,8 @@ static void ocfs2_disable_quotas(struct ocfs2_super *osb) | |||
| 958 | /* Turn off quotas. This will remove all dquot structures from | 954 | /* Turn off quotas. This will remove all dquot structures from |
| 959 | * memory and so they will be automatically synced to global | 955 | * memory and so they will be automatically synced to global |
| 960 | * quota files */ | 956 | * quota files */ |
| 961 | vfs_quota_disable(sb, type, DQUOT_USAGE_ENABLED | | 957 | dquot_disable(sb, type, DQUOT_USAGE_ENABLED | |
| 962 | DQUOT_LIMITS_ENABLED); | 958 | DQUOT_LIMITS_ENABLED); |
| 963 | if (!inode) | 959 | if (!inode) |
| 964 | continue; | 960 | continue; |
| 965 | iput(inode); | 961 | iput(inode); |
| @@ -989,7 +985,7 @@ static int ocfs2_quota_off(struct super_block *sb, int type, int remount) | |||
| 989 | if (remount) | 985 | if (remount) |
| 990 | return 0; /* Ignore now and handle later in | 986 | return 0; /* Ignore now and handle later in |
| 991 | * ocfs2_remount() */ | 987 | * ocfs2_remount() */ |
| 992 | return vfs_quota_disable(sb, type, DQUOT_LIMITS_ENABLED); | 988 | return dquot_disable(sb, type, DQUOT_LIMITS_ENABLED); |
| 993 | } | 989 | } |
| 994 | 990 | ||
| 995 | static const struct quotactl_ops ocfs2_quotactl_ops = { | 991 | static const struct quotactl_ops ocfs2_quotactl_ops = { |
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 655a4c52b8c3..cf972283e474 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c | |||
| @@ -1865,7 +1865,7 @@ EXPORT_SYMBOL(dquot_file_open); | |||
| 1865 | /* | 1865 | /* |
| 1866 | * Turn quota off on a device. type == -1 ==> quotaoff for all types (umount) | 1866 | * Turn quota off on a device. type == -1 ==> quotaoff for all types (umount) |
| 1867 | */ | 1867 | */ |
| 1868 | int vfs_quota_disable(struct super_block *sb, int type, unsigned int flags) | 1868 | int dquot_disable(struct super_block *sb, int type, unsigned int flags) |
| 1869 | { | 1869 | { |
| 1870 | int cnt, ret = 0; | 1870 | int cnt, ret = 0; |
| 1871 | struct quota_info *dqopt = sb_dqopt(sb); | 1871 | struct quota_info *dqopt = sb_dqopt(sb); |
| @@ -1995,14 +1995,16 @@ put_inodes: | |||
| 1995 | } | 1995 | } |
| 1996 | return ret; | 1996 | return ret; |
| 1997 | } | 1997 | } |
| 1998 | EXPORT_SYMBOL(vfs_quota_disable); | ||
