From: Christoph Hellwig <hch@infradead.org>
To: jack@suse.cz
Cc: linux-fsdevel@vger.kernel.org
Subject: [PATCH 5/8] dquot: move dquot drop responsibiliy into the filesystem
Date: Sat, 20 Feb 2010 06:51:06 -0500 [thread overview]
Message-ID: <20100220115213.475518279@bombadil.infradead.org> (raw)
In-Reply-To: 20100220115101.469826792@bombadil.infradead.org
[-- Attachment #1: quota-move-drop --]
[-- Type: text/plain, Size: 5558 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-02-19 00:34:37.825004031 +0100
+++ linux-2.6/fs/ext2/super.c 2010-02-19 00:36:12.220253508 +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-02-19 00:36:11.342272784 +0100
+++ linux-2.6/fs/ext3/super.c 2010-02-19 00:37:51.823255463 +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-02-19 00:36:11.349253577 +0100
+++ linux-2.6/fs/ext4/super.c 2010-02-19 00:37:56.031005358 +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-02-19 00:34:37.871003961 +0100
+++ linux-2.6/fs/inode.c 2010-02-19 00:36:12.241255672 +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-02-19 00:34:37.880003612 +0100
+++ linux-2.6/fs/jfs/super.c 2010-02-19 00:36:12.253005987 +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-02-19 00:36:09.946254765 +0100
+++ linux-2.6/fs/ocfs2/inode.c 2010-02-19 00:36:12.260023517 +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-02-19 00:36:11.387274530 +0100
+++ linux-2.6/fs/reiserfs/super.c 2010-02-19 00:38:03.698255045 +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-02-19 00:34:37.940003822 +0100
+++ linux-2.6/fs/ufs/super.c 2010-02-19 00:36:12.284254834 +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,
next prev parent reply other threads:[~2010-02-20 11:52 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-20 11:51 [PATCH 0/8] dquot interface cleanups Christoph Hellwig
2010-02-20 11:51 ` [PATCH 1/8] dquot: cleanup space allocation / freeing routines Christoph Hellwig
2010-02-24 22:09 ` Jan Kara
2010-02-20 11:51 ` [PATCH 2/8] dquot: cleanup inode " Christoph Hellwig
2010-02-24 22:39 ` Jan Kara
2010-02-20 11:51 ` [PATCH 3/8] dquot: move dquot transfer responsibiliy into the filesystem Christoph Hellwig
2010-02-24 23:06 ` Jan Kara
2010-02-20 11:51 ` [PATCH 4/8] dquot: cleanup dquot transfer routine Christoph Hellwig
2010-02-24 23:14 ` Jan Kara
2010-03-01 9:50 ` Christoph Hellwig
2010-03-01 10:40 ` Jan Kara
2010-03-01 11:20 ` Dmitry Monakhov
2010-03-01 13:45 ` Jan Kara
2010-03-01 14:18 ` commiting unreviewed patches, was " Christoph Hellwig
2010-03-02 17:43 ` Jan Kara
2010-02-20 11:51 ` Christoph Hellwig [this message]
2010-02-25 0:00 ` [PATCH 5/8] dquot: move dquot drop responsibiliy into the filesystem Jan Kara
2010-02-20 11:51 ` [PATCH 6/8] dquot: cleanup dquot drop routine Christoph Hellwig
2010-02-25 0:08 ` Jan Kara
2010-02-20 11:51 ` [PATCH 7/8] dquot: move dquot initialization responsibiliy into the filesystem Christoph Hellwig
2010-02-25 0:29 ` Jan Kara
2010-03-02 18:44 ` Jan Kara
2010-03-02 19:50 ` Christoph Hellwig
2010-03-03 8:16 ` Jan Kara
2010-03-03 13:02 ` Christoph Hellwig
2010-02-20 11:51 ` [PATCH 8/8] dquot: cleanup dquot initialize routine 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=20100220115213.475518279@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).