aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-03-03 09:05:04 -0500
committerJan Kara <jack@suse.cz>2010-03-04 18:20:29 -0500
commit257ba15cedf1288f0c96118d7e63947231d27278 (patch)
tree7a977a0ea08a324ce74aedce19406cb0688f15e2
parentb43fa8284d7790d9cca32c9c55e24f29be2fa33b (diff)
dquot: move dquot drop responsibility into the filesystem
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>
-rw-r--r--fs/ext2/super.c2
-rw-r--r--fs/ext3/super.c2
-rw-r--r--fs/ext4/super.c1
-rw-r--r--fs/inode.c1
-rw-r--r--fs/jfs/super.c6
-rw-r--r--fs/ocfs2/inode.c2
-rw-r--r--fs/reiserfs/super.c6
-rw-r--r--fs/udf/inode.c2
-rw-r--r--fs/ufs/super.c6
9 files changed, 27 insertions, 1 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index f9cb54a585ce..98815d2a5664 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -194,6 +194,8 @@ static void destroy_inodecache(void)
194static void ext2_clear_inode(struct inode *inode) 194static void ext2_clear_inode(struct inode *inode)
195{ 195{
196 struct ext2_block_alloc_info *rsv = EXT2_I(inode)->i_block_alloc_info; 196 struct ext2_block_alloc_info *rsv = EXT2_I(inode)->i_block_alloc_info;
197
198 vfs_dq_drop(inode);
197 ext2_discard_reservation(inode); 199 ext2_discard_reservation(inode);
198 EXT2_I(inode)->i_block_alloc_info = NULL; 200 EXT2_I(inode)->i_block_alloc_info = NULL;
199 if (unlikely(rsv)) 201 if (unlikely(rsv))
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index f7d4a2c19dee..2277b1a98e62 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -528,6 +528,8 @@ static void destroy_inodecache(void)
528static void ext3_clear_inode(struct inode *inode) 528static void ext3_clear_inode(struct inode *inode)
529{ 529{
530 struct ext3_block_alloc_info *rsv = EXT3_I(inode)->i_block_alloc_info; 530 struct ext3_block_alloc_info *rsv = EXT3_I(inode)->i_block_alloc_info;
531
532 vfs_dq_drop(inode);
531 ext3_discard_reservation(inode); 533 ext3_discard_reservation(inode);
532 EXT3_I(inode)->i_block_alloc_info = NULL; 534 EXT3_I(inode)->i_block_alloc_info = NULL;
533 if (unlikely(rsv)) 535 if (unlikely(rsv))
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index b4253fb7bab6..56554c8850ec 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -761,6 +761,7 @@ static void destroy_inodecache(void)
761 761
762static void ext4_clear_inode(struct inode *inode) 762static void ext4_clear_inode(struct inode *inode)
763{ 763{
764 vfs_dq_drop(inode);
764 ext4_discard_preallocations(inode); 765 ext4_discard_preallocations(inode);
765 if (EXT4_JOURNAL(inode)) 766 if (EXT4_JOURNAL(inode))
766 jbd2_journal_release_jbd_inode(EXT4_SB(inode->i_sb)->s_journal, 767 jbd2_journal_release_jbd_inode(EXT4_SB(inode->i_sb)->s_journal,
diff --git a/fs/inode.c b/fs/inode.c
index 03dfeb2e3928..f1aef3482b0e 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -314,7 +314,6 @@ void clear_inode(struct inode *inode)
314 BUG_ON(!(inode->i_state & I_FREEING)); 314 BUG_ON(!(inode->i_state & I_FREEING));
315 BUG_ON(inode->i_state & I_CLEAR); 315 BUG_ON(inode->i_state & I_CLEAR);
316 inode_sync_wait(inode); 316 inode_sync_wait(inode);
317 vfs_dq_drop(inode);
318 if (inode->i_sb->s_op->clear_inode) 317 if (inode->i_sb->s_op->clear_inode)
319 inode->i_sb->s_op->clear_inode(inode); 318 inode->i_sb->s_op->clear_inode(inode);
320 if (S_ISBLK(inode->i_mode) && inode->i_bdev) 319 if (S_ISBLK(inode->i_mode) && inode->i_bdev)
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index d929a822a74e..4086fa593419 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -131,6 +131,11 @@ static void jfs_destroy_inode(struct inode *inode)
131 kmem_cache_free(jfs_inode_cachep, ji); 131 kmem_cache_free(jfs_inode_cachep, ji);
132} 132}
133 133
134static void jfs_clear_inode(struct inode *inode)
135{
136 vfs_dq_drop(inode);
137}
138
134static int jfs_statfs(struct dentry *dentry, struct kstatfs *buf) 139static int jfs_statfs(struct dentry *dentry, struct kstatfs *buf)
135{ 140{
136 struct jfs_sb_info *sbi = JFS_SBI(dentry->d_sb); 141 struct jfs_sb_info *sbi = JFS_SBI(dentry->d_sb);
@@ -745,6 +750,7 @@ static const struct super_operations jfs_super_operations = {
745 .dirty_inode = jfs_dirty_inode, 750 .dirty_inode = jfs_dirty_inode,
746 .write_inode = jfs_write_inode, 751 .write_inode = jfs_write_inode,
747 .delete_inode = jfs_delete_inode, 752 .delete_inode = jfs_delete_inode,
753 .clear_inode = jfs_clear_inode,
748 .put_super = jfs_put_super, 754 .put_super = jfs_put_super,
749 .sync_fs = jfs_sync_fs, 755 .sync_fs = jfs_sync_fs,
750 .freeze_fs = jfs_freeze, 756 .freeze_fs = jfs_freeze,
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
index cb7f67d8441a..13eb5d467c40 100644
--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -1087,6 +1087,8 @@ void ocfs2_clear_inode(struct inode *inode)
1087 mlog_bug_on_msg(OCFS2_SB(inode->i_sb) == NULL, 1087 mlog_bug_on_msg(OCFS2_SB(inode->i_sb) == NULL,
1088 "Inode=%lu\n", inode->i_ino); 1088 "Inode=%lu\n", inode->i_ino);
1089 1089
1090 vfs_dq_drop(inode);
1091
1090 /* To preven remote deletes we hold open lock before, now it 1092 /* To preven remote deletes we hold open lock before, now it
1091 * is time to unlock PR and EX open locks. */ 1093 * is time to unlock PR and EX open locks. */
1092 ocfs2_open_unlock(inode); 1094 ocfs2_open_unlock(inode);
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 97c3e8ed7db6..6b24e70e329b 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -578,6 +578,11 @@ out:
578 reiserfs_write_unlock_once(inode->i_sb, lock_depth); 578 reiserfs_write_unlock_once(inode->i_sb, lock_depth);
579} 579}
580 580
581static void reiserfs_clear_inode(struct inode *inode)
582{
583 vfs_dq_drop(inode);
584}
585
581#ifdef CONFIG_QUOTA 586#ifdef CONFIG_QUOTA
582static ssize_t reiserfs_quota_write(struct super_block *, int, const char *, 587static ssize_t reiserfs_quota_write(struct super_block *, int, const char *,
583 size_t, loff_t); 588 size_t, loff_t);
@@ -590,6 +595,7 @@ static const struct super_operations reiserfs_sops = {
590 .destroy_inode = reiserfs_destroy_inode, 595 .destroy_inode = reiserfs_destroy_inode,
591 .write_inode = reiserfs_write_inode, 596 .write_inode = reiserfs_write_inode,
592 .dirty_inode = reiserfs_dirty_inode, 597 .dirty_inode = reiserfs_dirty_inode,
598 .clear_inode = reiserfs_clear_inode,
593 .delete_inode = reiserfs_delete_inode, 599 .delete_inode = reiserfs_delete_inode,
594 .put_super = reiserfs_put_super, 600 .put_super = reiserfs_put_super,
595 .write_super = reiserfs_write_super, 601 .write_super = reiserfs_write_super,
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index f90231eb2916..859389a3832b 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -108,6 +108,8 @@ void udf_clear_inode(struct inode *inode)
108 (unsigned long long)inode->i_size, 108 (unsigned long long)inode->i_size,
109 (unsigned long long)iinfo->i_lenExtents); 109 (unsigned long long)iinfo->i_lenExtents);
110 } 110 }
111
112 vfs_dq_drop(inode);
111 kfree(iinfo->i_ext.i_data); 113 kfree(iinfo->i_ext.i_data);
112 iinfo->i_ext.i_data = NULL; 114 iinfo->i_ext.i_data = NULL;
113} 115}
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 143c20bfb04b..95d61cb3a5b8 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -1432,6 +1432,11 @@ static void destroy_inodecache(void)
1432 kmem_cache_destroy(ufs_inode_cachep); 1432 kmem_cache_destroy(ufs_inode_cachep);
1433} 1433}
1434 1434
1435static void ufs_clear_inode(struct inode *inode)
1436{
1437 vfs_dq_drop(inode);
1438}
1439
1435#ifdef CONFIG_QUOTA 1440#ifdef CONFIG_QUOTA
1436static ssize_t ufs_quota_read(struct super_block *, int, char *,size_t, loff_t); 1441static ssize_t ufs_quota_read(struct super_block *, int, char *,size_t, loff_t);
1437static ssize_t ufs_quota_write(struct super_block *, int, const char *, size_t, loff_t); 1442static 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 = {
1442 .destroy_inode = ufs_destroy_inode, 1447 .destroy_inode = ufs_destroy_inode,
1443 .write_inode = ufs_write_inode, 1448 .write_inode = ufs_write_inode,
1444 .delete_inode = ufs_delete_inode, 1449 .delete_inode = ufs_delete_inode,
1450 .clear_inode = ufs_clear_inode,
1445 .put_super = ufs_put_super, 1451 .put_super = ufs_put_super,
1446 .write_super = ufs_write_super, 1452 .write_super = ufs_write_super,
1447 .sync_fs = ufs_sync_fs, 1453 .sync_fs = ufs_sync_fs,