public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Kaiser <nikai@nikai.net>
To: reiserfs-devel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] reiserfs: simplify conditional
Date: Thu, 7 Oct 2010 12:50:15 +0200	[thread overview]
Message-ID: <20101007125015.3040dcc6@absol.kitzblitz> (raw)

Simplify:
 ((!a && b) || (!a && c) || (!a && d) || (!a && e)) =>
  (!a && (b || c || d || e))

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
---
 fs/reiserfs/journal.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 076c8b1..7fa0814 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -3055,15 +3055,14 @@ static int do_journal_begin_r(struct reiserfs_transaction_handle *th,
 	 ** we don't sleep if there aren't other writers
 	 */
 
-	if ((!join && journal->j_must_wait > 0) ||
-	    (!join
-	     && (journal->j_len_alloc + nblocks + 2) >= journal->j_max_batch)
-	    || (!join && atomic_read(&journal->j_wcount) > 0
-		&& journal->j_trans_start_time > 0
-		&& (now - journal->j_trans_start_time) >
-		journal->j_max_trans_age) || (!join
-					      && atomic_read(&journal->j_jlock))
-	    || (!join && journal->j_cnode_free < (journal->j_trans_max * 3))) {
+	if (!join &&
+	    ((journal->j_must_wait > 0) ||
+	     ((journal->j_len_alloc + nblocks + 2) >= journal->j_max_batch) ||
+	     (atomic_read(&journal->j_wcount) > 0 &&
+	      journal->j_trans_start_time > 0 &&
+	      (now - journal->j_trans_start_time) > journal->j_max_trans_age) ||
+	     (atomic_read(&journal->j_jlock)) ||
+	     (journal->j_cnode_free < (journal->j_trans_max * 3)))) {
 
 		old_trans_id = journal->j_trans_id;
 		unlock_journal(sb);	/* allow others to finish this transaction */
-- 
1.7.2.2

                 reply	other threads:[~2010-10-07 10:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20101007125015.3040dcc6@absol.kitzblitz \
    --to=nikai@nikai.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reiserfs-devel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox