diff mbox

[21,of,33] DM Snapshot: small code optimization

Message ID 200905011419.n41EJsMV030011@hydrogen.msp.redhat.com (mailing list archive)
State Superseded, archived
Delegated to: Alasdair Kergon
Headers show

Commit Message

Jonthan Brassow May 1, 2009, 2:19 p.m. UTC
Patch name: dm-snap-small-code-optimization.patch

Minor code clean-up.  I don't see a reason to check
's->valid' separately anymore.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox

Patch

Index: linux-2.6/drivers/md/dm-snap.c
===================================================================
--- linux-2.6.orig/drivers/md/dm-snap.c
+++ linux-2.6/drivers/md/dm-snap.c
@@ -740,20 +740,14 @@  static void pending_complete(struct dm_s
 	struct bio *snapshot_bios = NULL;
 	int error = 0;
 
+	down_write(&s->lock);
 	if (!success) {
 		/* Read/write error - snapshot is unusable */
-		down_write(&s->lock);
 		__invalidate_snapshot(s, -EIO);
 		error = 1;
 		goto out;
 	}
 
-	down_write(&s->lock);
-	if (!s->valid) {
-		error = 1;
-		goto out;
-	}
-
 	/*
 	 * Check for conflicting reads. This is extremely improbable,
 	 * so msleep(1) is sufficient and there is no need for a wait queue.