All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Brassow <jbrassow@redhat.com>
To: dm-devel@redhat.com
Subject: [PATCH 21 of 33] DM Snapshot:  small code optimization
Date: Wed, 25 Mar 2009 16:37:06 -0500	[thread overview]
Message-ID: <200903252137.n2PLb63K022098@hydrogen.msp.redhat.com> (raw)

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>

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
@@ -741,20 +741,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.

             reply	other threads:[~2009-03-25 21:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-25 21:37 Jonathan Brassow [this message]
2009-04-06 21:36 [PATCH 21 of 33] DM Snapshot: small code optimization Jonathan Brassow
2009-05-01 14:19 Jonathan Brassow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200903252137.n2PLb63K022098@hydrogen.msp.redhat.com \
    --to=jbrassow@redhat.com \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.