From: Christoph Hellwig <hch@infradead.org>
To: jack@suse.cz
Cc: linux-fsdevel@vger.kernel.org
Subject: [PATCH 5/6] quota: explicitly set ->dq_op and ->s_qcop
Date: Wed, 19 May 2010 07:16:44 -0400 [thread overview]
Message-ID: <20100519111702.753890778@bombadil.infradead.org> (raw)
In-Reply-To: 20100519111639.623056171@bombadil.infradead.org
[-- Attachment #1: quota-explicitly-set-ops --]
[-- Type: text/plain, Size: 4104 bytes --]
Only set the quota operation vectors if the filesystem actually supports
quota instead of doing it for all filesystems in alloc_super().
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/fs/super.c
===================================================================
--- linux-2.6.orig/fs/super.c 2010-05-19 13:02:48.178254030 +0200
+++ linux-2.6/fs/super.c 2010-05-19 13:03:04.542254380 +0200
@@ -26,7 +26,6 @@
#include <linux/smp_lock.h>
#include <linux/acct.h>
#include <linux/blkdev.h>
-#include <linux/quotaops.h>
#include <linux/namei.h>
#include <linux/mount.h>
#include <linux/security.h>
@@ -100,8 +99,6 @@ static struct super_block *alloc_super(s
init_rwsem(&s->s_dquot.dqptr_sem);
init_waitqueue_head(&s->s_wait_unfrozen);
s->s_maxbytes = MAX_NON_LFS;
- s->dq_op = sb_dquot_ops;
- s->s_qcop = sb_quotactl_ops;
s->s_op = &default_op;
s->s_time_gran = 1000000000;
}
Index: linux-2.6/include/linux/quotaops.h
===================================================================
--- linux-2.6.orig/include/linux/quotaops.h 2010-05-19 13:02:48.221253960 +0200
+++ linux-2.6/include/linux/quotaops.h 2010-05-19 13:03:20.346254030 +0200
@@ -149,9 +149,6 @@ static inline unsigned sb_any_quota_acti
extern const struct dquot_operations dquot_operations;
extern const struct quotactl_ops vfs_quotactl_ops;
-#define sb_dquot_ops (&dquot_operations)
-#define sb_quotactl_ops (&vfs_quotactl_ops)
-
#else
static inline int sb_has_quota_usage_enabled(struct super_block *sb, int type)
@@ -195,12 +192,6 @@ static inline int sb_any_quota_active(st
return 0;
}
-/*
- * NO-OP when quota not configured.
- */
-#define sb_dquot_ops (NULL)
-#define sb_quotactl_ops (NULL)
-
static inline void dquot_initialize(struct inode *inode)
{
}
Index: linux-2.6/fs/jfs/super.c
===================================================================
--- linux-2.6.orig/fs/jfs/super.c 2010-05-19 13:02:48.185254379 +0200
+++ linux-2.6/fs/jfs/super.c 2010-05-19 13:03:20.291254100 +0200
@@ -483,6 +483,10 @@ static int jfs_fill_super(struct super_b
*/
sb->s_op = &jfs_super_operations;
sb->s_export_op = &jfs_export_operations;
+#ifdef CONFIG_QUOTA
+ sb->dq_op = &dquot_operations;
+ sb->s_qcop = &vfs_quotactl_ops;
+#endif
/*
* Initialize direct-mapping inode/address-space
Index: linux-2.6/fs/udf/super.c
===================================================================
--- linux-2.6.orig/fs/udf/super.c 2010-05-19 13:02:48.203254100 +0200
+++ linux-2.6/fs/udf/super.c 2010-05-19 13:03:20.329254030 +0200
@@ -1948,7 +1948,11 @@ static int udf_fill_super(struct super_b
/* Fill in the rest of the superblock */
sb->s_op = &udf_sb_ops;
sb->s_export_op = &udf_export_ops;
- sb->dq_op = NULL;
+#ifdef CONFIG_QUOTA
+ sb->s_qcop = &vfs_quotactl_ops;
+ sb->dq_op = NULL; /* &dquot_operations */
+#endif
+
sb->s_dirt = 0;
sb->s_magic = UDF_SUPER_MAGIC;
sb->s_time_gran = 1000;
Index: linux-2.6/fs/ufs/super.c
===================================================================
--- linux-2.6.orig/fs/ufs/super.c 2010-05-19 13:02:48.211254030 +0200
+++ linux-2.6/fs/ufs/super.c 2010-05-19 13:03:20.321254030 +0200
@@ -1045,7 +1045,11 @@ magic_found:
*/
sb->s_op = &ufs_super_ops;
sb->s_export_op = &ufs_export_ops;
- sb->dq_op = NULL; /***/
+#ifdef CONFIG_QUOTA
+ sb->s_qcop = &vfs_quotactl_ops;
+ sb->dq_op = NULL; /* &dquot_operations */
+#endif
+
sb->s_magic = fs32_to_cpu(sb, usb3->fs_magic);
uspi->s_sblkno = fs32_to_cpu(sb, usb1->fs_sblkno);
Index: linux-2.6/fs/ext2/super.c
===================================================================
--- linux-2.6.orig/fs/ext2/super.c 2010-05-19 13:03:40.554254239 +0200
+++ linux-2.6/fs/ext2/super.c 2010-05-19 13:04:04.879254100 +0200
@@ -1065,6 +1065,12 @@ static int ext2_fill_super(struct super_
sb->s_op = &ext2_sops;
sb->s_export_op = &ext2_export_ops;
sb->s_xattr = ext2_xattr_handlers;
+
+#ifdef CONFIG_QUOTA
+ sb->dq_op = &dquot_operations;
+ sb->s_qcop = &vfs_quotactl_ops;
+#endif
+
root = ext2_iget(sb, EXT2_ROOT_INO);
if (IS_ERR(root)) {
ret = PTR_ERR(root);
next prev parent reply other threads:[~2010-05-19 11:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-19 11:16 [PATCH 0/6] more quota cleanups V2 Christoph Hellwig
2010-05-19 11:16 ` [PATCH 1/6] dquot: move remount handling into the filesystem Christoph Hellwig
2010-05-19 11:16 ` [PATCH 2/6] quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers Christoph Hellwig
2010-05-19 11:16 ` [PATCH 3/6] dquot: move unmount handling into the filesystem Christoph Hellwig
2010-05-19 11:16 ` [PATCH 4/6] quota: drop remount argument to ->quota_on and ->quota_off Christoph Hellwig
2010-05-19 11:16 ` Christoph Hellwig [this message]
2010-05-19 11:16 ` [PATCH 6/6] quota: rename default quotactl methods to dqout_ Christoph Hellwig
2010-05-19 14:15 ` [PATCH 0/6] more quota cleanups V2 Jan Kara
-- strict thread matches above, loose matches on Subject: below --
2010-05-12 19:44 [PATCH 0/6] more quota cleanups Christoph Hellwig
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
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=20100519111702.753890778@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).