aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/dquot.c24
-rw-r--r--fs/inode.c27
-rw-r--r--include/linux/fs.h1
3 files changed, 20 insertions, 32 deletions
diff --git a/fs/dquot.c b/fs/dquot.c
index a561fb29e203..5bdc4b2a872a 100644
--- a/fs/dquot.c
+++ b/fs/dquot.c
@@ -79,6 +79,7 @@
79#include <linux/buffer_head.h> 79#include <linux/buffer_head.h>
80#include <linux/capability.h> 80#include <linux/capability.h>
81#include <linux/quotaops.h> 81#include <linux/quotaops.h>
82#include <linux/writeback.h> /* for inode_lock, oddly enough.. */
82 83
83#include <asm/uaccess.h> 84#include <asm/uaccess.h>
84 85
@@ -755,15 +756,30 @@ static void put_dquot_list(struct list_head *tofree_head)
755 } 756 }
756} 757}
757 758
759static void remove_dquot_ref(struct super_block *sb, int type,
760 struct list_head *tofree_head)
761{
762 struct inode *inode;
763
764 spin_lock(&inode_lock);
765 list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
766 if (!IS_NOQUOTA(inode))
767 remove_inode_dquot_ref(inode, type, tofree_head);
768 }
769 spin_unlock(&inode_lock);
770}
771
758/* Gather all references from inodes and drop them */ 772/* Gather all references from inodes and drop them */
759static void drop_dquot_ref(struct super_block *sb, int type) 773static void drop_dquot_ref(struct super_block *sb, int type)
760{ 774{
761 LIST_HEAD(tofree_head); 775 LIST_HEAD(tofree_head);
762 776
763 down_write(&sb_dqopt(sb)->dqptr_sem); 777 if (sb->dq_op) {
764 remove_dquot_ref(sb, type, &tofree_head); 778 down_write(&sb_dqopt(sb)->dqptr_sem);
765 up_write(&sb_dqopt(sb)->dqptr_sem); 779 remove_dquot_ref(sb, type, &tofree_head);
766 put_dquot_list(&tofree_head); 780 up_write(&sb_dqopt(sb)->dqptr_sem);
781 put_dquot_list(&tofree_head);
782 }
767} 783}
768 784
769static inline void dquot_incr_inodes(struct dquot *dquot, unsigned long number) 785static inline void dquot_incr_inodes(struct dquot *dquot, unsigned long number)
diff --git a/fs/inode.c b/fs/inode.c
index e6d93070f140..5e32432a7608 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1251,33 +1251,6 @@ int inode_needs_sync(struct inode *inode)
1251 1251
1252EXPORT_SYMBOL(inode_needs_sync); 1252EXPORT_SYMBOL(inode_needs_sync);
1253 1253
1254/*
1255 * Quota functions that want to walk the inode lists..
1256 */
1257#ifdef CONFIG_QUOTA
1258
1259void remove_dquot_ref(struct super_block *sb, int type,
1260 struct list_head *tofree_head)
1261{
1262 struct inode *inode;
1263
1264 if (!sb->dq_op)
1265 return; /* nothing to do */
1266 spin_lock(&inode_lock); /* This lock is for inodes code */
1267
1268 /*
1269 * We don't have to lock against quota code - test IS_QUOTAINIT is
1270 * just for speedup...
1271 */
1272 list_for_each_entry(inode, &sb->s_inodes, i_sb_list)
1273 if (!IS_NOQUOTA(inode))
1274 remove_inode_dquot_ref(inode, type, tofree_head);
1275
1276 spin_unlock(&inode_lock);
1277}
1278
1279#endif
1280
1281int inode_wait(void *word) 1254int inode_wait(void *word)
1282{ 1255{
1283 schedule(); 1256 schedule();
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 20fd1619ccfb..990adcbc0df2 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1688,7 +1688,6 @@ extern struct inode *new_inode(struct super_block *);
1688extern int __remove_suid(struct dentry *, int); 1688extern int __remove_suid(struct dentry *, int);
1689extern int should_remove_suid(struct dentry *); 1689extern int should_remove_suid(struct dentry *);
1690extern int remove_suid(struct dentry *); 1690extern int remove_suid(struct dentry *);
1691extern void remove_dquot_ref(struct super_block *, int, struct list_head *);
1692 1691
1693extern void __insert_inode_hash(struct inode *, unsigned long hashval); 1692extern void __insert_inode_hash(struct inode *, unsigned long hashval);
1694extern void remove_inode_hash(struct inode *); 1693extern void remove_inode_hash(struct inode *);