|
@@ -79,6 +79,7 @@
|
|
#include <linux/buffer_head.h>
|
|
#include <linux/buffer_head.h>
|
|
#include <linux/capability.h>
|
|
#include <linux/capability.h>
|
|
#include <linux/quotaops.h>
|
|
#include <linux/quotaops.h>
|
|
|
|
+#include <linux/writeback.h> /* for inode_lock, oddly enough.. */
|
|
|
|
|
|
#include <asm/uaccess.h>
|
|
#include <asm/uaccess.h>
|
|
|
|
|
|
@@ -755,15 +756,30 @@ static void put_dquot_list(struct list_head *tofree_head)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void remove_dquot_ref(struct super_block *sb, int type,
|
|
|
|
+ struct list_head *tofree_head)
|
|
|
|
+{
|
|
|
|
+ struct inode *inode;
|
|
|
|
+
|
|
|
|
+ spin_lock(&inode_lock);
|
|
|
|
+ list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
|
|
|
|
+ if (!IS_NOQUOTA(inode))
|
|
|
|
+ remove_inode_dquot_ref(inode, type, tofree_head);
|
|
|
|
+ }
|
|
|
|
+ spin_unlock(&inode_lock);
|
|
|
|
+}
|
|
|
|
+
|
|
/* Gather all references from inodes and drop them */
|
|
/* Gather all references from inodes and drop them */
|
|
static void drop_dquot_ref(struct super_block *sb, int type)
|
|
static void drop_dquot_ref(struct super_block *sb, int type)
|
|
{
|
|
{
|
|
LIST_HEAD(tofree_head);
|
|
LIST_HEAD(tofree_head);
|
|
|
|
|
|
- down_write(&sb_dqopt(sb)->dqptr_sem);
|
|
|
|
- remove_dquot_ref(sb, type, &tofree_head);
|
|
|
|
- up_write(&sb_dqopt(sb)->dqptr_sem);
|
|
|
|
- put_dquot_list(&tofree_head);
|
|
|
|
|
|
+ if (sb->dq_op) {
|
|
|
|
+ down_write(&sb_dqopt(sb)->dqptr_sem);
|
|
|
|
+ remove_dquot_ref(sb, type, &tofree_head);
|
|
|
|
+ up_write(&sb_dqopt(sb)->dqptr_sem);
|
|
|
|
+ put_dquot_list(&tofree_head);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
static inline void dquot_incr_inodes(struct dquot *dquot, unsigned long number)
|
|
static inline void dquot_incr_inodes(struct dquot *dquot, unsigned long number)
|