From: NeilBrown Date: Tue, 29 Jun 2010 11:45:52 +0000 (+1000) Subject: Remove all to lafs_io_wake in lafs_cluster_allocate X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=3722e58cf5aecdc9f965c7c98eb0c432fc2ccae5;p=LaFS.git Remove all to lafs_io_wake in lafs_cluster_allocate 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 --- diff --git a/cluster.c b/cluster.c index 00d508b..04f5930 100644 --- 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);