All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Cc: josef@toxicpanda.com
Subject: [PATCH 2/5] btrfs: btrfs_extent_readonly() change return type to bool
Date: Wed, 10 Feb 2021 21:25:16 -0800	[thread overview]
Message-ID: <3c0e3bc3fa0577bded592b37d281e8fd27a8f779.1613019838.git.anand.jain@oracle.com> (raw)
In-Reply-To: <cover.1613019838.git.anand.jain@oracle.com>

btrfs_extent_readonly() checks if the bg is readonly, the bool return type
will suffice its need.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/inode.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 2ed7d736e39a..ebb2b8e3a71c 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -7256,14 +7256,14 @@ static struct extent_map *btrfs_new_extent_direct(struct btrfs_inode *inode,
 	return em;
 }
 
-static int btrfs_extent_readonly(struct btrfs_fs_info *fs_info, u64 bytenr)
+static bool btrfs_extent_readonly(struct btrfs_fs_info *fs_info, u64 bytenr)
 {
 	struct btrfs_block_group *block_group;
-	int readonly = 0;
+	bool readonly = false;
 
 	block_group = btrfs_lookup_block_group(fs_info, bytenr);
 	if (!block_group || block_group->ro)
-		readonly = 1;
+		readonly = true;
 	if (block_group)
 		btrfs_put_block_group(block_group);
 	return readonly;
-- 
2.27.0


  parent reply	other threads:[~2021-02-11  5:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-11  5:25 [PATCH 0/5] cleanups btrfs_extent_readonly() and scrub, part1 Anand Jain
2021-02-11  5:25 ` [PATCH 1/5] btrfs: make btrfs_extent_readonly() static Anand Jain
2021-02-11  5:25 ` Anand Jain [this message]
2021-02-11 13:00   ` [PATCH 2/5] btrfs: btrfs_extent_readonly() change return type to bool Johannes Thumshirn
2021-02-11  5:25 ` [PATCH 3/5] btrfs: scrub drop few function declarations Anand Jain
2021-02-11 13:27   ` Johannes Thumshirn
2021-02-11  5:25 ` [PATCH 4/5] btrfs: scrub_checksum_tree_block() drop its function declaration Anand Jain
2021-02-11 13:28   ` Johannes Thumshirn
2021-02-12 14:36   ` David Sterba
2021-02-25  1:21     ` Anand Jain
2021-02-25 16:16       ` David Sterba
2021-02-11  5:25 ` [PATCH 5/5] btrfs: scrub_checksum_data() " Anand Jain
2021-02-11 13:30   ` Johannes Thumshirn

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=3c0e3bc3fa0577bded592b37d281e8fd27a8f779.1613019838.git.anand.jain@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@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 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.