]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
dquot: move dquot drop responsibility into the filesystem
authorChristoph Hellwig <hch@infradead.org>
Wed, 3 Mar 2010 14:05:04 +0000 (09:05 -0500)
committerJan Kara <jack@suse.cz>
Thu, 4 Mar 2010 23:20:29 +0000 (00:20 +0100)
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 responsible for the drop inside the ->clear_inode
superblock operation.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext2/super.c
fs/ext3/super.c
fs/ext4/super.c
fs/inode.c
fs/jfs/super.c
fs/ocfs2/inode.c
fs/reiserfs/super.c
fs/udf/inode.c
fs/ufs/super.c

index f9cb54a585ce8298e7b2fb9bf90169f8323de289..98815d2a56647c2f83344a541fe349f90c3a7321 100644 (file)
@@ -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 f7d4a2c19dee0f8a25f50b09194bb2f9a73cab53..2277b1a98e622edb44d394b1805d1416d366eb47 100644 (file)
@@ -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 b4253fb7bab6b7e094b24b0f4c7c616ebf9b3399..56554c8850ecd160639408875448eb1b8a828e34 100644 (file)
@@ -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 03dfeb2e39287a75b2fccbe6c71d1451ebade3a0..f1aef3482b0e4a2a884163d62c84606a14c945d6 100644 (file)
@@ -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 d929a822a74e6410fd89727f4351e164f8e65ede..4086fa59341937f443966f9c46e240888a284287 100644 (file)
@@ -131,6 +131,11 @@ static void jfs_destroy_inode(struct inode *inode)
        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_super_operations = {
        .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 cb7f67d8441a3e41470271e0268670b7f03a7a6d..13eb5d467c40d0bde078536f9866354ca2191586 100644 (file)
@@ -1087,6 +1087,8 @@ void ocfs2_clear_inode(struct inode *inode)
        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 97c3e8ed7db692476bb4081ca69a197ddc6cc829..6b24e70e329b42b33916e469615553a530f0fd3f 100644 (file)
@@ -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 reiserfs_sops = {
        .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 f90231eb29165785d14369191a00fc458dafbc9c..859389a3832bdbd2602373758152c209662e6cbb 100644 (file)
@@ -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;
 }
index 143c20bfb04b084a73f1814a23ed2b69a3614e2d..95d61cb3a5b8186a20347820d80ad9e5c33043a7 100644 (file)
@@ -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_super_ops = {
        .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,