[PATCH] fs/super.c fixes - second series (9/11)

From: Alexander Viro (viro@math.psu.edu)
Date: Sun Aug 12 2001 - 20:29:13 EST


Part 9/11

Cleanup: invalidate_dquot() can rely on the fact that struct superblock is
not reused.

diff -urN S9-pre1-kern_mnt/fs/dquot.c S9-pre1-dquot/fs/dquot.c
--- S9-pre1-kern_mnt/fs/dquot.c Sat Aug 11 14:59:24 2001
+++ S9-pre1-dquot/fs/dquot.c Sun Aug 12 20:45:51 2001
@@ -325,7 +325,7 @@
         memset(&dquot->dq_dqb, 0, sizeof(struct dqblk));
 }
 
-static void invalidate_dquots(kdev_t dev, short type)
+static void invalidate_dquots(struct super_block *sb, short type)
 {
         struct dquot *dquot, *next;
         int need_restart;
@@ -335,12 +335,10 @@
         need_restart = 0;
         while ((dquot = next) != NULL) {
                 next = dquot->dq_next;
- if (dquot->dq_dev != dev)
+ if (dquot->dq_sb != sb)
                         continue;
                 if (dquot->dq_type != type)
                         continue;
- if (!dquot->dq_sb) /* Already invalidated entry? */
- continue;
                 if (dquot->dq_flags & DQ_LOCKED) {
                         __wait_on_dquot(dquot);
 
@@ -349,12 +347,10 @@
                         /*
                          * Make sure it's still the same dquot.
                          */
- if (dquot->dq_dev != dev)
+ if (dquot->dq_sb != sb)
                                 continue;
                         if (dquot->dq_type != type)
                                 continue;
- if (!dquot->dq_sb)
- continue;
                 }
                 /*
                  * Because inodes needn't to be the only holders of dquot
@@ -1409,7 +1405,7 @@
 
                 /* Note: these are blocking operations */
                 remove_dquot_ref(sb, cnt);
- invalidate_dquots(sb->s_dev, cnt);
+ invalidate_dquots(sb, cnt);
 
                 /* Wait for any pending IO - remove me as soon as invalidate is more polite */
                 down(&dqopt->dqio_sem);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Aug 15 2001 - 21:00:44 EST