* [PATCH 1/6] dquot: move remount handling into the filesystem
2010-05-12 19:44 [PATCH 0/6] more quota cleanups Christoph Hellwig
@ 2010-05-12 19:44 ` Christoph Hellwig
2010-05-17 22:34 ` Jan Kara
2010-05-12 19:44 ` [PATCH 2/6] quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers Christoph Hellwig
` (4 subsequent siblings)
5 siblings, 1 reply; 19+ messages in thread
From: Christoph Hellwig @ 2010-05-12 19:44 UTC (permalink / raw)
To: jack; +Cc: linux-fsdevel
[-- Attachment #1: quota-move-remount --]
[-- Type: text/plain, Size: 8582 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-10 22:42:00.615256048 +0200
+++ linux-2.6/fs/ext2/super.c 2010-05-10 22:42:19.030253953 +0200
@@ -1191,6 +1191,7 @@ static int ext2_remount (struct super_bl
unsigned long old_mount_opt = sbi->s_mount_opt;
struct ext2_mount_options old_opts;
unsigned long old_sb_flags;
+ int enable_quota = 0;
int err;
spin_lock(&sbi->s_lock);
@@ -1241,6 +1242,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 +1250,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 +1279,13 @@ 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);
+ enable_quota = 1;
}
+
+ if (enable_quota)
+ 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-10 22:42:00.634006642 +0200
+++ linux-2.6/fs/ext3/super.c 2010-05-10 22:42:19.032253115 +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-10 22:42:00.655004337 +0200
+++ linux-2.6/fs/ext4/super.c 2010-05-10 22:42:19.034275045 +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-10 22:42:00.662003848 +0200
+++ linux-2.6/fs/jfs/super.c 2010-05-10 22:42:19.039314715 +0200
@@ -397,9 +397,15 @@ static int jfs_remount(struct super_bloc
JFS_SBI(sb)->flag = flag;
ret = jfs_mount_rw(sb, 1);
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-10 22:42:00.673004267 +0200
+++ linux-2.6/fs/reiserfs/super.c 2010-05-10 22:42:19.046255559 +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-10 22:42:00.681003778 +0200
+++ linux-2.6/fs/ufs/super.c 2010-05-10 22:42:19.051260518 +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-10 22:42:00.690004267 +0200
+++ linux-2.6/fs/super.c 2010-05-10 22:42:32.808005454 +0200
@@ -569,7 +569,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;
@@ -585,7 +585,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 */
@@ -594,9 +593,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) {
@@ -605,8 +601,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
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 1/6] dquot: move remount handling into the filesystem
2010-05-12 19:44 ` [PATCH 1/6] dquot: move remount handling into the filesystem Christoph Hellwig
@ 2010-05-17 22:34 ` Jan Kara
2010-05-19 10:55 ` Christoph Hellwig
0 siblings, 1 reply; 19+ messages in thread
From: Jan Kara @ 2010-05-17 22:34 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: jack, linux-fsdevel
On Wed 12-05-10 15:44:09, Christoph Hellwig wrote:
> 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>
>
It seems you have missed out UDF from the conversion (maybe you could
setup a checklist of filesystem to convert? :) OTOH looking at it more in
detail quota support for UDF is broken (i.e. quotaon returns EINVAL because
.quota_write is not set) for several years now and noone has complained so
I'm starting to wonder whether fixing it is worth the effort.
Also I'm slightly concerned that previous vfs_dq_quota_on_remount was
called only after
sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK);
so in particular MS_RDONLY has been cleared. Now it is called before so
some filesystem could possibly barf when it sees writes from quota system
before MS_RDONLY gets cleared. I've checked and only JFS could have this
problem since others already clear MS_RDONLY inside their foo_remount()
functions but still...
> Index: linux-2.6/fs/ext2/super.c
> ===================================================================
> --- linux-2.6.orig/fs/ext2/super.c 2010-05-10 22:42:00.615256048 +0200
> +++ linux-2.6/fs/ext2/super.c 2010-05-10 22:42:19.030253953 +0200
> @@ -1191,6 +1191,7 @@ static int ext2_remount (struct super_bl
> unsigned long old_mount_opt = sbi->s_mount_opt;
> struct ext2_mount_options old_opts;
> unsigned long old_sb_flags;
> + int enable_quota = 0;
> int err;
>
> spin_lock(&sbi->s_lock);
> @@ -1241,6 +1242,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 +1250,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 +1279,13 @@ 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);
> + enable_quota = 1;
> }
> +
> + if (enable_quota)
> + vfs_dq_quota_on_remount(sb);
I kind of miss the purpose of "enable_quota" in the above...
Also the ENOSYS check was there only for filesystems which do not support
quotas. Since all the filesystems that call vfs_dq_off now obviously do
support quotas, you can just drop it.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 1/6] dquot: move remount handling into the filesystem
2010-05-17 22:34 ` Jan Kara
@ 2010-05-19 10:55 ` Christoph Hellwig
2010-05-19 13:47 ` Jan Kara
0 siblings, 1 reply; 19+ messages in thread
From: Christoph Hellwig @ 2010-05-19 10:55 UTC (permalink / raw)
To: Jan Kara; +Cc: Christoph Hellwig, linux-fsdevel
On Tue, May 18, 2010 at 12:34:18AM +0200, Jan Kara wrote:
> It seems you have missed out UDF from the conversion (maybe you could
> setup a checklist of filesystem to convert? :) OTOH looking at it more in
> detail quota support for UDF is broken (i.e. quotaon returns EINVAL because
> .quota_write is not set) for several years now and noone has complained so
> I'm starting to wonder whether fixing it is worth the effort.
It's probably not worth it. Given that quota is not part of the UDF
spec, and the linux quota formats are non-portable is's probably rather
worthless. The same applies to UFS which has also beend disabled for
long. Do you want me to send patches to remove UDF and UFS quota
support?
> Also I'm slightly concerned that previous vfs_dq_quota_on_remount was
> called only after
> sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK);
> so in particular MS_RDONLY has been cleared. Now it is called before so
> some filesystem could possibly barf when it sees writes from quota system
> before MS_RDONLY gets cleared. I've checked and only JFS could have this
> problem since others already clear MS_RDONLY inside their foo_remount()
> functions but still...
I've added explicit clears of MS_RDONLY to the next revision of the
patch in jfs and udf.
> > spin_unlock(&sbi->s_lock);
> > +
> > ext2_write_super(sb);
> > + enable_quota = 1;
> > }
> > +
> > + if (enable_quota)
> > + vfs_dq_quota_on_remount(sb);
> I kind of miss the purpose of "enable_quota" in the above...
> Also the ENOSYS check was there only for filesystems which do not support
> quotas. Since all the filesystems that call vfs_dq_off now obviously do
> support quotas, you can just drop it.
Indeed. It was left over from an earlier version of the patch that had
locking constrainst that made it nessecary. I've removed it for the
next version.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 1/6] dquot: move remount handling into the filesystem
2010-05-19 10:55 ` Christoph Hellwig
@ 2010-05-19 13:47 ` Jan Kara
0 siblings, 0 replies; 19+ messages in thread
From: Jan Kara @ 2010-05-19 13:47 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-fsdevel
On Wed 19-05-10 06:55:17, Christoph Hellwig wrote:
> On Tue, May 18, 2010 at 12:34:18AM +0200, Jan Kara wrote:
> > It seems you have missed out UDF from the conversion (maybe you could
> > setup a checklist of filesystem to convert? :) OTOH looking at it more in
> > detail quota support for UDF is broken (i.e. quotaon returns EINVAL because
> > .quota_write is not set) for several years now and noone has complained so
> > I'm starting to wonder whether fixing it is worth the effort.
>
> It's probably not worth it. Given that quota is not part of the UDF
> spec, and the linux quota formats are non-portable is's probably rather
> worthless. The same applies to UFS which has also beend disabled for
> long. Do you want me to send patches to remove UDF and UFS quota
> support?
It's OK, I'll nuke it myself. I love removing code ;)
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 2/6] quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers
2010-05-12 19:44 [PATCH 0/6] more quota cleanups Christoph Hellwig
2010-05-12 19:44 ` [PATCH 1/6] dquot: move remount handling into the filesystem Christoph Hellwig
@ 2010-05-12 19:44 ` Christoph Hellwig
2010-05-17 22:46 ` Jan Kara
2010-05-12 19:44 ` [PATCH 3/6] dquot: move unmount handling into the filesystem Christoph Hellwig
` (3 subsequent siblings)
5 siblings, 1 reply; 19+ messages in thread
From: Christoph Hellwig @ 2010-05-12 19:44 UTC (permalink / raw)
To: jack; +Cc: linux-fsdevel
[-- Attachment #1: quota-kill-remount --]
[-- Type: text/plain, Size: 12790 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-10 22:28:55.358254512 +0200
+++ linux-2.6/fs/quota/dquot.c 2010-05-10 22:28:59.739003639 +0200
@@ -1875,7 +1875,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);
@@ -2005,14 +2005,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
*/
@@ -2129,35 +2131,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)
@@ -2182,8 +2197,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) {
@@ -2206,8 +2220,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? */
@@ -2273,23 +2287,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-10 22:28:59.310003709 +0200
+++ linux-2.6/fs/ext2/super.c 2010-05-10 22:28:59.740003429 +0200
@@ -1251,9 +1251,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;
}
@@ -1285,7 +1284,7 @@ static int ext2_remount (struct super_bl
}
if (enable_quota)
- vfs_dq_quota_on_remount(sb);
+ dquot_resume(sb, -1);
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-10 22:28:59.311004407 +0200
+++ linux-2.6/fs/ext3/super.c 2010-05-10 22:28:59.741003918 +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-10 22:28:59.314004267 +0200
+++ linux-2.6/fs/ext4/super.c 2010-05-10 22:28:59.744003778 +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-10 22:28:59.318023753 +0200
+++ linux-2.6/fs/jfs/super.c 2010-05-10 22:28:59.746023753 +0200
@@ -397,14 +397,14 @@ static int jfs_remount(struct super_bloc
JFS_SBI(sb)->flag = flag;
ret = jfs_mount_rw(sb, 1);
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-10 22:28:55.414004477 +0200
+++ linux-2.6/fs/ocfs2/super.c 2010-05-10 22:31:09.147254093 +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;
}
@@ -942,8 +938,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);
@@ -973,7 +969,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-10 22:28:59.324003918 +0200
+++ linux-2.6/fs/reiserfs/super.c 2010-05-10 22:28:59.755004128 +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-10 22:28:59.330004128 +0200
+++ linux-2.6/fs/ufs/super.c 2010-05-10 22:28:59.760004128 +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-10 22:28:55.455254232 +0200
+++ linux-2.6/include/linux/quotaops.h 2010-05-10 22:34:24.134024452 +0200
@@ -42,6 +42,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);
@@ -59,7 +63,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);
@@ -69,7 +72,6 @@ int vfs_set_dqblk(struct super_block *sb
struct fs_disk_quota *di);
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)
{
@@ -222,11 +224,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;
@@ -253,6 +250,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 */
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 2/6] quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers
2010-05-12 19:44 ` [PATCH 2/6] quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers Christoph Hellwig
@ 2010-05-17 22:46 ` Jan Kara
0 siblings, 0 replies; 19+ messages in thread
From: Jan Kara @ 2010-05-17 22:46 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: jack, linux-fsdevel
On Wed 12-05-10 15:44:10, Christoph Hellwig wrote:
> 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.
This patch looks good.
Honza
>
> 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-10 22:28:55.358254512 +0200
> +++ linux-2.6/fs/quota/dquot.c 2010-05-10 22:28:59.739003639 +0200
> @@ -1875,7 +1875,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);
> @@ -2005,14 +2005,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
> */
> @@ -2129,35 +2131,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)
> @@ -2182,8 +2197,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) {
> @@ -2206,8 +2220,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? */
> @@ -2273,23 +2287,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-10 22:28:59.310003709 +0200
> +++ linux-2.6/fs/ext2/super.c 2010-05-10 22:28:59.740003429 +0200
> @@ -1251,9 +1251,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;
> }
> @@ -1285,7 +1284,7 @@ static int ext2_remount (struct super_bl
> }
>
> if (enable_quota)
> - vfs_dq_quota_on_remount(sb);
> + dquot_resume(sb, -1);
> 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-10 22:28:59.311004407 +0200
> +++ linux-2.6/fs/ext3/super.c 2010-05-10 22:28:59.741003918 +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-10 22:28:59.314004267 +0200
> +++ linux-2.6/fs/ext4/super.c 2010-05-10 22:28:59.744003778 +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-10 22:28:59.318023753 +0200
> +++ linux-2.6/fs/jfs/super.c 2010-05-10 22:28:59.746023753 +0200
> @@ -397,14 +397,14 @@ static int jfs_remount(struct super_bloc
> JFS_SBI(sb)->flag = flag;
> ret = jfs_mount_rw(sb, 1);
> 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-10 22:28:55.414004477 +0200
> +++ linux-2.6/fs/ocfs2/super.c 2010-05-10 22:31:09.147254093 +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;
> }
> @@ -942,8 +938,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);
> @@ -973,7 +969,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-10 22:28:59.324003918 +0200
> +++ linux-2.6/fs/reiserfs/super.c 2010-05-10 22:28:59.755004128 +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-10 22:28:59.330004128 +0200
> +++ linux-2.6/fs/ufs/super.c 2010-05-10 22:28:59.760004128 +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-10 22:28:55.455254232 +0200
> +++ linux-2.6/include/linux/quotaops.h 2010-05-10 22:34:24.134024452 +0200
> @@ -42,6 +42,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);
> @@ -59,7 +63,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);
> @@ -69,7 +72,6 @@ int vfs_set_dqblk(struct super_block *sb
> struct fs_disk_quota *di);
>
> 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)
> {
> @@ -222,11 +224,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;
> @@ -253,6 +250,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 */
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 3/6] dquot: move unmount handling into the filesystem
2010-05-12 19:44 [PATCH 0/6] more quota cleanups Christoph Hellwig
2010-05-12 19:44 ` [PATCH 1/6] dquot: move remount handling into the filesystem Christoph Hellwig
2010-05-12 19:44 ` [PATCH 2/6] quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers Christoph Hellwig
@ 2010-05-12 19:44 ` Christoph Hellwig
2010-05-17 22:58 ` Jan Kara
2010-05-12 19:44 ` [PATCH 4/6] quota: drop remount argument to ->quota_on and ->quota_off Christoph Hellwig
` (2 subsequent siblings)
5 siblings, 1 reply; 19+ messages in thread
From: Christoph Hellwig @ 2010-05-12 19:44 UTC (permalink / raw)
To: jack; +Cc: linux-fsdevel
[-- Attachment #1: quota-move-umount --]
[-- Type: text/plain, Size: 5556 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-10 22:42:36.890004127 +0200
+++ linux-2.6/fs/ext2/super.c 2010-05-10 23:22:59.057025989 +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-10 22:42:36.895003917 +0200
+++ linux-2.6/fs/ext3/super.c 2010-05-10 23:22:59.070004128 +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-10 22:42:36.900012298 +0200
+++ linux-2.6/fs/ext4/super.c 2010-05-10 23:22:59.078003989 +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-10 22:42:36.906006152 +0200
+++ linux-2.6/fs/jfs/super.c 2010-05-10 23:22:58.800259960 +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/ocfs2/super.c
===================================================================
--- linux-2.6.orig/fs/ocfs2/super.c 2010-05-10 22:42:36.910005803 +0200
+++ linux-2.6/fs/ocfs2/super.c 2010-05-10 23:22:59.035004827 +0200
@@ -1595,6 +1595,8 @@ static void ocfs2_put_super(struct super
{
mlog_entry("(0x%p)\n", sb);
+ dquot_disable(sb, -1, DQUOT_LIMITS_ENABLED);
+
lock_kernel();
ocfs2_sync_blockdev(sb);
Index: linux-2.6/fs/reiserfs/super.c
===================================================================
--- linux-2.6.orig/fs/reiserfs/super.c 2010-05-10 22:42:36.913005593 +0200
+++ linux-2.6/fs/reiserfs/super.c 2010-05-10 23:22:59.087024383 +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-10 22:42:32.808005454 +0200
+++ linux-2.6/fs/super.c 2010-05-10 23:22:58.842254792 +0200
@@ -192,7 +190,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);
@@ -219,7 +216,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-10 22:42:36.917006012 +0200
+++ linux-2.6/fs/ufs/super.c 2010-05-10 23:22:58.809253814 +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-10 22:42:46.473003570 +0200
+++ linux-2.6/include/linux/quotaops.h 2010-05-10 23:22:59.102013487 +0200
@@ -143,16 +143,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)
@@ -219,11 +209,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;
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 3/6] dquot: move unmount handling into the filesystem
2010-05-12 19:44 ` [PATCH 3/6] dquot: move unmount handling into the filesystem Christoph Hellwig
@ 2010-05-17 22:58 ` Jan Kara
2010-05-19 11:03 ` Christoph Hellwig
0 siblings, 1 reply; 19+ messages in thread
From: Jan Kara @ 2010-05-17 22:58 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: jack, linux-fsdevel
On Wed 12-05-10 15:44:11, Christoph Hellwig wrote:
> 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.
Well, we don't really write quota file by ourselves but we do the writes
via blockdev's mapping and that is synced after put_super is called so you
are right it should be fine.
> Index: linux-2.6/fs/ocfs2/super.c
> ===================================================================
> --- linux-2.6.orig/fs/ocfs2/super.c 2010-05-10 22:42:36.910005803 +0200
> +++ linux-2.6/fs/ocfs2/super.c 2010-05-10 23:22:59.035004827 +0200
> @@ -1595,6 +1595,8 @@ static void ocfs2_put_super(struct super
> {
> mlog_entry("(0x%p)\n", sb);
>
> + dquot_disable(sb, -1, DQUOT_LIMITS_ENABLED);
> +
OCFS2 disables quotas completely on it's own slightly later in
ocfs2_dismount_volume so you can just remove this.
Otherwise the patch looks fine.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 3/6] dquot: move unmount handling into the filesystem
2010-05-17 22:58 ` Jan Kara
@ 2010-05-19 11:03 ` Christoph Hellwig
0 siblings, 0 replies; 19+ messages in thread
From: Christoph Hellwig @ 2010-05-19 11:03 UTC (permalink / raw)
To: Jan Kara; +Cc: Christoph Hellwig, linux-fsdevel
On Tue, May 18, 2010 at 12:58:55AM +0200, Jan Kara wrote:
> > Index: linux-2.6/fs/ocfs2/super.c
> > ===================================================================
> > --- linux-2.6.orig/fs/ocfs2/super.c 2010-05-10 22:42:36.910005803 +0200
> > +++ linux-2.6/fs/ocfs2/super.c 2010-05-10 23:22:59.035004827 +0200
> > @@ -1595,6 +1595,8 @@ static void ocfs2_put_super(struct super
> > {
> > mlog_entry("(0x%p)\n", sb);
> >
> > + dquot_disable(sb, -1, DQUOT_LIMITS_ENABLED);
> > +
> OCFS2 disables quotas completely on it's own slightly later in
> ocfs2_dismount_volume so you can just remove this.
> Otherwise the patch looks fine.
I'll leave it out for the next respin.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 4/6] quota: drop remount argument to ->quota_on and ->quota_off
2010-05-12 19:44 [PATCH 0/6] more quota cleanups Christoph Hellwig
` (2 preceding siblings ...)
2010-05-12 19:44 ` [PATCH 3/6] dquot: move unmount handling into the filesystem Christoph Hellwig
@ 2010-05-12 19:44 ` Christoph Hellwig
2010-05-17 23:00 ` Jan Kara
2010-05-12 19:44 ` [PATCH 5/6] quota: explicitly set ->dq_op and ->s_qcop Christoph Hellwig
2010-05-12 19:44 ` [PATCH 6/6] quota: rename default quotactl methods to dqout_ Christoph Hellwig
5 siblings, 1 reply; 19+ messages in thread
From: Christoph Hellwig @ 2010-05-12 19:44 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-10 22:42:37.656005455 +0200
+++ linux-2.6/fs/ocfs2/super.c 2010-05-10 22:46:08.116031018 +0200
@@ -948,7 +948,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};
@@ -956,19 +956,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-10 22:42:36.889003917 +0200
+++ linux-2.6/fs/quota/dquot.c 2010-05-10 22:44:45.723005386 +0200
@@ -2007,9 +2007,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);
}
@@ -2191,14 +2190,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-10 22:42:53.134255420 +0200
+++ linux-2.6/include/linux/quotaops.h 2010-05-10 22:47:35.276005805 +0200
@@ -55,14 +55,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-10 22:45:00.583004057 +0200
+++ linux-2.6/fs/ext3/super.c 2010-05-10 22:53:48.127005805 +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-10 22:45:00.595004336 +0200
+++ linux-2.6/fs/ext4/super.c 2010-05-10 22:56:41.878005664 +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-10 22:43:51.473275535 +0200
+++ linux-2.6/fs/quota/quota.c 2010-05-10 22:44:06.812242290 +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-10 22:46:11.397004059 +0200
+++ linux-2.6/fs/reiserfs/super.c 2010-05-10 22:53:56.337005734 +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-10 22:43:41.824023684 +0200
+++ linux-2.6/include/linux/quota.h 2010-05-10 22:44:13.347009155 +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] 19+ messages in thread
* [PATCH 5/6] quota: explicitly set ->dq_op and ->s_qcop
2010-05-12 19:44 [PATCH 0/6] more quota cleanups Christoph Hellwig
` (3 preceding siblings ...)
2010-05-12 19:44 ` [PATCH 4/6] quota: drop remount argument to ->quota_on and ->quota_off Christoph Hellwig
@ 2010-05-12 19:44 ` Christoph Hellwig
2010-05-17 23:06 ` Jan Kara
2010-05-12 19:44 ` [PATCH 6/6] quota: rename default quotactl methods to dqout_ Christoph Hellwig
5 siblings, 1 reply; 19+ messages in thread
From: Christoph Hellwig @ 2010-05-12 19:44 UTC (permalink / raw)
To: jack; +Cc: linux-fsdevel
[-- Attachment #1: quota-explicitly-set-ops --]
[-- Type: text/plain, Size: 3707 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-10 23:24:19.215025989 +0200
+++ linux-2.6/fs/super.c 2010-05-10 23:24:54.148210860 +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>
@@ -101,8 +100,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-10 23:24:30.453195565 +0200
+++ linux-2.6/include/linux/quotaops.h 2010-05-10 23:37:46.910024731 +0200
@@ -140,9 +140,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)
@@ -186,12 +183,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-10 23:24:19.201253535 +0200
+++ linux-2.6/fs/jfs/super.c 2010-05-10 23:37:46.837004197 +0200
@@ -479,6 +479,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-10 23:22:58.822262265 +0200
+++ linux-2.6/fs/udf/super.c 2010-05-10 23:40:26.739255629 +0200
@@ -56,6 +56,7 @@
#include <linux/mount.h>
#include <linux/seq_file.h>
#include <linux/bitmap.h>
+#include <linux/quotaops.h>
#include <linux/crc-itu-t.h>
#include <asm/byteorder.h>
@@ -1939,7 +1940,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-10 23:24:19.220276582 +0200
+++ linux-2.6/fs/ufs/super.c 2010-05-10 23:37:46.895004477 +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);
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 5/6] quota: explicitly set ->dq_op and ->s_qcop
2010-05-12 19:44 ` [PATCH 5/6] quota: explicitly set ->dq_op and ->s_qcop Christoph Hellwig
@ 2010-05-17 23:06 ` Jan Kara
2010-05-19 11:07 ` Christoph Hellwig
0 siblings, 1 reply; 19+ messages in thread
From: Jan Kara @ 2010-05-17 23:06 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: jack, linux-fsdevel
On Wed 12-05-10 15:44:13, Christoph Hellwig wrote:
> Only set the quota operation vectors if the filesystem actually supports
> quota instead of doing it for all filesystems in alloc_super().
Hmm, what about ext2? Otherwise the patch looks fine.
Honza
> Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Index: linux-2.6/fs/super.c
> ===================================================================
> --- linux-2.6.orig/fs/super.c 2010-05-10 23:24:19.215025989 +0200
> +++ linux-2.6/fs/super.c 2010-05-10 23:24:54.148210860 +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>
> @@ -101,8 +100,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-10 23:24:30.453195565 +0200
> +++ linux-2.6/include/linux/quotaops.h 2010-05-10 23:37:46.910024731 +0200
> @@ -140,9 +140,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)
> @@ -186,12 +183,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-10 23:24:19.201253535 +0200
> +++ linux-2.6/fs/jfs/super.c 2010-05-10 23:37:46.837004197 +0200
> @@ -479,6 +479,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-10 23:22:58.822262265 +0200
> +++ linux-2.6/fs/udf/super.c 2010-05-10 23:40:26.739255629 +0200
> @@ -56,6 +56,7 @@
> #include <linux/mount.h>
> #include <linux/seq_file.h>
> #include <linux/bitmap.h>
> +#include <linux/quotaops.h>
> #include <linux/crc-itu-t.h>
> #include <asm/byteorder.h>
>
> @@ -1939,7 +1940,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-10 23:24:19.220276582 +0200
> +++ linux-2.6/fs/ufs/super.c 2010-05-10 23:37:46.895004477 +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);
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 5/6] quota: explicitly set ->dq_op and ->s_qcop
2010-05-17 23:06 ` Jan Kara
@ 2010-05-19 11:07 ` Christoph Hellwig
0 siblings, 0 replies; 19+ messages in thread
From: Christoph Hellwig @ 2010-05-19 11:07 UTC (permalink / raw)
To: Jan Kara; +Cc: Christoph Hellwig, linux-fsdevel
On Tue, May 18, 2010 at 01:06:05AM +0200, Jan Kara wrote:
> On Wed 12-05-10 15:44:13, Christoph Hellwig wrote:
> > Only set the quota operation vectors if the filesystem actually supports
> > quota instead of doing it for all filesystems in alloc_super().
> Hmm, what about ext2? Otherwise the patch looks fine.
Fixed for the next spin.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 6/6] quota: rename default quotactl methods to dqout_
2010-05-12 19:44 [PATCH 0/6] more quota cleanups Christoph Hellwig
` (4 preceding siblings ...)
2010-05-12 19:44 ` [PATCH 5/6] quota: explicitly set ->dq_op and ->s_qcop Christoph Hellwig
@ 2010-05-12 19:44 ` Christoph Hellwig
2010-05-17 23:09 ` Jan Kara
5 siblings, 1 reply; 19+ messages in thread
From: Christoph Hellwig @ 2010-05-12 19:44 UTC (permalink / raw)
To: jack; +Cc: linux-fsdevel
[-- Attachment #1: quota-rename-ops --]
[-- Type: text/plain, Size: 15732 bytes --]
Follow the dqout_* 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-10 23:51:46.167023195 +0200
+++ linux-2.6/fs/ext3/super.c 2010-05-10 23:52:03.792022985 +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-10 23:51:46.174022986 +0200
+++ linux-2.6/fs/ext4/super.c 2010-05-10 23:52:03.793011182 +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-10 23:51:46.188004338 +0200
+++ linux-2.6/fs/jfs/super.c 2010-05-10 23:52:03.797254093 +0200
@@ -481,7 +481,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-10 23:51:46.200004478 +0200
+++ linux-2.6/fs/ocfs2/super.c 2010-05-10 23:52:03.801276931 +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;
}
@@ -956,8 +956,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 */
@@ -969,11 +969,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-10 23:51:46.211254233 +0200
+++ linux-2.6/fs/quota/dquot.c 2010-05-10 23:52:03.809005664 +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)
@@ -2007,12 +2007,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
@@ -2173,7 +2173,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);
@@ -2188,28 +2188,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;
@@ -2249,13 +2249,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;
@@ -2281,7 +2281,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)
{
@@ -2316,8 +2316,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;
@@ -2329,7 +2329,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 | \
@@ -2428,7 +2428,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;
@@ -2444,10 +2444,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;
@@ -2466,10 +2466,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;
@@ -2496,16 +2496,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-10 23:51:46.220004198 +0200
+++ linux-2.6/fs/reiserfs/super.c 2010-05-10 23:52:03.815005943 +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-10 23:51:46.230004548 +0200
+++ linux-2.6/fs/ufs/super.c 2010-05-10 23:52:03.820031087 +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-10 23:51:46.246274487 +0200
+++ linux-2.6/include/linux/quotaops.h 2010-05-10 23:52:03.824276302 +0200
@@ -54,21 +54,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 iattr *iattr);
@@ -138,7 +138,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-10 23:52:07.014004059 +0200
+++ linux-2.6/fs/udf/super.c 2010-05-10 23:52:12.143256048 +0200
@@ -1941,7 +1941,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] 19+ messages in thread
* Re: [PATCH 6/6] quota: rename default quotactl methods to dqout_
2010-05-12 19:44 ` [PATCH 6/6] quota: rename default quotactl methods to dqout_ Christoph Hellwig
@ 2010-05-17 23:09 ` Jan Kara
2010-05-19 11:07 ` Christoph Hellwig
0 siblings, 1 reply; 19+ messages in thread
From: Jan Kara @ 2010-05-17 23:09 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: jack, linux-fsdevel
On Wed 12-05-10 15:44:14, Christoph Hellwig wrote:
> Follow the dqout_* style used elsewhere in dquot.c.
^^^^^ dquot
And we'll need ext2 conversion here as well...
Honza
>
> 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-10 23:51:46.167023195 +0200
> +++ linux-2.6/fs/ext3/super.c 2010-05-10 23:52:03.792022985 +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-10 23:51:46.174022986 +0200
> +++ linux-2.6/fs/ext4/super.c 2010-05-10 23:52:03.793011182 +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-10 23:51:46.188004338 +0200
> +++ linux-2.6/fs/jfs/super.c 2010-05-10 23:52:03.797254093 +0200
> @@ -481,7 +481,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-10 23:51:46.200004478 +0200
> +++ linux-2.6/fs/ocfs2/super.c 2010-05-10 23:52:03.801276931 +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;
> }
> @@ -956,8 +956,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 */
> @@ -969,11 +969,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-10 23:51:46.211254233 +0200
> +++ linux-2.6/fs/quota/dquot.c 2010-05-10 23:52:03.809005664 +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)
> @@ -2007,12 +2007,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
> @@ -2173,7 +2173,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);
> @@ -2188,28 +2188,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;
> @@ -2249,13 +2249,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;
> @@ -2281,7 +2281,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)
> {
> @@ -2316,8 +2316,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;
>
> @@ -2329,7 +2329,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 | \
> @@ -2428,7 +2428,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;
> @@ -2444,10 +2444,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;
>
> @@ -2466,10 +2466,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;
> @@ -2496,16 +2496,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-10 23:51:46.220004198 +0200
> +++ linux-2.6/fs/reiserfs/super.c 2010-05-10 23:52:03.815005943 +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-10 23:51:46.230004548 +0200
> +++ linux-2.6/fs/ufs/super.c 2010-05-10 23:52:03.820031087 +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-10 23:51:46.246274487 +0200
> +++ linux-2.6/include/linux/quotaops.h 2010-05-10 23:52:03.824276302 +0200
> @@ -54,21 +54,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 iattr *iattr);
> @@ -138,7 +138,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-10 23:52:07.014004059 +0200
> +++ linux-2.6/fs/udf/super.c 2010-05-10 23:52:12.143256048 +0200
> @@ -1941,7 +1941,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
>
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 6/6] quota: rename default quotactl methods to dqout_
2010-05-17 23:09 ` Jan Kara
@ 2010-05-19 11:07 ` Christoph Hellwig
0 siblings, 0 replies; 19+ messages in thread
From: Christoph Hellwig @ 2010-05-19 11:07 UTC (permalink / raw)
To: Jan Kara; +Cc: Christoph Hellwig, linux-fsdevel
On Tue, May 18, 2010 at 01:09:17AM +0200, Jan Kara wrote:
> On Wed 12-05-10 15:44:14, Christoph Hellwig wrote:
> > Follow the dqout_* style used elsewhere in dquot.c.
> ^^^^^ dquot
> And we'll need ext2 conversion here as well...
ext2 uses the default quota ops, so nothing to rename there.
^ permalink raw reply [flat|nested] 19+ messages in thread