* [PATCH 1/6] dquot: move remount handling into the filesystem
2010-05-19 11:16 [PATCH 0/6] more quota cleanups V2 Christoph Hellwig
@ 2010-05-19 11:16 ` Christoph Hellwig
2010-05-19 11:16 ` [PATCH 2/6] quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers Christoph Hellwig
` (5 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Christoph Hellwig @ 2010-05-19 11:16 UTC (permalink / raw)
To: jack; +Cc: linux-fsdevel
[-- Attachment #1: quota-move-remount --]
[-- Type: text/plain, Size: 9747 bytes --]
Currently do_remount_sb calls into the dquot code to tell it about going
from rw to ro and ro to rw. Move this code into the filesystem to
not depend on the dquot code in the VFS - note ocfs2 already ignores
these calls and handles remount by itself. This gets rif of overloading
the quotactl calls and allows to unify the VFS and XFS codepathes in
that area later.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/fs/ext2/super.c
===================================================================
--- linux-2.6.orig/fs/ext2/super.c 2010-05-19 10:47:34.563253960 +0200
+++ linux-2.6/fs/ext2/super.c 2010-05-19 12:53:30.546008046 +0200
@@ -1241,6 +1241,7 @@ static int ext2_remount (struct super_bl
spin_unlock(&sbi->s_lock);
return 0;
}
+
/*
* OK, we are remounting a valid rw partition rdonly, so set
* the rdonly flag and then mark the partition as valid again.
@@ -1248,6 +1249,14 @@ static int ext2_remount (struct super_bl
es->s_state = cpu_to_le16(sbi->s_mount_state);
es->s_mtime = cpu_to_le32(get_seconds());
spin_unlock(&sbi->s_lock);
+
+ err = vfs_dq_off(sb, 1);
+ if (err < 0 && err != -ENOSYS) {
+ err = -EBUSY;
+ spin_lock(&sbi->s_lock);
+ goto restore_opts;
+ }
+
ext2_sync_super(sb, es, 1);
} else {
__le32 ret = EXT2_HAS_RO_COMPAT_FEATURE(sb,
@@ -1269,8 +1278,12 @@ static int ext2_remount (struct super_bl
if (!ext2_setup_super (sb, es, 0))
sb->s_flags &= ~MS_RDONLY;
spin_unlock(&sbi->s_lock);
+
ext2_write_super(sb);
+
+ vfs_dq_quota_on_remount(sb);
}
+
return 0;
restore_opts:
sbi->s_mount_opt = old_opts.s_mount_opt;
Index: linux-2.6/fs/ext3/super.c
===================================================================
--- linux-2.6.orig/fs/ext3/super.c 2010-05-19 10:47:34.566253960 +0200
+++ linux-2.6/fs/ext3/super.c 2010-05-19 12:43:25.619254659 +0200
@@ -2551,6 +2551,7 @@ static int ext3_remount (struct super_bl
ext3_fsblk_t n_blocks_count = 0;
unsigned long old_sb_flags;
struct ext3_mount_options old_opts;
+ int enable_quota = 0;
int err;
#ifdef CONFIG_QUOTA
int i;
@@ -2597,6 +2598,12 @@ static int ext3_remount (struct super_bl
}
if (*flags & MS_RDONLY) {
+ err = vfs_dq_off(sb, 1);
+ if (err < 0 && err != -ENOSYS) {
+ err = -EBUSY;
+ goto restore_opts;
+ }
+
/*
* First of all, the unconditional stuff we have to do
* to disable replay of the journal when we next remount
@@ -2651,6 +2658,7 @@ static int ext3_remount (struct super_bl
goto restore_opts;
if (!ext3_setup_super (sb, es, 0))
sb->s_flags &= ~MS_RDONLY;
+ enable_quota = 1;
}
}
#ifdef CONFIG_QUOTA
@@ -2662,6 +2670,9 @@ static int ext3_remount (struct super_bl
#endif
unlock_super(sb);
unlock_kernel();
+
+ if (enable_quota)
+ vfs_dq_quota_on_remount(sb);
return 0;
restore_opts:
sb->s_flags = old_sb_flags;
Index: linux-2.6/fs/ext4/super.c
===================================================================
--- linux-2.6.orig/fs/ext4/super.c 2010-05-19 09:59:58.796003925 +0200
+++ linux-2.6/fs/ext4/super.c 2010-05-19 12:43:25.626004205 +0200
@@ -3574,6 +3574,7 @@ static int ext4_remount(struct super_blo
ext4_fsblk_t n_blocks_count = 0;
unsigned long old_sb_flags;
struct ext4_mount_options old_opts;
+ int enable_quota = 0;
ext4_group_t g;
unsigned int journal_ioprio = DEFAULT_JOURNAL_IOPRIO;
int err;
@@ -3630,6 +3631,12 @@ static int ext4_remount(struct super_blo
}
if (*flags & MS_RDONLY) {
+ err = vfs_dq_off(sb, 1);
+ if (err < 0 && err != -ENOSYS) {
+ err = -EBUSY;
+ goto restore_opts;
+ }
+
/*
* First of all, the unconditional stuff we have to do
* to disable replay of the journal when we next remount
@@ -3698,6 +3705,7 @@ static int ext4_remount(struct super_blo
goto restore_opts;
if (!ext4_setup_super(sb, es, 0))
sb->s_flags &= ~MS_RDONLY;
+ enable_quota = 1;
}
}
ext4_setup_system_zone(sb);
@@ -3713,6 +3721,8 @@ static int ext4_remount(struct super_blo
#endif
unlock_super(sb);
unlock_kernel();
+ if (enable_quota)
+ vfs_dq_quota_on_remount(sb);
return 0;
restore_opts:
Index: linux-2.6/fs/jfs/super.c
===================================================================
--- linux-2.6.orig/fs/jfs/super.c 2010-05-19 10:47:34.571253820 +0200
+++ linux-2.6/fs/jfs/super.c 2010-05-19 12:50:17.873214499 +0200
@@ -396,10 +396,20 @@ static int jfs_remount(struct super_bloc
JFS_SBI(sb)->flag = flag;
ret = jfs_mount_rw(sb, 1);
+
+ /* mark the fs r/w for quota activity */
+ sb->s_flags &= ~MS_RDONLY;
+
unlock_kernel();
+ vfs_dq_quota_on_remount(sb);
return ret;
}
if ((!(sb->s_flags & MS_RDONLY)) && (*flags & MS_RDONLY)) {
+ rc = vfs_dq_off(sb, 1);
+ if (rc < 0 && rc != -ENOSYS) {
+ unlock_kernel();
+ return -EBUSY;
+ }
rc = jfs_umount_rw(sb);
JFS_SBI(sb)->flag = flag;
unlock_kernel();
Index: linux-2.6/fs/reiserfs/super.c
===================================================================
--- linux-2.6.orig/fs/reiserfs/super.c 2010-05-19 09:59:59.117004065 +0200
+++ linux-2.6/fs/reiserfs/super.c 2010-05-19 12:43:25.636003367 +0200
@@ -1242,6 +1242,13 @@ static int reiserfs_remount(struct super
if (s->s_flags & MS_RDONLY)
/* it is read-only already */
goto out_ok;
+
+ err = vfs_dq_off(s, 1);
+ if (err < 0 && err != -ENOSYS) {
+ err = -EBUSY;
+ goto out_err;
+ }
+
/* try to remount file system with read-only permissions */
if (sb_umount_state(rs) == REISERFS_VALID_FS
|| REISERFS_SB(s)->s_mount_state != REISERFS_VALID_FS) {
@@ -1297,6 +1304,7 @@ static int reiserfs_remount(struct super
if (!(*mount_flags & MS_RDONLY)) {
finish_unfinished(s);
reiserfs_xattr_init(s, *mount_flags);
+ vfs_dq_quota_on_remount(s);
}
out_ok:
Index: linux-2.6/fs/ufs/super.c
===================================================================
--- linux-2.6.orig/fs/ufs/super.c 2010-05-19 09:59:59.173275471 +0200
+++ linux-2.6/fs/ufs/super.c 2010-05-19 12:43:25.643003786 +0200
@@ -1248,7 +1248,9 @@ static int ufs_remount (struct super_blo
struct ufs_super_block_first * usb1;
struct ufs_super_block_third * usb3;
unsigned new_mount_opt, ufstype;
+ int enable_quota = 0;
unsigned flags;
+ int err;
lock_kernel();
lock_super(sb);
@@ -1289,6 +1291,13 @@ static int ufs_remount (struct super_blo
* fs was mouted as rw, remounting ro
*/
if (*mount_flags & MS_RDONLY) {
+ err = vfs_dq_off(sb, 1);
+ if (err < 0 && err != -ENOSYS) {
+ unlock_super(sb);
+ unlock_kernel();
+ return -EBUSY;
+ }
+
ufs_put_super_internal(sb);
usb1->fs_time = cpu_to_fs32(sb, get_seconds());
if ((flags & UFS_ST_MASK) == UFS_ST_SUN
@@ -1327,11 +1336,14 @@ static int ufs_remount (struct super_blo
return -EPERM;
}
sb->s_flags &= ~MS_RDONLY;
+ enable_quota = 1;
#endif
}
UFS_SB(sb)->s_mount_opt = new_mount_opt;
unlock_super(sb);
unlock_kernel();
+ if (enable_quota)
+ vfs_dq_quota_on_remount(sb);
return 0;
}
Index: linux-2.6/fs/super.c
===================================================================
--- linux-2.6.orig/fs/super.c 2010-05-19 10:47:34.597253401 +0200
+++ linux-2.6/fs/super.c 2010-05-19 12:43:25.650003367 +0200
@@ -568,7 +568,7 @@ out:
int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
{
int retval;
- int remount_rw, remount_ro;
+ int remount_ro;
if (sb->s_frozen != SB_UNFROZEN)
return -EBUSY;
@@ -584,7 +584,6 @@ int do_remount_sb(struct super_block *sb
sync_filesystem(sb);
remount_ro = (flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY);
- remount_rw = !(flags & MS_RDONLY) && (sb->s_flags & MS_RDONLY);
/* If we are remounting RDONLY and current sb is read/write,
make sure there are no rw files opened */
@@ -593,9 +592,6 @@ int do_remount_sb(struct super_block *sb
mark_files_ro(sb);
else if (!fs_may_remount_ro(sb))
return -EBUSY;
- retval = vfs_dq_off(sb, 1);
- if (retval < 0 && retval != -ENOSYS)
- return -EBUSY;
}
if (sb->s_op->remount_fs) {
@@ -604,8 +600,7 @@ int do_remount_sb(struct super_block *sb
return retval;
}
sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK);
- if (remount_rw)
- vfs_dq_quota_on_remount(sb);
+
/*
* Some filesystems modify their metadata via some other path than the
* bdev buffer cache (eg. use a private mapping, or directories in
Index: linux-2.6/fs/udf/super.c
===================================================================
--- linux-2.6.orig/fs/udf/super.c 2010-05-19 12:45:17.269011887 +0200
+++ linux-2.6/fs/udf/super.c 2010-05-19 12:53:46.671007906 +0200
@@ -54,6 +54,7 @@
#include <linux/vmalloc.h>
#include <linux/errno.h>
#include <linux/mount.h>
+#include <linux/quotaops.h>
#include <linux/seq_file.h>
#include <linux/bitmap.h>
#include <linux/crc-itu-t.h>
@@ -557,6 +558,7 @@ static int udf_remount_fs(struct super_b
{
struct udf_options uopt;
struct udf_sb_info *sbi = UDF_SB(sb);
+ int error = 0;
uopt.flags = sbi->s_flags;
uopt.uid = sbi->s_uid;
@@ -582,17 +584,26 @@ static int udf_remount_fs(struct super_b
*flags |= MS_RDONLY;
}
- if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) {
- unlock_kernel();
- return 0;
- }
- if (*flags & MS_RDONLY)
+ if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
+ goto out_unlock;
+
+ if (*flags & MS_RDONLY) {
udf_close_lvid(sb);
- else
+
+ error = vfs_dq_off(sb, 1);
+ if (error < 0 && error != -ENOSYS)
+ error = -EBUSY;
+ } else {
udf_open_lvid(sb);
+ /* mark the fs r/w for quota activity */
+ sb->s_flags &= ~MS_RDONLY;
+ vfs_dq_quota_on_remount(sb);
+ }
+
+out_unlock:
unlock_kernel();
- return 0;
+ return error;
}
/* Check Volume Structure Descriptors (ECMA 167 2/9.1) */
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/6] quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers
2010-05-19 11:16 [PATCH 0/6] more quota cleanups V2 Christoph Hellwig
2010-05-19 11:16 ` [PATCH 1/6] dquot: move remount handling into the filesystem Christoph Hellwig
@ 2010-05-19 11:16 ` Christoph Hellwig
2010-05-19 11:16 ` [PATCH 3/6] dquot: move unmount handling into the filesystem Christoph Hellwig
` (4 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Christoph Hellwig @ 2010-05-19 11:16 UTC (permalink / raw)
To: jack; +Cc: linux-fsdevel
[-- Attachment #1: quota-kill-remount --]
[-- Type: text/plain, Size: 13414 bytes --]
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.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/fs/quota/dquot.c
===================================================================
--- linux-2.6.orig/fs/quota/dquot.c 2010-05-19 10:47:34.592253960 +0200
+++ linux-2.6/fs/quota/dquot.c 2010-05-19 12:54:25.311005741 +0200
@@ -1865,7 +1865,7 @@ EXPORT_SYMBOL(dquot_file_open);
/*
* Turn quota off on a device. type == -1 ==> quotaoff for all types (umount)
*/
-int vfs_quota_disable(struct super_block *sb, int type, unsigned int flags)
+int dquot_disable(struct super_block *sb, int type, unsigned int flags)
{
int cnt, ret = 0;
struct quota_info *dqopt = sb_dqopt(sb);
@@ -1995,14 +1995,16 @@ put_inodes:
}
return ret;
}
-EXPORT_SYMBOL(vfs_quota_disable);
+EXPORT_SYMBOL(dquot_disable);
int vfs_quota_off(struct super_block *sb, int type, int remount)
{
- return vfs_quota_disable(sb, type, remount ? DQUOT_SUSPENDED :
- (DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED));
+ BUG_ON(remount);
+ return dquot_disable(sb, type,
+ DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
}
EXPORT_SYMBOL(vfs_quota_off);
+
/*
* Turn quotas on on a device
*/
@@ -2119,35 +2121,48 @@ out_fmt:
return error;
}
+/* Suspend quotas on remount RO */
+int dquot_suspend(struct super_block *sb, int type)
+{
+ return dquot_disable(sb, type, DQUOT_SUSPENDED);
+}
+
/* Reenable quotas on remount RW */
-static int vfs_quota_on_remount(struct super_block *sb, int type)
+int dquot_resume(struct super_block *sb, int type)
{
struct quota_info *dqopt = sb_dqopt(sb);
struct inode *inode;
- int ret;
+ int ret = 0, cnt;
unsigned int flags;
- mutex_lock(&dqopt->dqonoff_mutex);
- if (!sb_has_quota_suspended(sb, type)) {
+ for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
+ if (type != -1 && cnt != type)
+ continue;
+
+ mutex_lock(&dqopt->dqonoff_mutex);
+ if (!sb_has_quota_suspended(sb, cnt)) {
+ mutex_unlock(&dqopt->dqonoff_mutex);
+ continue;
+ }
+ inode = dqopt->files[cnt];
+ dqopt->files[cnt] = NULL;
+ spin_lock(&dq_state_lock);
+ flags = dqopt->flags & dquot_state_flag(DQUOT_USAGE_ENABLED |
+ DQUOT_LIMITS_ENABLED,
+ cnt);
+ dqopt->flags &= ~dquot_state_flag(DQUOT_STATE_FLAGS, cnt);
+ spin_unlock(&dq_state_lock);
mutex_unlock(&dqopt->dqonoff_mutex);
- return 0;
- }
- inode = dqopt->files[type];
- dqopt->files[type] = NULL;
- spin_lock(&dq_state_lock);
- flags = dqopt->flags & dquot_state_flag(DQUOT_USAGE_ENABLED |
- DQUOT_LIMITS_ENABLED, type);
- dqopt->flags &= ~dquot_state_flag(DQUOT_STATE_FLAGS, type);
- spin_unlock(&dq_state_lock);
- mutex_unlock(&dqopt->dqonoff_mutex);
- flags = dquot_generic_flag(flags, type);
- ret = vfs_load_quota_inode(inode, type, dqopt->info[type].dqi_fmt_id,
- flags);
- iput(inode);
+ flags = dquot_generic_flag(flags, cnt);
+ ret = vfs_load_quota_inode(inode, cnt,
+ dqopt->info[cnt].dqi_fmt_id, flags);
+ iput(inode);
+ }
return ret;
}
+EXPORT_SYMBOL(dquot_resume);
int vfs_quota_on_path(struct super_block *sb, int type, int format_id,
struct path *path)
@@ -2172,8 +2187,7 @@ int vfs_quota_on(struct super_block *sb,
struct path path;
int error;
- if (remount)
- return vfs_quota_on_remount(sb, type);
+ BUG_ON(remount);
error = kern_path(name, LOOKUP_FOLLOW, &path);
if (!error) {
@@ -2196,8 +2210,8 @@ int vfs_quota_enable(struct inode *inode
struct quota_info *dqopt = sb_dqopt(sb);
/* Just unsuspend quotas? */
- if (flags & DQUOT_SUSPENDED)
- return vfs_quota_on_remount(sb, type);
+ BUG_ON(flags & DQUOT_SUSPENDED);
+
if (!flags)
return 0;
/* Just updating flags needed? */
@@ -2263,23 +2277,6 @@ out:
}
EXPORT_SYMBOL(vfs_quota_on_mount);
-/* Wrapper to turn on quotas when remounting rw */
-int vfs_dq_quota_on_remount(struct super_block *sb)
-{
- int cnt;
- int ret = 0, err;
-
- if (!sb->s_qcop || !sb->s_qcop->quota_on)
- return -ENOSYS;
- for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
- err = sb->s_qcop->quota_on(sb, cnt, 0, NULL, 1);
- if (err < 0 && !ret)
- ret = err;
- }
- return ret;
-}
-EXPORT_SYMBOL(vfs_dq_quota_on_remount);
-
static inline qsize_t qbtos(qsize_t blocks)
{
return blocks << QIF_DQBLKSIZE_BITS;
Index: linux-2.6/fs/ext2/super.c
===================================================================
--- linux-2.6.orig/fs/ext2/super.c 2010-05-19 12:53:30.000000000 +0200
+++ linux-2.6/fs/ext2/super.c 2010-05-19 12:54:52.992255707 +0200
@@ -1250,9 +1250,8 @@ static int ext2_remount (struct super_bl
es->s_mtime = cpu_to_le32(get_seconds());
spin_unlock(&sbi->s_lock);
- err = vfs_dq_off(sb, 1);
- if (err < 0 && err != -ENOSYS) {
- err = -EBUSY;
+ err = dquot_suspend(sb, -1);
+ if (err < 0) {
spin_lock(&sbi->s_lock);
goto restore_opts;
}
@@ -1281,7 +1280,7 @@ static int ext2_remount (struct super_bl
ext2_write_super(sb);
- vfs_dq_quota_on_remount(sb);
+ dquot_resume(sb, -1);
}
return 0;
Index: linux-2.6/fs/ext3/super.c
===================================================================
--- linux-2.6.orig/fs/ext3/super.c 2010-05-19 12:43:25.000000000 +0200
+++ linux-2.6/fs/ext3/super.c 2010-05-19 12:54:25.315004205 +0200
@@ -2598,11 +2598,9 @@ static int ext3_remount (struct super_bl
}
if (*flags & MS_RDONLY) {
- err = vfs_dq_off(sb, 1);
- if (err < 0 && err != -ENOSYS) {
- err = -EBUSY;
+ err = dquot_suspend(sb, -1);
+ if (err < 0)
goto restore_opts;
- }
/*
* First of all, the unconditional stuff we have to do
@@ -2672,7 +2670,7 @@ static int ext3_remount (struct super_bl
unlock_kernel();
if (enable_quota)
- vfs_dq_quota_on_remount(sb);
+ dquot_resume(sb, -1);
return 0;
restore_opts:
sb->s_flags = old_sb_flags;
Index: linux-2.6/fs/ext4/super.c
===================================================================
--- linux-2.6.orig/fs/ext4/super.c 2010-05-19 12:43:25.000000000 +0200
+++ linux-2.6/fs/ext4/super.c 2010-05-19 12:54:25.319004274 +0200
@@ -3631,11 +3631,9 @@ static int ext4_remount(struct super_blo
}
if (*flags & MS_RDONLY) {
- err = vfs_dq_off(sb, 1);
- if (err < 0 && err != -ENOSYS) {
- err = -EBUSY;
+ err = dquot_suspend(sb, -1);
+ if (err < 0)
goto restore_opts;
- }
/*
* First of all, the unconditional stuff we have to do
@@ -3722,7 +3720,7 @@ static int ext4_remount(struct super_blo
unlock_super(sb);
unlock_kernel();
if (enable_quota)
- vfs_dq_quota_on_remount(sb);
+ dquot_resume(sb, -1);
return 0;
restore_opts:
Index: linux-2.6/fs/jfs/super.c
===================================================================
--- linux-2.6.orig/fs/jfs/super.c 2010-05-19 12:50:17.000000000 +0200
+++ linux-2.6/fs/jfs/super.c 2010-05-19 12:54:25.321004135 +0200
@@ -401,14 +401,14 @@ static int jfs_remount(struct super_bloc
sb->s_flags &= ~MS_RDONLY;
unlock_kernel();
- vfs_dq_quota_on_remount(sb);
+ dquot_resume(sb, -1);
return ret;
}
if ((!(sb->s_flags & MS_RDONLY)) && (*flags & MS_RDONLY)) {
- rc = vfs_dq_off(sb, 1);
- if (rc < 0 && rc != -ENOSYS) {
+ rc = dquot_suspend(sb, -1);
+ if (rc < 0) {
unlock_kernel();
- return -EBUSY;
+ return rc;
}
rc = jfs_umount_rw(sb);
JFS_SBI(sb)->flag = flag;
Index: linux-2.6/fs/ocfs2/super.c
===================================================================
--- linux-2.6.orig/fs/ocfs2/super.c 2010-05-19 10:47:34.000000000 +0200
+++ linux-2.6/fs/ocfs2/super.c 2010-05-19 12:54:25.326024459 +0200
@@ -873,13 +873,9 @@ static int ocfs2_susp_quotas(struct ocfs
if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type]))
continue;
if (unsuspend)
- status = vfs_quota_enable(
- sb_dqopt(sb)->files[type],
- type, QFMT_OCFS2,
- DQUOT_SUSPENDED);
+ status = dquot_resume(sb, type);
else
- status = vfs_quota_disable(sb, type,
- DQUOT_SUSPENDED);
+ status = dquot_suspend(sb, type);
if (status < 0)
break;
}
@@ -946,8 +942,8 @@ static void ocfs2_disable_quotas(struct
/* Turn off quotas. This will remove all dquot structures from
* memory and so they will be automatically synced to global
* quota files */
- vfs_quota_disable(sb, type, DQUOT_USAGE_ENABLED |
- DQUOT_LIMITS_ENABLED);
+ dquot_disable(sb, type, DQUOT_USAGE_ENABLED |
+ DQUOT_LIMITS_ENABLED);
if (!inode)
continue;
iput(inode);
@@ -977,7 +973,7 @@ static int ocfs2_quota_off(struct super_
if (remount)
return 0; /* Ignore now and handle later in
* ocfs2_remount() */
- return vfs_quota_disable(sb, type, DQUOT_LIMITS_ENABLED);
+ return dquot_disable(sb, type, DQUOT_LIMITS_ENABLED);
}
static const struct quotactl_ops ocfs2_quotactl_ops = {
Index: linux-2.6/fs/reiserfs/super.c
===================================================================
--- linux-2.6.orig/fs/reiserfs/super.c 2010-05-19 12:43:25.000000000 +0200
+++ linux-2.6/fs/reiserfs/super.c 2010-05-19 12:54:25.329035703 +0200
@@ -1243,11 +1243,9 @@ static int reiserfs_remount(struct super
/* it is read-only already */
goto out_ok;
- err = vfs_dq_off(s, 1);
- if (err < 0 && err != -ENOSYS) {
- err = -EBUSY;
+ err = dquot_suspend(s, -1);
+ if (err < 0)
goto out_err;
- }
/* try to remount file system with read-only permissions */
if (sb_umount_state(rs) == REISERFS_VALID_FS
@@ -1304,7 +1302,7 @@ static int reiserfs_remount(struct super
if (!(*mount_flags & MS_RDONLY)) {
finish_unfinished(s);
reiserfs_xattr_init(s, *mount_flags);
- vfs_dq_quota_on_remount(s);
+ dquot_resume(s, -1);
}
out_ok:
Index: linux-2.6/fs/ufs/super.c
===================================================================
--- linux-2.6.orig/fs/ufs/super.c 2010-05-19 12:43:25.000000000 +0200
+++ linux-2.6/fs/ufs/super.c 2010-05-19 12:54:25.336004274 +0200
@@ -1291,11 +1291,11 @@ static int ufs_remount (struct super_blo
* fs was mouted as rw, remounting ro
*/
if (*mount_flags & MS_RDONLY) {
- err = vfs_dq_off(sb, 1);
- if (err < 0 && err != -ENOSYS) {
+ err = dquot_suspend(sb, -1);
+ if (err < 0) {
unlock_super(sb);
unlock_kernel();
- return -EBUSY;
+ return err;
}
ufs_put_super_internal(sb);
@@ -1343,7 +1343,7 @@ static int ufs_remount (struct super_blo
unlock_super(sb);
unlock_kernel();
if (enable_quota)
- vfs_dq_quota_on_remount(sb);
+ dquot_resume(sb, -1);
return 0;
}
Index: linux-2.6/include/linux/quotaops.h
===================================================================
--- linux-2.6.orig/include/linux/quotaops.h 2010-05-19 10:47:34.629253262 +0200
+++ linux-2.6/include/linux/quotaops.h 2010-05-19 12:54:25.341003855 +0200
@@ -50,6 +50,10 @@ int dquot_alloc_inode(const struct inode
int dquot_claim_space_nodirty(struct inode *inode, qsize_t number);
void dquot_free_inode(const struct inode *inode);
+int dquot_disable(struct super_block *sb, int type, unsigned int flags);
+int dquot_suspend(struct super_block *sb, int type);
+int dquot_resume(struct super_block *sb, int type);
+
int dquot_commit(struct dquot *dquot);
int dquot_acquire(struct dquot *dquot);
int dquot_release(struct dquot *dquot);
@@ -67,7 +71,6 @@ int vfs_quota_on_path(struct super_block
int vfs_quota_on_mount(struct super_block *sb, char *qf_name,
int format_id, int type);
int vfs_quota_off(struct super_block *sb, int type, int remount);
-int vfs_quota_disable(struct super_block *sb, int type, unsigned int flags);
int vfs_quota_sync(struct super_block *sb, int type, int wait);
int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
@@ -78,7 +81,6 @@ int vfs_set_dqblk(struct super_block *sb
int __dquot_transfer(struct inode *inode, struct dquot **transfer_to);
int dquot_transfer(struct inode *inode, struct iattr *iattr);
-int vfs_dq_quota_on_remount(struct super_block *sb);
static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type)
{
@@ -231,11 +233,6 @@ static inline int vfs_dq_off(struct supe
return 0;
}
-static inline int vfs_dq_quota_on_remount(struct super_block *sb)
-{
- return 0;
-}
-
static inline int dquot_transfer(struct inode *inode, struct iattr *iattr)
{
return 0;
@@ -262,6 +259,22 @@ static inline int dquot_claim_space_nodi
return 0;
}
+static inline int dquot_disable(struct super_block *sb, int type,
+ unsigned int flags)
+{
+ return 0;
+}
+
+static inline int dquot_suspend(struct super_block *sb, int type)
+{
+ return 0;
+}
+
+static inline int dquot_resume(struct super_block *sb, int type)
+{
+ return 0;
+}
+
#define dquot_file_open generic_file_open
#endif /* CONFIG_QUOTA */
Index: linux-2.6/fs/udf/super.c
===================================================================
--- linux-2.6.orig/fs/udf/super.c 2010-05-19 12:55:38.596254309 +0200
+++ linux-2.6/fs/udf/super.c 2010-05-19 12:56:29.316255985 +0200
@@ -590,15 +590,13 @@ static int udf_remount_fs(struct super_b
if (*flags & MS_RDONLY) {
udf_close_lvid(sb);
- error = vfs_dq_off(sb, 1);
- if (error < 0 && error != -ENOSYS)
- error = -EBUSY;
+ error = dquot_suspend(sb, -1);
} else {
udf_open_lvid(sb);
/* mark the fs r/w for quota activity */
sb->s_flags &= ~MS_RDONLY;
- vfs_dq_quota_on_remount(sb);
+ dquot_resume(sb, -1);
}
out_unlock:
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 3/6] dquot: move unmount handling into the filesystem
2010-05-19 11:16 [PATCH 0/6] more quota cleanups V2 Christoph Hellwig
2010-05-19 11:16 ` [PATCH 1/6] dquot: move remount handling into the filesystem Christoph Hellwig
2010-05-19 11:16 ` [PATCH 2/6] quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers Christoph Hellwig
@ 2010-05-19 11:16 ` Christoph Hellwig
2010-05-19 11:16 ` [PATCH 4/6] quota: drop remount argument to ->quota_on and ->quota_off Christoph Hellwig
` (3 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Christoph Hellwig @ 2010-05-19 11:16 UTC (permalink / raw)
To: jack; +Cc: linux-fsdevel
[-- Attachment #1: quota-move-umount --]
[-- Type: text/plain, Size: 5568 bytes --]
Currently the VFS calls into the quotactl interface for unmounting
filesystems. This means filesystems with their own quota handling
can't easily distinguish between user-space originating quotaoff
and an unount. Instead move the responsibily of the unmount handling
into the filesystem to be consistent with all other dquot handling.
Note that we do call dquot_disable a lot later now, e.g. after
a sync_filesystem. But this is fine as the quota code takes care
of writing out the quota file by itself.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/fs/ext2/super.c
===================================================================
--- linux-2.6.orig/fs/ext2/super.c 2010-05-19 12:54:52.992255707 +0200
+++ linux-2.6/fs/ext2/super.c 2010-05-19 12:59:21.138253750 +0200
@@ -119,6 +119,8 @@ static void ext2_put_super (struct super
int i;
struct ext2_sb_info *sbi = EXT2_SB(sb);
+ dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
+
if (sb->s_dirt)
ext2_write_super(sb);
Index: linux-2.6/fs/ext3/super.c
===================================================================
--- linux-2.6.orig/fs/ext3/super.c 2010-05-19 12:54:25.315004205 +0200
+++ linux-2.6/fs/ext3/super.c 2010-05-19 12:59:21.139254658 +0200
@@ -410,6 +410,8 @@ static void ext3_put_super (struct super
struct ext3_super_block *es = sbi->s_es;
int i, err;
+ dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
+
lock_kernel();
ext3_xattr_put_super(sb);
Index: linux-2.6/fs/ext4/super.c
===================================================================
--- linux-2.6.orig/fs/ext4/super.c 2010-05-19 12:54:25.319004274 +0200
+++ linux-2.6/fs/ext4/super.c 2010-05-19 12:59:21.145254589 +0200
@@ -645,6 +645,8 @@ static void ext4_put_super(struct super_
struct ext4_super_block *es = sbi->s_es;
int i, err;
+ dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
+
flush_workqueue(sbi->dio_unwritten_wq);
destroy_workqueue(sbi->dio_unwritten_wq);
Index: linux-2.6/fs/jfs/super.c
===================================================================
--- linux-2.6.orig/fs/jfs/super.c 2010-05-19 12:54:25.321004135 +0200
+++ linux-2.6/fs/jfs/super.c 2010-05-19 12:59:21.151253960 +0200
@@ -179,6 +179,8 @@ static void jfs_put_super(struct super_b
jfs_info("In jfs_put_super");
+ dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
+
lock_kernel();
rc = jfs_umount(sb);
Index: linux-2.6/fs/reiserfs/super.c
===================================================================
--- linux-2.6.orig/fs/reiserfs/super.c 2010-05-19 12:54:25.329035703 +0200
+++ linux-2.6/fs/reiserfs/super.c 2010-05-19 12:59:21.163004135 +0200
@@ -466,6 +466,8 @@ static void reiserfs_put_super(struct su
struct reiserfs_transaction_handle th;
th.t_trans_id = 0;
+ dquot_disable(s, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
+
reiserfs_write_lock(s);
if (s->s_dirt)
Index: linux-2.6/fs/super.c
===================================================================
--- linux-2.6.orig/fs/super.c 2010-05-19 12:43:25.650003367 +0200
+++ linux-2.6/fs/super.c 2010-05-19 12:59:21.170024389 +0200
@@ -191,7 +191,6 @@ void deactivate_super(struct super_block
if (atomic_dec_and_lock(&s->s_active, &sb_lock)) {
s->s_count -= S_BIAS-1;
spin_unlock(&sb_lock);
- vfs_dq_off(s, 0);
down_write(&s->s_umount);
fs->kill_sb(s);
put_filesystem(fs);
@@ -218,7 +217,6 @@ void deactivate_locked_super(struct supe
if (atomic_dec_and_lock(&s->s_active, &sb_lock)) {
s->s_count -= S_BIAS-1;
spin_unlock(&sb_lock);
- vfs_dq_off(s, 0);
fs->kill_sb(s);
put_filesystem(fs);
put_super(s);
Index: linux-2.6/fs/ufs/super.c
===================================================================
--- linux-2.6.orig/fs/ufs/super.c 2010-05-19 12:54:25.336004274 +0200
+++ linux-2.6/fs/ufs/super.c 2010-05-19 12:59:21.176024459 +0200
@@ -1227,6 +1227,8 @@ static void ufs_put_super(struct super_b
UFSD("ENTER\n");
+ dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
+
if (sb->s_dirt)
ufs_write_super(sb);
Index: linux-2.6/include/linux/quotaops.h
===================================================================
--- linux-2.6.orig/include/linux/quotaops.h 2010-05-19 12:54:25.341003855 +0200
+++ linux-2.6/include/linux/quotaops.h 2010-05-19 12:59:21.178022713 +0200
@@ -152,16 +152,6 @@ extern const struct quotactl_ops vfs_quo
#define sb_dquot_ops (&dquot_operations)
#define sb_quotactl_ops (&vfs_quotactl_ops)
-/* Cannot be called inside a transaction */
-static inline int vfs_dq_off(struct super_block *sb, int remount)
-{
- int ret = -ENOSYS;
-
- if (sb->s_qcop && sb->s_qcop->quota_off)
- ret = sb->s_qcop->quota_off(sb, -1, remount);
- return ret;
-}
-
#else
static inline int sb_has_quota_usage_enabled(struct super_block *sb, int type)
@@ -228,11 +218,6 @@ static inline void dquot_free_inode(cons
{
}
-static inline int vfs_dq_off(struct super_block *sb, int remount)
-{
- return 0;
-}
-
static inline int dquot_transfer(struct inode *inode, struct iattr *iattr)
{
return 0;
Index: linux-2.6/fs/udf/super.c
===================================================================
--- linux-2.6.orig/fs/udf/super.c 2010-05-19 12:59:46.491254170 +0200
+++ linux-2.6/fs/udf/super.c 2010-05-19 12:59:59.498034376 +0200
@@ -2102,6 +2102,8 @@ static void udf_put_super(struct super_b
int i;
struct udf_sb_info *sbi;
+ dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
+
sbi = UDF_SB(sb);
lock_kernel();
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 4/6] quota: drop remount argument to ->quota_on and ->quota_off
2010-05-19 11:16 [PATCH 0/6] more quota cleanups V2 Christoph Hellwig
` (2 preceding siblings ...)
2010-05-19 11:16 ` [PATCH 3/6] dquot: move unmount handling into the filesystem Christoph Hellwig
@ 2010-05-19 11:16 ` Christoph Hellwig
2010-05-19 11:16 ` [PATCH 5/6] quota: explicitly set ->dq_op and ->s_qcop Christoph Hellwig
` (2 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Christoph Hellwig @ 2010-05-19 11:16 UTC (permalink / raw)
To: jack; +Cc: linux-fsdevel
[-- Attachment #1: quota-drop-remount-arguments --]
[-- Type: text/plain, Size: 9809 bytes --]
Remount handling has fully moved into the filesystem, so all this is
superflous now.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/fs/ocfs2/super.c
===================================================================
--- linux-2.6.orig/fs/ocfs2/super.c 2010-05-19 13:01:17.873254100 +0200
+++ linux-2.6/fs/ocfs2/super.c 2010-05-19 13:02:40.683003436 +0200
@@ -952,7 +952,7 @@ static void ocfs2_disable_quotas(struct
/* Handle quota on quotactl */
static int ocfs2_quota_on(struct super_block *sb, int type, int format_id,
- char *path, int remount)
+ char *path)
{
unsigned int feature[MAXQUOTAS] = { OCFS2_FEATURE_RO_COMPAT_USRQUOTA,
OCFS2_FEATURE_RO_COMPAT_GRPQUOTA};
@@ -960,19 +960,13 @@ static int ocfs2_quota_on(struct super_b
if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type]))
return -EINVAL;
- if (remount)
- return 0; /* Just ignore it has been handled in
- * ocfs2_remount() */
return vfs_quota_enable(sb_dqopt(sb)->files[type], type,
format_id, DQUOT_LIMITS_ENABLED);
}
/* Handle quota off quotactl */
-static int ocfs2_quota_off(struct super_block *sb, int type, int remount)
+static int ocfs2_quota_off(struct super_block *sb, int type)
{
- if (remount)
- return 0; /* Ignore now and handle later in
- * ocfs2_remount() */
return dquot_disable(sb, type, DQUOT_LIMITS_ENABLED);
}
Index: linux-2.6/fs/quota/dquot.c
===================================================================
--- linux-2.6.orig/fs/quota/dquot.c 2010-05-19 12:54:25.311005741 +0200
+++ linux-2.6/fs/quota/dquot.c 2010-05-19 13:02:40.684004484 +0200
@@ -1997,9 +1997,8 @@ put_inodes:
}
EXPORT_SYMBOL(dquot_disable);
-int vfs_quota_off(struct super_block *sb, int type, int remount)
+int vfs_quota_off(struct super_block *sb, int type)
{
- BUG_ON(remount);
return dquot_disable(sb, type,
DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
}
@@ -2181,14 +2180,11 @@ int vfs_quota_on_path(struct super_block
}
EXPORT_SYMBOL(vfs_quota_on_path);
-int vfs_quota_on(struct super_block *sb, int type, int format_id, char *name,
- int remount)
+int vfs_quota_on(struct super_block *sb, int type, int format_id, char *name)
{
struct path path;
int error;
- BUG_ON(remount);
-
error = kern_path(name, LOOKUP_FOLLOW, &path);
if (!error) {
error = vfs_quota_on_path(sb, type, format_id, &path);
Index: linux-2.6/include/linux/quotaops.h
===================================================================
--- linux-2.6.orig/include/linux/quotaops.h 2010-05-19 12:59:21.178022713 +0200
+++ linux-2.6/include/linux/quotaops.h 2010-05-19 13:02:40.687003646 +0200
@@ -63,14 +63,14 @@ int dquot_mark_dquot_dirty(struct dquot
int dquot_file_open(struct inode *inode, struct file *file);
int vfs_quota_on(struct super_block *sb, int type, int format_id,
- char *path, int remount);
+ char *path);
int vfs_quota_enable(struct inode *inode, int type, int format_id,
unsigned int flags);
int vfs_quota_on_path(struct super_block *sb, int type, int format_id,
struct path *path);
int vfs_quota_on_mount(struct super_block *sb, char *qf_name,
int format_id, int type);
-int vfs_quota_off(struct super_block *sb, int type, int remount);
+int vfs_quota_off(struct super_block *sb, int type);
int vfs_quota_sync(struct super_block *sb, int type, int wait);
int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
Index: linux-2.6/fs/ext3/super.c
===================================================================
--- linux-2.6.orig/fs/ext3/super.c 2010-05-19 12:59:21.139254658 +0200
+++ linux-2.6/fs/ext3/super.c 2010-05-19 13:02:40.692254030 +0200
@@ -750,7 +750,7 @@ static int ext3_release_dquot(struct dqu
static int ext3_mark_dquot_dirty(struct dquot *dquot);
static int ext3_write_info(struct super_block *sb, int type);
static int ext3_quota_on(struct super_block *sb, int type, int format_id,
- char *path, int remount);
+ char *path);
static int ext3_quota_on_mount(struct super_block *sb, int type);
static ssize_t ext3_quota_read(struct super_block *sb, int type, char *data,
size_t len, loff_t off);
@@ -1529,7 +1529,7 @@ static void ext3_orphan_cleanup (struct
/* Turn quotas off */
for (i = 0; i < MAXQUOTAS; i++) {
if (sb_dqopt(sb)->files[i])
- vfs_quota_off(sb, i, 0);
+ vfs_quota_off(sb, i);
}
#endif
sb->s_flags = s_flags; /* Restore MS_RDONLY status */
@@ -2870,16 +2870,13 @@ static int ext3_quota_on_mount(struct su
* Standard function to be called on quota_on
*/
static int ext3_quota_on(struct super_block *sb, int type, int format_id,
- char *name, int remount)
+ char *name)
{
int err;
struct path path;
if (!test_opt(sb, QUOTA))
return -EINVAL;
- /* When remounting, no checks are needed and in fact, name is NULL */
- if (remount)
- return vfs_quota_on(sb, type, format_id, name, remount);
err = kern_path(name, LOOKUP_FOLLOW, &path);
if (err)
Index: linux-2.6/fs/ext4/super.c
===================================================================
--- linux-2.6.orig/fs/ext4/super.c 2010-05-19 12:59:21.145254589 +0200
+++ linux-2.6/fs/ext4/super.c 2010-05-19 13:02:40.699256125 +0200
@@ -1061,7 +1061,7 @@ static int ext4_release_dquot(struct dqu
static int ext4_mark_dquot_dirty(struct dquot *dquot);
static int ext4_write_info(struct super_block *sb, int type);
static int ext4_quota_on(struct super_block *sb, int type, int format_id,
- char *path, int remount);
+ char *path);
static int ext4_quota_on_mount(struct super_block *sb, int type);
static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data,
size_t len, loff_t off);
@@ -2053,7 +2053,7 @@ static void ext4_orphan_cleanup(struct s
/* Turn quotas off */
for (i = 0; i < MAXQUOTAS; i++) {
if (sb_dqopt(sb)->files[i])
- vfs_quota_off(sb, i, 0);
+ vfs_quota_off(sb, i);
}
#endif
sb->s_flags = s_flags; /* Restore MS_RDONLY status */
@@ -3924,16 +3924,13 @@ static int ext4_quota_on_mount(struct su
* Standard function to be called on quota_on
*/
static int ext4_quota_on(struct super_block *sb, int type, int format_id,
- char *name, int remount)
+ char *name)
{
int err;
struct path path;
if (!test_opt(sb, QUOTA))
return -EINVAL;
- /* When remounting, no checks are needed and in fact, name is NULL */
- if (remount)
- return vfs_quota_on(sb, type, format_id, name, remount);
err = kern_path(name, LOOKUP_FOLLOW, &path);
if (err)
Index: linux-2.6/fs/quota/quota.c
===================================================================
--- linux-2.6.orig/fs/quota/quota.c 2010-05-19 10:47:34.592253960 +0200
+++ linux-2.6/fs/quota/quota.c 2010-05-19 13:02:40.703274913 +0200
@@ -87,7 +87,7 @@ static int quota_quotaon(struct super_bl
if (IS_ERR(pathname))
return PTR_ERR(pathname);
if (sb->s_qcop->quota_on)
- ret = sb->s_qcop->quota_on(sb, type, id, pathname, 0);
+ ret = sb->s_qcop->quota_on(sb, type, id, pathname);
putname(pathname);
return ret;
}
@@ -274,7 +274,7 @@ static int do_quotactl(struct super_bloc
case Q_QUOTAOFF:
if (!sb->s_qcop->quota_off)
return -ENOSYS;
- return sb->s_qcop->quota_off(sb, type, 0);
+ return sb->s_qcop->quota_off(sb, type);
case Q_GETFMT:
return quota_getfmt(sb, type, addr);
case Q_GETINFO:
Index: linux-2.6/fs/reiserfs/super.c
===================================================================
--- linux-2.6.orig/fs/reiserfs/super.c 2010-05-19 12:59:21.163004135 +0200
+++ linux-2.6/fs/reiserfs/super.c 2010-05-19 13:02:40.706254309 +0200
@@ -305,7 +305,7 @@ static int finish_unfinished(struct supe
/* Turn quotas off */
for (i = 0; i < MAXQUOTAS; i++) {
if (sb_dqopt(s)->files[i])
- vfs_quota_off(s, i, 0);
+ vfs_quota_off(s, i);
}
if (ms_active_set)
/* Restore the flag back */
@@ -622,7 +622,7 @@ static int reiserfs_acquire_dquot(struct
static int reiserfs_release_dquot(struct dquot *);
static int reiserfs_mark_dquot_dirty(struct dquot *);
static int reiserfs_write_info(struct super_block *, int);
-static int reiserfs_quota_on(struct super_block *, int, int, char *, int);
+static int reiserfs_quota_on(struct super_block *, int, int, char *);
static const struct dquot_operations reiserfs_quota_operations = {
.write_dquot = reiserfs_write_dquot,
@@ -2038,7 +2038,7 @@ static int reiserfs_quota_on_mount(struc
* Standard function to be called on quota_on
*/
static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
- char *name, int remount)
+ char *name)
{
int err;
struct path path;
@@ -2047,9 +2047,7 @@ static int reiserfs_quota_on(struct supe
if (!(REISERFS_SB(sb)->s_mount_opt & (1 << REISERFS_QUOTA)))
return -EINVAL;
- /* No more checks needed? Path and format_id are bogus anyway... */
- if (remount)
- return vfs_quota_on(sb, type, format_id, name, 1);
+
err = kern_path(name, LOOKUP_FOLLOW, &path);
if (err)
return err;
Index: linux-2.6/include/linux/quota.h
===================================================================
--- linux-2.6.orig/include/linux/quota.h 2010-05-19 10:47:34.629253262 +0200
+++ linux-2.6/include/linux/quota.h 2010-05-19 13:02:40.709254449 +0200
@@ -332,8 +332,8 @@ struct dquot_operations {
/* Operations handling requests from userspace */
struct quotactl_ops {
- int (*quota_on)(struct super_block *, int, int, char *, int);
- int (*quota_off)(struct super_block *, int, int);
+ int (*quota_on)(struct super_block *, int, int, char *);
+ int (*quota_off)(struct super_block *, int);
int (*quota_sync)(struct super_block *, int, int);
int (*get_info)(struct super_block *, int, struct if_dqinfo *);
int (*set_info)(struct super_block *, int, struct if_dqinfo *);
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 5/6] quota: explicitly set ->dq_op and ->s_qcop
2010-05-19 11:16 [PATCH 0/6] more quota cleanups V2 Christoph Hellwig
` (3 preceding siblings ...)
2010-05-19 11:16 ` [PATCH 4/6] quota: drop remount argument to ->quota_on and ->quota_off Christoph Hellwig
@ 2010-05-19 11:16 ` Christoph Hellwig
2010-05-19 11:16 ` [PATCH 6/6] quota: rename default quotactl methods to dqout_ Christoph Hellwig
2010-05-19 14:15 ` [PATCH 0/6] more quota cleanups V2 Jan Kara
6 siblings, 0 replies; 11+ messages in thread
From: Christoph Hellwig @ 2010-05-19 11:16 UTC (permalink / raw)
To: jack; +Cc: linux-fsdevel
[-- Attachment #1: quota-explicitly-set-ops --]
[-- Type: text/plain, Size: 4104 bytes --]
Only set the quota operation vectors if the filesystem actually supports
quota instead of doing it for all filesystems in alloc_super().
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/fs/super.c
===================================================================
--- linux-2.6.orig/fs/super.c 2010-05-19 13:02:48.178254030 +0200
+++ linux-2.6/fs/super.c 2010-05-19 13:03:04.542254380 +0200
@@ -26,7 +26,6 @@
#include <linux/smp_lock.h>
#include <linux/acct.h>
#include <linux/blkdev.h>
-#include <linux/quotaops.h>
#include <linux/namei.h>
#include <linux/mount.h>
#include <linux/security.h>
@@ -100,8 +99,6 @@ static struct super_block *alloc_super(s
init_rwsem(&s->s_dquot.dqptr_sem);
init_waitqueue_head(&s->s_wait_unfrozen);
s->s_maxbytes = MAX_NON_LFS;
- s->dq_op = sb_dquot_ops;
- s->s_qcop = sb_quotactl_ops;
s->s_op = &default_op;
s->s_time_gran = 1000000000;
}
Index: linux-2.6/include/linux/quotaops.h
===================================================================
--- linux-2.6.orig/include/linux/quotaops.h 2010-05-19 13:02:48.221253960 +0200
+++ linux-2.6/include/linux/quotaops.h 2010-05-19 13:03:20.346254030 +0200
@@ -149,9 +149,6 @@ static inline unsigned sb_any_quota_acti
extern const struct dquot_operations dquot_operations;
extern const struct quotactl_ops vfs_quotactl_ops;
-#define sb_dquot_ops (&dquot_operations)
-#define sb_quotactl_ops (&vfs_quotactl_ops)
-
#else
static inline int sb_has_quota_usage_enabled(struct super_block *sb, int type)
@@ -195,12 +192,6 @@ static inline int sb_any_quota_active(st
return 0;
}
-/*
- * NO-OP when quota not configured.
- */
-#define sb_dquot_ops (NULL)
-#define sb_quotactl_ops (NULL)
-
static inline void dquot_initialize(struct inode *inode)
{
}
Index: linux-2.6/fs/jfs/super.c
===================================================================
--- linux-2.6.orig/fs/jfs/super.c 2010-05-19 13:02:48.185254379 +0200
+++ linux-2.6/fs/jfs/super.c 2010-05-19 13:03:20.291254100 +0200
@@ -483,6 +483,10 @@ static int jfs_fill_super(struct super_b
*/
sb->s_op = &jfs_super_operations;
sb->s_export_op = &jfs_export_operations;
+#ifdef CONFIG_QUOTA
+ sb->dq_op = &dquot_operations;
+ sb->s_qcop = &vfs_quotactl_ops;
+#endif
/*
* Initialize direct-mapping inode/address-space
Index: linux-2.6/fs/udf/super.c
===================================================================
--- linux-2.6.orig/fs/udf/super.c 2010-05-19 13:02:48.203254100 +0200
+++ linux-2.6/fs/udf/super.c 2010-05-19 13:03:20.329254030 +0200
@@ -1948,7 +1948,11 @@ static int udf_fill_super(struct super_b
/* Fill in the rest of the superblock */
sb->s_op = &udf_sb_ops;
sb->s_export_op = &udf_export_ops;
- sb->dq_op = NULL;
+#ifdef CONFIG_QUOTA
+ sb->s_qcop = &vfs_quotactl_ops;
+ sb->dq_op = NULL; /* &dquot_operations */
+#endif
+
sb->s_dirt = 0;
sb->s_magic = UDF_SUPER_MAGIC;
sb->s_time_gran = 1000;
Index: linux-2.6/fs/ufs/super.c
===================================================================
--- linux-2.6.orig/fs/ufs/super.c 2010-05-19 13:02:48.211254030 +0200
+++ linux-2.6/fs/ufs/super.c 2010-05-19 13:03:20.321254030 +0200
@@ -1045,7 +1045,11 @@ magic_found:
*/
sb->s_op = &ufs_super_ops;
sb->s_export_op = &ufs_export_ops;
- sb->dq_op = NULL; /***/
+#ifdef CONFIG_QUOTA
+ sb->s_qcop = &vfs_quotactl_ops;
+ sb->dq_op = NULL; /* &dquot_operations */
+#endif
+
sb->s_magic = fs32_to_cpu(sb, usb3->fs_magic);
uspi->s_sblkno = fs32_to_cpu(sb, usb1->fs_sblkno);
Index: linux-2.6/fs/ext2/super.c
===================================================================
--- linux-2.6.orig/fs/ext2/super.c 2010-05-19 13:03:40.554254239 +0200
+++ linux-2.6/fs/ext2/super.c 2010-05-19 13:04:04.879254100 +0200
@@ -1065,6 +1065,12 @@ static int ext2_fill_super(struct super_
sb->s_op = &ext2_sops;
sb->s_export_op = &ext2_export_ops;
sb->s_xattr = ext2_xattr_handlers;
+
+#ifdef CONFIG_QUOTA
+ sb->dq_op = &dquot_operations;
+ sb->s_qcop = &vfs_quotactl_ops;
+#endif
+
root = ext2_iget(sb, EXT2_ROOT_INO);
if (IS_ERR(root)) {
ret = PTR_ERR(root);
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 6/6] quota: rename default quotactl methods to dqout_
2010-05-19 11:16 [PATCH 0/6] more quota cleanups V2 Christoph Hellwig
` (4 preceding siblings ...)
2010-05-19 11:16 ` [PATCH 5/6] quota: explicitly set ->dq_op and ->s_qcop Christoph Hellwig
@ 2010-05-19 11:16 ` Christoph Hellwig
2010-05-19 14:15 ` [PATCH 0/6] more quota cleanups V2 Jan Kara
6 siblings, 0 replies; 11+ messages in thread
From: Christoph Hellwig @ 2010-05-19 11:16 UTC (permalink / raw)
To: jack; +Cc: linux-fsdevel
[-- Attachment #1: quota-rename-ops --]
[-- Type: text/plain, Size: 15741 bytes --]
Follow the dquot_* style used elsewhere in dquot.c.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/fs/ext3/super.c
===================================================================
--- linux-2.6.orig/fs/ext3/super.c 2010-05-19 13:03:20.271254379 +0200
+++ linux-2.6/fs/ext3/super.c 2010-05-19 13:04:30.813273656 +0200
@@ -769,12 +769,12 @@ static const struct dquot_operations ext
static const struct quotactl_ops ext3_qctl_operations = {
.quota_on = ext3_quota_on,
- .quota_off = vfs_quota_off,
- .quota_sync = vfs_quota_sync,
- .get_info = vfs_get_dqinfo,
- .set_info = vfs_set_dqinfo,
- .get_dqblk = vfs_get_dqblk,
- .set_dqblk = vfs_set_dqblk
+ .quota_off = dquot_quota_off,
+ .quota_sync = dquot_quota_sync,
+ .get_info = dquot_get_dqinfo,
+ .set_info = dquot_set_dqinfo,
+ .get_dqblk = dquot_get_dqblk,
+ .set_dqblk = dquot_set_dqblk
};
#endif
@@ -1529,7 +1529,7 @@ static void ext3_orphan_cleanup (struct
/* Turn quotas off */
for (i = 0; i < MAXQUOTAS; i++) {
if (sb_dqopt(sb)->files[i])
- vfs_quota_off(sb, i);
+ dquot_quota_off(sb, i);
}
#endif
sb->s_flags = s_flags; /* Restore MS_RDONLY status */
@@ -2862,8 +2862,8 @@ static int ext3_write_info(struct super_
*/
static int ext3_quota_on_mount(struct super_block *sb, int type)
{
- return vfs_quota_on_mount(sb, EXT3_SB(sb)->s_qf_names[type],
- EXT3_SB(sb)->s_jquota_fmt, type);
+ return dquot_quota_on_mount(sb, EXT3_SB(sb)->s_qf_names[type],
+ EXT3_SB(sb)->s_jquota_fmt, type);
}
/*
@@ -2914,7 +2914,7 @@ static int ext3_quota_on(struct super_bl
}
}
- err = vfs_quota_on_path(sb, type, format_id, &path);
+ err = dquot_quota_on_path(sb, type, format_id, &path);
path_put(&path);
return err;
}
Index: linux-2.6/fs/ext4/super.c
===================================================================
--- linux-2.6.orig/fs/ext4/super.c 2010-05-19 13:03:20.283253960 +0200
+++ linux-2.6/fs/ext4/super.c 2010-05-19 13:04:30.815004065 +0200
@@ -1083,12 +1083,12 @@ static const struct dquot_operations ext
static const struct quotactl_ops ext4_qctl_operations = {
.quota_on = ext4_quota_on,
- .quota_off = vfs_quota_off,
- .quota_sync = vfs_quota_sync,
- .get_info = vfs_get_dqinfo,
- .set_info = vfs_set_dqinfo,
- .get_dqblk = vfs_get_dqblk,
- .set_dqblk = vfs_set_dqblk
+ .quota_off = dquot_quota_off,
+ .quota_sync = dquot_quota_sync,
+ .get_info = dquot_get_dqinfo,
+ .set_info = dquot_set_dqinfo,
+ .get_dqblk = dquot_get_dqblk,
+ .set_dqblk = dquot_set_dqblk
};
#endif
@@ -2053,7 +2053,7 @@ static void ext4_orphan_cleanup(struct s
/* Turn quotas off */
for (i = 0; i < MAXQUOTAS; i++) {
if (sb_dqopt(sb)->files[i])
- vfs_quota_off(sb, i);
+ dquot_quota_off(sb, i);
}
#endif
sb->s_flags = s_flags; /* Restore MS_RDONLY status */
@@ -3916,8 +3916,8 @@ static int ext4_write_info(struct super_
*/
static int ext4_quota_on_mount(struct super_block *sb, int type)
{
- return vfs_quota_on_mount(sb, EXT4_SB(sb)->s_qf_names[type],
- EXT4_SB(sb)->s_jquota_fmt, type);
+ return dquot_quota_on_mount(sb, EXT4_SB(sb)->s_qf_names[type],
+ EXT4_SB(sb)->s_jquota_fmt, type);
}
/*
@@ -3969,7 +3969,7 @@ static int ext4_quota_on(struct super_bl
}
}
- err = vfs_quota_on_path(sb, type, format_id, &path);
+ err = dquot_quota_on_path(sb, type, format_id, &path);
path_put(&path);
return err;
}
Index: linux-2.6/fs/jfs/super.c
===================================================================
--- linux-2.6.orig/fs/jfs/super.c 2010-05-19 13:03:20.291254100 +0200
+++ linux-2.6/fs/jfs/super.c 2010-05-19 13:04:30.819004274 +0200
@@ -485,7 +485,7 @@ static int jfs_fill_super(struct super_b
sb->s_export_op = &jfs_export_operations;
#ifdef CONFIG_QUOTA
sb->dq_op = &dquot_operations;
- sb->s_qcop = &vfs_quotactl_ops;
+ sb->s_qcop = &dquot_quotactl_ops;
#endif
/*
Index: linux-2.6/fs/ocfs2/super.c
===================================================================
--- linux-2.6.orig/fs/ocfs2/super.c 2010-05-19 13:03:20.299254239 +0200
+++ linux-2.6/fs/ocfs2/super.c 2010-05-19 13:04:30.821004274 +0200
@@ -906,8 +906,8 @@ static int ocfs2_enable_quotas(struct oc
status = -ENOENT;
goto out_quota_off;
}
- status = vfs_quota_enable(inode[type], type, QFMT_OCFS2,
- DQUOT_USAGE_ENABLED);
+ status = dquot_enable(inode[type], type, QFMT_OCFS2,
+ DQUOT_USAGE_ENABLED);
if (status < 0)
goto out_quota_off;
}
@@ -960,8 +960,8 @@ static int ocfs2_quota_on(struct super_b
if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type]))
return -EINVAL;
- return vfs_quota_enable(sb_dqopt(sb)->files[type], type,
- format_id, DQUOT_LIMITS_ENABLED);
+ return dquot_enable(sb_dqopt(sb)->files[type], type,
+ format_id, DQUOT_LIMITS_ENABLED);
}
/* Handle quota off quotactl */
@@ -973,11 +973,11 @@ static int ocfs2_quota_off(struct super_
static const struct quotactl_ops ocfs2_quotactl_ops = {
.quota_on = ocfs2_quota_on,
.quota_off = ocfs2_quota_off,
- .quota_sync = vfs_quota_sync,
- .get_info = vfs_get_dqinfo,
- .set_info = vfs_set_dqinfo,
- .get_dqblk = vfs_get_dqblk,
- .set_dqblk = vfs_set_dqblk,
+ .quota_sync = dquot_quota_sync,
+ .get_info = dquot_get_dqinfo,
+ .set_info = dquot_set_dqinfo,
+ .get_dqblk = dquot_get_dqblk,
+ .set_dqblk = dquot_set_dqblk,
};
static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
Index: linux-2.6/fs/quota/dquot.c
===================================================================
--- linux-2.6.orig/fs/quota/dquot.c 2010-05-19 13:03:20.308254170 +0200
+++ linux-2.6/fs/quota/dquot.c 2010-05-19 13:04:30.825003785 +0200
@@ -584,7 +584,7 @@ out:
}
EXPORT_SYMBOL(dquot_scan_active);
-int vfs_quota_sync(struct super_block *sb, int type, int wait)
+int dquot_quota_sync(struct super_block *sb, int type, int wait)
{
struct list_head *dirty;
struct dquot *dquot;
@@ -656,7 +656,7 @@ int vfs_quota_sync(struct super_block *s
return 0;
}
-EXPORT_SYMBOL(vfs_quota_sync);
+EXPORT_SYMBOL(dquot_quota_sync);
/* Free unused dquots from cache */
static void prune_dqcache(int count)
@@ -1997,12 +1997,12 @@ put_inodes:
}
EXPORT_SYMBOL(dquot_disable);
-int vfs_quota_off(struct super_block *sb, int type)
+int dquot_quota_off(struct super_block *sb, int type)
{
return dquot_disable(sb, type,
DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
}
-EXPORT_SYMBOL(vfs_quota_off);
+EXPORT_SYMBOL(dquot_quota_off);
/*
* Turn quotas on on a device
@@ -2163,7 +2163,7 @@ int dquot_resume(struct super_block *sb,
}
EXPORT_SYMBOL(dquot_resume);
-int vfs_quota_on_path(struct super_block *sb, int type, int format_id,
+int dquot_quota_on_path(struct super_block *sb, int type, int format_id,
struct path *path)
{
int error = security_quota_on(path->dentry);
@@ -2178,28 +2178,28 @@ int vfs_quota_on_path(struct super_block
DQUOT_LIMITS_ENABLED);
return error;
}
-EXPORT_SYMBOL(vfs_quota_on_path);
+EXPORT_SYMBOL(dquot_quota_on_path);
-int vfs_quota_on(struct super_block *sb, int type, int format_id, char *name)
+int dquot_quota_on(struct super_block *sb, int type, int format_id, char *name)
{
struct path path;
int error;
error = kern_path(name, LOOKUP_FOLLOW, &path);
if (!error) {
- error = vfs_quota_on_path(sb, type, format_id, &path);
+ error = dquot_quota_on_path(sb, type, format_id, &path);
path_put(&path);
}
return error;
}
-EXPORT_SYMBOL(vfs_quota_on);
+EXPORT_SYMBOL(dquot_quota_on);
/*
* More powerful function for turning on quotas allowing setting
* of individual quota flags
*/
-int vfs_quota_enable(struct inode *inode, int type, int format_id,
- unsigned int flags)
+int dquot_enable(struct inode *inode, int type, int format_id,
+ unsigned int flags)
{
int ret = 0;
struct super_block *sb = inode->i_sb;
@@ -2239,13 +2239,13 @@ out_lock:
load_quota:
return vfs_load_quota_inode(inode, type, format_id, flags);
}
-EXPORT_SYMBOL(vfs_quota_enable);
+EXPORT_SYMBOL(dquot_enable);
/*
* This function is used when filesystem needs to initialize quotas
* during mount time.
*/
-int vfs_quota_on_mount(struct super_block *sb, char *qf_name,
+int dquot_quota_on_mount(struct super_block *sb, char *qf_name,
int format_id, int type)
{
struct dentry *dentry;
@@ -2271,7 +2271,7 @@ out:
dput(dentry);
return error;
}
-EXPORT_SYMBOL(vfs_quota_on_mount);
+EXPORT_SYMBOL(dquot_quota_on_mount);
static inline qsize_t qbtos(qsize_t blocks)
{
@@ -2306,8 +2306,8 @@ static void do_get_dqblk(struct dquot *d
spin_unlock(&dq_data_lock);
}
-int vfs_get_dqblk(struct super_block *sb, int type, qid_t id,
- struct fs_disk_quota *di)
+int dquot_get_dqblk(struct super_block *sb, int type, qid_t id,
+ struct fs_disk_quota *di)
{
struct dquot *dquot;
@@ -2319,7 +2319,7 @@ int vfs_get_dqblk(struct super_block *sb
return 0;
}
-EXPORT_SYMBOL(vfs_get_dqblk);
+EXPORT_SYMBOL(dquot_get_dqblk);
#define VFS_FS_DQ_MASK \
(FS_DQ_BCOUNT | FS_DQ_BSOFT | FS_DQ_BHARD | \
@@ -2418,7 +2418,7 @@ static int do_set_dqblk(struct dquot *dq
return 0;
}
-int vfs_set_dqblk(struct super_block *sb, int type, qid_t id,
+int dquot_set_dqblk(struct super_block *sb, int type, qid_t id,
struct fs_disk_quota *di)
{
struct dquot *dquot;
@@ -2434,10 +2434,10 @@ int vfs_set_dqblk(struct super_block *sb
out:
return rc;
}
-EXPORT_SYMBOL(vfs_set_dqblk);
+EXPORT_SYMBOL(dquot_set_dqblk);
/* Generic routine for getting common part of quota file information */
-int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii)
+int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii)
{
struct mem_dqinfo *mi;
@@ -2456,10 +2456,10 @@ int vfs_get_dqinfo(struct super_block *s
mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex);
return 0;
}
-EXPORT_SYMBOL(vfs_get_dqinfo);
+EXPORT_SYMBOL(dquot_get_dqinfo);
/* Generic routine for setting common part of quota file information */
-int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii)
+int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii)
{
struct mem_dqinfo *mi;
int err = 0;
@@ -2486,16 +2486,16 @@ out:
mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex);
return err;
}
-EXPORT_SYMBOL(vfs_set_dqinfo);
+EXPORT_SYMBOL(dquot_set_dqinfo);
-const struct quotactl_ops vfs_quotactl_ops = {
- .quota_on = vfs_quota_on,
- .quota_off = vfs_quota_off,
- .quota_sync = vfs_quota_sync,
- .get_info = vfs_get_dqinfo,
- .set_info = vfs_set_dqinfo,
- .get_dqblk = vfs_get_dqblk,
- .set_dqblk = vfs_set_dqblk
+const struct quotactl_ops dquot_quotactl_ops = {
+ .quota_on = dquot_quota_on,
+ .quota_off = dquot_quota_off,
+ .quota_sync = dquot_quota_sync,
+ .get_info = dquot_get_dqinfo,
+ .set_info = dquot_set_dqinfo,
+ .get_dqblk = dquot_get_dqblk,
+ .set_dqblk = dquot_set_dqblk
};
Index: linux-2.6/fs/reiserfs/super.c
===================================================================
--- linux-2.6.orig/fs/reiserfs/super.c 2010-05-19 13:03:20.315254030 +0200
+++ linux-2.6/fs/reiserfs/super.c 2010-05-19 13:04:30.826003716 +0200
@@ -305,7 +305,7 @@ static int finish_unfinished(struct supe
/* Turn quotas off */
for (i = 0; i < MAXQUOTAS; i++) {
if (sb_dqopt(s)->files[i])
- vfs_quota_off(s, i);
+ dquot_quota_off(s, i);
}
if (ms_active_set)
/* Restore the flag back */
@@ -636,12 +636,12 @@ static const struct dquot_operations rei
static const struct quotactl_ops reiserfs_qctl_operations = {
.quota_on = reiserfs_quota_on,
- .quota_off = vfs_quota_off,
- .quota_sync = vfs_quota_sync,
- .get_info = vfs_get_dqinfo,
- .set_info = vfs_set_dqinfo,
- .get_dqblk = vfs_get_dqblk,
- .set_dqblk = vfs_set_dqblk,
+ .quota_off = dquot_quota_off,
+ .quota_sync = dquot_quota_sync,
+ .get_info = dquot_get_dqinfo,
+ .set_info = dquot_set_dqinfo,
+ .get_dqblk = dquot_get_dqblk,
+ .set_dqblk = dquot_set_dqblk,
};
#endif
@@ -2030,8 +2030,8 @@ static int reiserfs_write_info(struct su
*/
static int reiserfs_quota_on_mount(struct super_block *sb, int type)
{
- return vfs_quota_on_mount(sb, REISERFS_SB(sb)->s_qf_names[type],
- REISERFS_SB(sb)->s_jquota_fmt, type);
+ return dquot_quota_on_mount(sb, REISERFS_SB(sb)->s_qf_names[type],
+ REISERFS_SB(sb)->s_jquota_fmt, type);
}
/*
@@ -2091,7 +2091,7 @@ static int reiserfs_quota_on(struct supe
if (err)
goto out;
}
- err = vfs_quota_on_path(sb, type, format_id, &path);
+ err = dquot_quota_on_path(sb, type, format_id, &path);
out:
path_put(&path);
return err;
Index: linux-2.6/fs/ufs/super.c
===================================================================
--- linux-2.6.orig/fs/ufs/super.c 2010-05-19 13:03:20.321254030 +0200
+++ linux-2.6/fs/ufs/super.c 2010-05-19 13:04:30.833023621 +0200
@@ -1046,7 +1046,7 @@ magic_found:
sb->s_op = &ufs_super_ops;
sb->s_export_op = &ufs_export_ops;
#ifdef CONFIG_QUOTA
- sb->s_qcop = &vfs_quotactl_ops;
+ sb->s_qcop = &dquot_quotactl_ops;
sb->dq_op = NULL; /* &dquot_operations */
#endif
Index: linux-2.6/include/linux/quotaops.h
===================================================================
--- linux-2.6.orig/include/linux/quotaops.h 2010-05-19 13:03:20.346254030 +0200
+++ linux-2.6/include/linux/quotaops.h 2010-05-19 13:04:30.840003785 +0200
@@ -62,21 +62,21 @@ int dquot_mark_dquot_dirty(struct dquot
int dquot_file_open(struct inode *inode, struct file *file);
-int vfs_quota_on(struct super_block *sb, int type, int format_id,
+int dquot_quota_on(struct super_block *sb, int type, int format_id,
char *path);
-int vfs_quota_enable(struct inode *inode, int type, int format_id,
+int dquot_enable(struct inode *inode, int type, int format_id,
unsigned int flags);
-int vfs_quota_on_path(struct super_block *sb, int type, int format_id,
+int dquot_quota_on_path(struct super_block *sb, int type, int format_id,
struct path *path);
-int vfs_quota_on_mount(struct super_block *sb, char *qf_name,
+int dquot_quota_on_mount(struct super_block *sb, char *qf_name,
int format_id, int type);
-int vfs_quota_off(struct super_block *sb, int type);
-int vfs_quota_sync(struct super_block *sb, int type, int wait);
-int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
-int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
-int vfs_get_dqblk(struct super_block *sb, int type, qid_t id,
+int dquot_quota_off(struct super_block *sb, int type);
+int dquot_quota_sync(struct super_block *sb, int type, int wait);
+int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
+int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
+int dquot_get_dqblk(struct super_block *sb, int type, qid_t id,
struct fs_disk_quota *di);
-int vfs_set_dqblk(struct super_block *sb, int type, qid_t id,
+int dquot_set_dqblk(struct super_block *sb, int type, qid_t id,
struct fs_disk_quota *di);
int __dquot_transfer(struct inode *inode, struct dquot **transfer_to);
@@ -147,7 +147,7 @@ static inline unsigned sb_any_quota_acti
* Operations supported for diskquotas.
*/
extern const struct dquot_operations dquot_operations;
-extern const struct quotactl_ops vfs_quotactl_ops;
+extern const struct quotactl_ops dquot_quotactl_ops;
#else
Index: linux-2.6/fs/udf/super.c
===================================================================
--- linux-2.6.orig/fs/udf/super.c 2010-05-19 13:03:20.329254030 +0200
+++ linux-2.6/fs/udf/super.c 2010-05-19 13:04:30.845017754 +0200
@@ -1949,7 +1949,7 @@ static int udf_fill_super(struct super_b
sb->s_op = &udf_sb_ops;
sb->s_export_op = &udf_export_ops;
#ifdef CONFIG_QUOTA
- sb->s_qcop = &vfs_quotactl_ops;
+ sb->s_qcop = &dquot_quotactl_ops;
sb->dq_op = NULL; /* &dquot_operations */
#endif
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/6] more quota cleanups V2
2010-05-19 11:16 [PATCH 0/6] more quota cleanups V2 Christoph Hellwig
` (5 preceding siblings ...)
2010-05-19 11:16 ` [PATCH 6/6] quota: rename default quotactl methods to dqout_ Christoph Hellwig
@ 2010-05-19 14:15 ` Jan Kara
6 siblings, 0 replies; 11+ messages in thread
From: Jan Kara @ 2010-05-19 14:15 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: jack, linux-fsdevel
On Wed 19-05-10 07:16:39, Christoph Hellwig wrote:
> Respun to include Jan's comments.
OK, I've merged the whole series. I've just fixed up one whitespace
error, a couple of typos in the changelog, and patch 6 was missing
conversion of ext2 to use dquot_quotactl_ops.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 11+ messages in thread