From: Christoph Hellwig <hch@infradead.org>
To: jack@suse.cz
Cc: linux-fsdevel@vger.kernel.org
Subject: [PATCH 5/9] dquot: move dquot drop responsibiliy into the filesystem
Date: Wed, 03 Mar 2010 09:05:04 -0500 [thread overview]
Message-ID: <20100303140554.794265953@bombadil.infradead.org> (raw)
In-Reply-To: 20100303140459.300799061@bombadil.infradead.org
[-- Attachment #1: quota-move-drop --]
[-- Type: text/plain, Size: 6030 bytes --]
Currently clear_inode calls vfs_dq_drop directly. This means
we tie the quota code into the VFS. Get rid of that and make the
filesystem responsibly for the drop inside the ->clear_inode
superblock operation.
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-03-03 14:03:29.402003543 +0100
+++ linux-2.6/fs/ext2/super.c 2010-03-03 14:10:04.511274110 +0100
@@ -194,6 +194,8 @@ static void destroy_inodecache(void)
static void ext2_clear_inode(struct inode *inode)
{
struct ext2_block_alloc_info *rsv = EXT2_I(inode)->i_block_alloc_info;
+
+ vfs_dq_drop(inode);
ext2_discard_reservation(inode);
EXT2_I(inode)->i_block_alloc_info = NULL;
if (unlikely(rsv))
Index: linux-2.6/fs/ext3/super.c
===================================================================
--- linux-2.6.orig/fs/ext3/super.c 2010-03-03 14:09:20.193022398 +0100
+++ linux-2.6/fs/ext3/super.c 2010-03-03 14:10:04.512272573 +0100
@@ -528,6 +528,8 @@ static void destroy_inodecache(void)
static void ext3_clear_inode(struct inode *inode)
{
struct ext3_block_alloc_info *rsv = EXT3_I(inode)->i_block_alloc_info;
+
+ vfs_dq_drop(inode);
ext3_discard_reservation(inode);
EXT3_I(inode)->i_block_alloc_info = NULL;
if (unlikely(rsv))
Index: linux-2.6/fs/ext4/super.c
===================================================================
--- linux-2.6.orig/fs/ext4/super.c 2010-03-03 14:09:20.205261118 +0100
+++ linux-2.6/fs/ext4/super.c 2010-03-03 14:10:04.528005636 +0100
@@ -761,6 +761,7 @@ static void destroy_inodecache(void)
static void ext4_clear_inode(struct inode *inode)
{
+ vfs_dq_drop(inode);
ext4_discard_preallocations(inode);
if (EXT4_JOURNAL(inode))
jbd2_journal_release_jbd_inode(EXT4_SB(inode->i_sb)->s_journal,
Index: linux-2.6/fs/inode.c
===================================================================
--- linux-2.6.orig/fs/inode.c 2010-03-03 14:03:29.409003752 +0100
+++ linux-2.6/fs/inode.c 2010-03-03 14:10:04.536066818 +0100
@@ -314,7 +314,6 @@ void clear_inode(struct inode *inode)
BUG_ON(!(inode->i_state & I_FREEING));
BUG_ON(inode->i_state & I_CLEAR);
inode_sync_wait(inode);
- vfs_dq_drop(inode);
if (inode->i_sb->s_op->clear_inode)
inode->i_sb->s_op->clear_inode(inode);
if (S_ISBLK(inode->i_mode) && inode->i_bdev)
Index: linux-2.6/fs/jfs/super.c
===================================================================
--- linux-2.6.orig/fs/jfs/super.c 2010-03-03 14:03:29.411003822 +0100
+++ linux-2.6/fs/jfs/super.c 2010-03-03 14:10:04.541005706 +0100
@@ -131,6 +131,11 @@ static void jfs_destroy_inode(struct ino
kmem_cache_free(jfs_inode_cachep, ji);
}
+static void jfs_clear_inode(struct inode *inode)
+{
+ vfs_dq_drop(inode);
+}
+
static int jfs_statfs(struct dentry *dentry, struct kstatfs *buf)
{
struct jfs_sb_info *sbi = JFS_SBI(dentry->d_sb);
@@ -745,6 +750,7 @@ static const struct super_operations jfs
.dirty_inode = jfs_dirty_inode,
.write_inode = jfs_write_inode,
.delete_inode = jfs_delete_inode,
+ .clear_inode = jfs_clear_inode,
.put_super = jfs_put_super,
.sync_fs = jfs_sync_fs,
.freeze_fs = jfs_freeze,
Index: linux-2.6/fs/ocfs2/inode.c
===================================================================
--- linux-2.6.orig/fs/ocfs2/inode.c 2010-03-03 14:05:27.256255322 +0100
+++ linux-2.6/fs/ocfs2/inode.c 2010-03-03 14:10:04.544008918 +0100
@@ -1087,6 +1087,8 @@ void ocfs2_clear_inode(struct inode *ino
mlog_bug_on_msg(OCFS2_SB(inode->i_sb) == NULL,
"Inode=%lu\n", inode->i_ino);
+ vfs_dq_drop(inode);
+
/* To preven remote deletes we hold open lock before, now it
* is time to unlock PR and EX open locks. */
ocfs2_open_unlock(inode);
Index: linux-2.6/fs/reiserfs/super.c
===================================================================
--- linux-2.6.orig/fs/reiserfs/super.c 2010-03-03 14:09:20.255255322 +0100
+++ linux-2.6/fs/reiserfs/super.c 2010-03-03 14:10:04.553006125 +0100
@@ -578,6 +578,11 @@ out:
reiserfs_write_unlock_once(inode->i_sb, lock_depth);
}
+static void reiserfs_clear_inode(struct inode *inode)
+{
+ vfs_dq_drop(inode);
+}
+
#ifdef CONFIG_QUOTA
static ssize_t reiserfs_quota_write(struct super_block *, int, const char *,
size_t, loff_t);
@@ -590,6 +595,7 @@ static const struct super_operations rei
.destroy_inode = reiserfs_destroy_inode,
.write_inode = reiserfs_write_inode,
.dirty_inode = reiserfs_dirty_inode,
+ .clear_inode = reiserfs_clear_inode,
.delete_inode = reiserfs_delete_inode,
.put_super = reiserfs_put_super,
.write_super = reiserfs_write_super,
Index: linux-2.6/fs/ufs/super.c
===================================================================
--- linux-2.6.orig/fs/ufs/super.c 2010-03-03 14:03:29.417004031 +0100
+++ linux-2.6/fs/ufs/super.c 2010-03-03 14:10:04.569006195 +0100
@@ -1432,6 +1432,11 @@ static void destroy_inodecache(void)
kmem_cache_destroy(ufs_inode_cachep);
}
+static void ufs_clear_inode(struct inode *inode)
+{
+ vfs_dq_drop(inode);
+}
+
#ifdef CONFIG_QUOTA
static ssize_t ufs_quota_read(struct super_block *, int, char *,size_t, loff_t);
static ssize_t ufs_quota_write(struct super_block *, int, const char *, size_t, loff_t);
@@ -1442,6 +1447,7 @@ static const struct super_operations ufs
.destroy_inode = ufs_destroy_inode,
.write_inode = ufs_write_inode,
.delete_inode = ufs_delete_inode,
+ .clear_inode = ufs_clear_inode,
.put_super = ufs_put_super,
.write_super = ufs_write_super,
.sync_fs = ufs_sync_fs,
Index: linux-2.6/fs/udf/inode.c
===================================================================
--- linux-2.6.orig/fs/udf/inode.c 2010-03-03 14:10:30.638010386 +0100
+++ linux-2.6/fs/udf/inode.c 2010-03-03 14:10:47.163255604 +0100
@@ -108,6 +108,8 @@ void udf_clear_inode(struct inode *inode
(unsigned long long)inode->i_size,
(unsigned long long)iinfo->i_lenExtents);
}
+
+ vfs_dq_drop(inode);
kfree(iinfo->i_ext.i_data);
iinfo->i_ext.i_data = NULL;
}
next prev parent reply other threads:[~2010-03-03 14:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-03 14:04 [PATCH 0/9] dquot interface cleanups v2 Christoph Hellwig
2010-03-03 14:05 ` [PATCH 1/9] dquot: cleanup space allocation / freeing routines Christoph Hellwig
2010-03-03 14:05 ` [PATCH 2/9] dquot: cleanup inode " Christoph Hellwig
2010-03-03 14:05 ` [PATCH 3/9] dquot: move dquot transfer responsibiliy into the filesystem Christoph Hellwig
2010-03-03 14:05 ` [PATCH 4/9] dquot: cleanup dquot transfer routine Christoph Hellwig
2010-03-03 14:05 ` Christoph Hellwig [this message]
2010-03-03 14:05 ` [PATCH 6/9] dquot: cleanup dquot drop routine Christoph Hellwig
2010-03-03 14:05 ` [PATCH 7/9] dquot: move dquot initialization responsibiliy into the filesystem Christoph Hellwig
2010-03-03 14:05 ` [PATCH 8/9] dquot: cleanup dquot initialize routine Christoph Hellwig
2010-03-03 14:05 ` [PATCH 9/9] quota: stop using QUOTA_OK / NO_QUOTA Christoph Hellwig
2010-03-03 14:52 ` [PATCH 0/9] dquot interface cleanups v2 Dmitry Monakhov
2010-03-03 14:56 ` Jan Kara
2010-03-03 15:36 ` Dmitry Monakhov
2010-03-03 15:45 ` Jan Kara
2010-03-03 15:51 ` Jan Kara
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=20100303140554.794265953@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).