]> git.neil.brown.name Git - LaFS.git/commitdiff
Discard WritePhase and phase wait
authorNeilBrown <neilb@suse.de>
Sun, 18 Jul 2010 15:08:21 +0000 (17:08 +0200)
committerNeilBrown <neilb@suse.de>
Sun, 25 Jul 2010 05:34:27 +0000 (15:34 +1000)
They didn't really work - we will achieve the same result
a different way

Signed-off-by: NeilBrown <neilb@suse.de>
checkpoint.c
cluster.c
modify.c
orphan.c
state.h

index ceb828a13368a425d912d5bdfbeb565d7a00b233..ebcbed1f1955c5f87f889794733c9944d29721a4 100644 (file)
@@ -62,13 +62,6 @@ static char *strflags(struct block *b)
                        strcat(ans, "Phase1,");
                else
                        strcat(ans, "Phase0,");
-               if (test_bit(B_IOLock, &b->flags) &&
-                   test_bit(B_Valid, &b->flags)) {
-                       if (test_bit(B_WritePhase1, &b->flags))
-                               strcat(ans, "WPhase1,");
-                       else
-                               strcat(ans, "WPhase0,");
-               }
        }
        if (test_bit(B_PinPending, &b->flags))
                strcat(ans, "PinPending,");
index 826be74d9f18a9b871330c974bafdf7898dcadf2..8c919915aa45648d27b036fbc28f357a314c7396 100644 (file)
--- a/cluster.c
+++ b/cluster.c
@@ -547,10 +547,6 @@ static int flush_data_to_inode(struct block *b)
        db = getdref(lai->dblock, MKREF(flush2db));
        ibuf = map_dblock(db);
        dbuf = map_dblock_2(dblk(b));
-       if (test_bit(B_Phase1, &b->flags))
-               set_bit(B_WritePhase1, &b->flags);
-       else
-               clear_bit(B_WritePhase1, &b->flags);
 
        if (test_and_clear_bit(B_UnincCredit, &b->flags))
                lafs_space_return(fs, 1);
@@ -1308,10 +1304,6 @@ static void cluster_flush(struct fs *fs, int cnum)
                int credits = 0;
                b = list_entry(wc->clhead.next, struct block, lru);
                dprintk("flushing %s\n", strblk(b));
-               if (test_bit(B_Phase1, &b->flags))
-                       set_bit(B_WritePhase1, &b->flags);
-               else
-                       clear_bit(B_WritePhase1, &b->flags);
 
                if (test_and_clear_bit(B_Realloc, &b->flags))
                        credits++;
@@ -1331,13 +1323,7 @@ static void cluster_flush(struct fs *fs, int cnum)
                                            MKREF(cflush));
                        spin_unlock(&dblk(b)->my_inode->i_data.private_lock);
 
-                       if (ib) {
-                               if (test_bit(B_Phase1, &ib->b.flags))
-                                       set_bit(B_WritePhase1, &ib->b.flags);
-                               else
-                                       clear_bit(B_WritePhase1, &ib->b.flags);
-                               putiref(ib, MKREF(cflush));
-                       }
+                       putiref(ib, MKREF(cflush));
                }
                spin_lock(&fs->lock);
                list_del(&b->lru);
index ef0010f5f5258bcd991eea54848d04fc29b666cd..1720f6ffba30f4f7185467ff7be87862744e3e53 100644 (file)
--- a/modify.c
+++ b/modify.c
@@ -1987,7 +1987,6 @@ retry:
  * at least until it is written.  We actually wait until the
  * phase passes
  * The same applies to InoIdx blocks.
- * FIXME use WritePhase here ???
  * FIXME should I encourage this with a cluster_flush ??
  */
 void lafs_phase_wait(struct block *b)
index 7932074299432ed14fed4611e5e992450ce9da8d..44acf8a6c804a68edba2348f4254ac5af2d3f13d 100644 (file)
--- a/orphan.c
+++ b/orphan.c
@@ -146,7 +146,6 @@ static struct datablock *orphan_pin(struct fs *fs, struct datablock *b)
        /* that *must* succeed as we own a reference on the block already */
        LAFS_BUG(ob == NULL, &b->b);
 
-       lafs_phase_wait(&ob->b);
        err = lafs_pin_dblock(ob, ReleaseSpace);
        if (err) {
                putdref(ob, MKREF(orphan));
@@ -323,8 +322,6 @@ void lafs_orphan_release(struct fs *fs, struct datablock *b)
 
        lafs_checkpoint_lock(fs);
 
-       lafs_phase_wait(&ob1->b);
-
        if (lafs_pin_dblock(ob1, ReleaseSpace) < 0)
                goto out;
 
@@ -352,7 +349,6 @@ void lafs_orphan_release(struct fs *fs, struct datablock *b)
                        printk("OUCH 2\n");
                        goto out_unlock;
                }
-               lafs_phase_wait(&ob2->b);
                if (lafs_pin_dblock(ob2, ReleaseSpace) < 0) {
                        putdref(ob2, MKREF(orphan_move));
                        goto out_unlock;
diff --git a/state.h b/state.h
index 61ea846b919caffb4844541e3de44b2bc4e02d57..8a51e200cc631cd5e25282d8abe779c399845d20 100644 (file)
--- a/state.h
+++ b/state.h
@@ -433,17 +433,16 @@ struct indexblock {
 #define dblk(__bl) container_of(__bl, struct datablock, b)
 
 enum {
-       /* NOTE: 32 flags in used.  Need to overlap 'data' with 'index' if
-        * we need more
+       /* NOTE: 31 flags in used.  Need to overlap 'data' with 'index' if
+        * we need much more
         */
        /* First flags that are meaningful for both Data and Index blocks
-        * Currently 23 */
+        * Currently 22 */
        B_Phase1 = 0,   /* phase when pinned  - must be '1' - used for indexing */
        B_Dirty,        /* block has changes which haven't been committed */
        B_Index,        /* This is an index block, not a data block */
        B_Linked,       /* block is known to be linked with all peers */
 
-       B_WritePhase1,   /* Block is pinned and has been written to this phase. */
        B_Realloc,      /* If set on a B_Dirty block, it was only dirtied for
                         * cleaning purposes and so should be written to the
                         * cleaner segment.