Generic Linux architectural discussions
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: linux-arch@vger.kernel.org
Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org
Subject: [PATCH 10/13] Use bool with jbd2_journal_cancel_revoke()
Date: Wed, 29 Apr 2015 20:22:34 +0100	[thread overview]
Message-ID: <20150429192233.24909.16973.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20150429192133.24909.43184.stgit@warthog.procyon.org.uk>

jbd2_journal_cancel_revoke() should return a bool as it returns a boolean
value only, and should use bool type for a couple of internal variables.  This
allows gcc to make better decisions.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 fs/jbd2/revoke.c     |   10 +++++-----
 include/linux/jbd2.h |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c
index c6cbaef2bda1..587b4947f0d0 100644
--- a/fs/jbd2/revoke.c
+++ b/fs/jbd2/revoke.c
@@ -417,12 +417,12 @@ int jbd2_journal_revoke(handle_t *handle, unsigned long long blocknr,
  * do not trust the Revoked bit on buffers unless RevokeValid is also
  * set.
  */
-int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
+bool jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
 {
 	struct jbd2_revoke_record_s *record;
 	journal_t *journal = handle->h_transaction->t_journal;
-	int need_cancel;
-	int did_revoke = 0;	/* akpm: debug */
+	bool need_cancel;
+	int did_revoke = false;	/* akpm: debug */
 	struct buffer_head *bh = jh2bh(jh);
 
 	jbd_debug(4, "journal_head %p, cancelling revoke\n", jh);
@@ -434,7 +434,7 @@ int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
 	if (test_set_buffer_revokevalid(bh)) {
 		need_cancel = test_clear_buffer_revoked(bh);
 	} else {
-		need_cancel = 1;
+		need_cancel = true;
 		clear_buffer_revoked(bh);
 	}
 
@@ -447,7 +447,7 @@ int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
 			list_del(&record->hash);
 			spin_unlock(&journal->j_revoke_lock);
 			kmem_cache_free(jbd2_revoke_record_cache, record);
-			did_revoke = 1;
+			did_revoke = true;
 		}
 	}
 
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 20e7f78041c8..716f1d15e83d 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -1219,7 +1219,7 @@ extern int	   jbd2_journal_init_revoke_caches(void);
 
 extern void	   jbd2_journal_destroy_revoke(journal_t *);
 extern int	   jbd2_journal_revoke (handle_t *, unsigned long long, struct buffer_head *);
-extern int	   jbd2_journal_cancel_revoke(handle_t *, struct journal_head *);
+extern bool	   jbd2_journal_cancel_revoke(handle_t *, struct journal_head *);
 extern void	   jbd2_journal_write_revoke_records(journal_t *journal,
 						     transaction_t *transaction,
 						     struct list_head *log_bufs,

  parent reply	other threads:[~2015-04-29 19:22 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-29 19:21 [RFC][PATCH 00/13] Convert bitop funcs to bool return type and propagate to various callers/users David Howells
2015-04-29 19:21 ` David Howells
2015-04-29 19:21 ` [PATCH 01/13] Make the x86 bitops like test_bit() return bool David Howells
2015-04-29 19:21   ` David Howells
2015-12-17 20:38   ` Dan Williams
2015-04-29 19:21 ` [PATCH 02/13] Make bitmap functions that return boolean values return a bool type David Howells
2015-04-29 19:21   ` David Howells
2015-04-29 19:21 ` [PATCH 03/13] Make generic bitops return bool David Howells
2015-04-29 19:21   ` David Howells
2015-04-29 19:21 ` [PATCH 04/13] Make cpumask functions that return boolean values " David Howells
2015-04-29 19:22 ` [PATCH 05/13] Make nodemask functions that return a boolean value " David Howells
2015-04-29 19:22   ` David Howells
2015-04-29 19:22 ` [PATCH 06/13] Make a bunch of mm funcs return bool when they're returning a boolean value David Howells
2015-04-29 19:22   ` David Howells
2015-04-29 19:22 ` [PATCH 07/13] Make some apic functions return bool when " David Howells
2015-04-29 19:22 ` [PATCH 08/13] Make tick functions that return a boolean value return bool David Howells
2015-04-29 19:22 ` [PATCH 09/13] input: Use bool and don't use !! on test_bit David Howells
2015-04-29 19:22   ` David Howells
2015-04-29 19:22 ` David Howells [this message]
2015-04-29 19:22   ` [PATCH 10/13] Use bool with jbd2_journal_cancel_revoke() David Howells
2015-04-29 19:22 ` [PATCH 11/13] test_taint() should return bool David Howells
2015-04-29 19:22   ` David Howells
2015-04-29 19:22 ` [PATCH 12/13] netlink: Use bool when returning boolean values David Howells
2015-04-29 19:22   ` David Howells
2015-04-29 19:22 ` [PATCH 13/13] Make xfrm functions that return a boolean value return bool David Howells
2015-04-29 19:22   ` David Howells

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=20150429192233.24909.16973.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@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