From: Christoph Hellwig <hch@infradead.org>
To: jack@suse.cz
Cc: linux-fsdevel@vger.kernel.org
Subject: [PATCH 3/6] dquot: move unmount handling into the filesystem
Date: Wed, 12 May 2010 15:44:11 -0400 [thread overview]
Message-ID: <20100512194453.848250753@bombadil.infradead.org> (raw)
In-Reply-To: 20100512194408.620390318@bombadil.infradead.org
[-- 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;
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 ` Christoph Hellwig [this message]
2010-05-17 22:58 ` [PATCH 3/6] dquot: move unmount handling into the filesystem Jan Kara
2010-05-19 11:03 ` Christoph Hellwig
2010-05-12 19:44 ` [PATCH 4/6] quota: drop remount argument to ->quota_on and ->quota_off 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-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 3/6] dquot: move unmount handling into the filesystem 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=20100512194453.848250753@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).