From: Christoph Hellwig <hch@infradead.org>
To: jack@suse.cz
Cc: linux-fsdevel@vger.kernel.org
Subject: [PATCH 4/6] quota: drop remount argument to ->quota_on and ->quota_off
Date: Wed, 12 May 2010 15:44:12 -0400 [thread overview]
Message-ID: <20100512194454.022908648@bombadil.infradead.org> (raw)
In-Reply-To: 20100512194408.620390318@bombadil.infradead.org
[-- 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 *);
next prev parent reply other threads:[~2010-05-12 19:44 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
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-17 22:34 ` Jan Kara
2010-05-19 10:55 ` Christoph Hellwig
2010-05-19 13:47 ` 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
2010-05-17 22:46 ` Jan Kara
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
2010-05-12 19:44 ` Christoph Hellwig [this message]
2010-05-17 23:00 ` [PATCH 4/6] quota: drop remount argument to ->quota_on and ->quota_off Jan Kara
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
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
-- strict thread matches above, loose matches on Subject: below --
2010-05-19 11:16 [PATCH 0/6] more quota cleanups V2 Christoph Hellwig
2010-05-19 11:16 ` [PATCH 4/6] quota: drop remount argument to ->quota_on and ->quota_off Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100512194454.022908648@bombadil.infradead.org \
--to=hch@infradead.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).