From: Milan Broz <mbroz@redhat.com>

Optimize one-shot write processing request.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Milan Broz <mbroz@redhat.com>
---
 drivers/md/dm-crypt.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

Index: linux-2.6.23/drivers/md/dm-crypt.c
===================================================================
--- linux-2.6.23.orig/drivers/md/dm-crypt.c	2007-10-10 17:20:58.000000000 +0100
+++ linux-2.6.23/drivers/md/dm-crypt.c	2007-10-10 17:20:59.000000000 +0100
@@ -627,9 +627,11 @@ static void process_write_endio(struct d
 	/* Do not reference clone after this - it
 	 * may be gone already. */
 
+	if (likely(!remaining))
+		return;
+
 	/* out of memory -> run queues */
-	if (remaining)
-		congestion_wait(WRITE, HZ / 100);
+	congestion_wait(WRITE, HZ / 100);
 }
 
 static void crypt_write_done(struct dm_crypt_io *io)
