]> git.neil.brown.name Git - LaFS.git/commitdiff
Remove all to lafs_io_wake in lafs_cluster_allocate
authorNeilBrown <neilb@suse.de>
Tue, 29 Jun 2010 11:45:52 +0000 (21:45 +1000)
committerNeilBrown <neilb@suse.de>
Fri, 2 Jul 2010 23:31:19 +0000 (09:31 +1000)
We only need io_wake when we unlock or clear writeback, and neither of
those happen here so discard the call, put in a 'break' instead and
turn the (hard to read) do loop into a for loop.

Signed-off-by: NeilBrown <neilb@suse.de>
cluster.c

index 00d508b5c5ad7b5d6557756714d588314bf82aa9..04f593086a83a8084c98e084707bc59e634087d0 100644 (file)
--- a/cluster.c
+++ b/cluster.c
@@ -746,7 +746,7 @@ int lafs_cluster_allocate(struct block *b, int cnum)
 
        getref(b, MKREF(cluster)); /* we soon own a reference in the list */
 
-       do {
+       for (;;) {
                int avail;
                /* see how much room is in cluster.
                 * The interesting values are:
@@ -767,7 +767,7 @@ int lafs_cluster_allocate(struct block *b, int cnum)
                used = cluster_insert(&wc->slhead, &wc->clhead, b, avail);
 
                if (used >= 0)
-                       lafs_io_wake(b);
+                       break;
                else if (wc->slhead.b)
                        cluster_flush(fs, cnum);
                else {
@@ -784,8 +784,7 @@ int lafs_cluster_allocate(struct block *b, int cnum)
                                return -ENOSPC;
                        }
                }
-
-       } while (used < 0);
+       }
 
        if (used > 0)
                wc->cluster_space -= sizeof(struct descriptor);