All of lore.kernel.org
 help / color / mirror / Atom feed
From: Naohiro Aota <naohiro.aota@wdc.com>
To: linux-btrfs@vger.kernel.org, David Sterba <dsterba@suse.com>
Cc: Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	Julia Lawall <julia.lawall@inria.fr>,
	Anand Jain <anand.jain@oracle.com>,
	Josef Bacik <josef@toxicpanda.com>,
	linux-fsdevel@vger.kernel.org,
	Naohiro Aota <naohiro.aota@wdc.com>,
	kernel test robot <lkp@intel.com>
Subject: [PATCH for-next 1/3] btrfs: fix to return bool instead of int
Date: Mon,  1 Feb 2021 17:52:02 +0900	[thread overview]
Message-ID: <20210201085204.700090-2-naohiro.aota@wdc.com> (raw)
In-Reply-To: <20210201085204.700090-1-naohiro.aota@wdc.com>

The variable "changed" in dev_extent_hole_check_zoned() is using int
(0/1) to track if the hole is changed. Change it to bool to match the
definition of the function.

Fixes: 69e81c8e2824 ("btrfs: implement zoned chunk allocator")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 fs/btrfs/volumes.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index fe2ed5f80804..102dc6636833 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1433,7 +1433,7 @@ static bool dev_extent_hole_check_zoned(struct btrfs_device *device,
 	u64 zone_size = device->zone_info->zone_size;
 	u64 pos;
 	int ret;
-	int changed = 0;
+	bool changed = false;
 
 	ASSERT(IS_ALIGNED(*hole_start, zone_size));
 
@@ -1444,7 +1444,7 @@ static bool dev_extent_hole_check_zoned(struct btrfs_device *device,
 		if (pos != *hole_start) {
 			*hole_size = *hole_start + *hole_size - pos;
 			*hole_start = pos;
-			changed = 1;
+			changed = true;
 			if (*hole_size < num_bytes)
 				break;
 		}
@@ -1459,12 +1459,12 @@ static bool dev_extent_hole_check_zoned(struct btrfs_device *device,
 		if (ret == -ERANGE) {
 			*hole_start += *hole_size;
 			*hole_size = 0;
-			return 1;
+			return true;
 		}
 
 		*hole_start += zone_size;
 		*hole_size -= zone_size;
-		changed = 1;
+		changed = true;
 	}
 
 	return changed;
-- 
2.30.0


  reply	other threads:[~2021-02-01  8:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01  8:52 [PATCH for-next 0/3] Fix potential deadlock, types and typo in zoned series Naohiro Aota
2021-02-01  8:52 ` Naohiro Aota [this message]
2021-02-01  8:52 ` [PATCH for-next 2/3] btrfs: properly unlock log_mutex in error case Naohiro Aota
2021-02-01  8:52 ` [PATCH for-next 3/3] btrfs: fix a typo in comment Naohiro Aota
2021-02-01 17:48 ` [PATCH for-next 0/3] Fix potential deadlock, types and typo in zoned series David Sterba

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=20210201085204.700090-2-naohiro.aota@wdc.com \
    --to=naohiro.aota@wdc.com \
    --cc=anand.jain@oracle.com \
    --cc=dsterba@suse.com \
    --cc=johannes.thumshirn@wdc.com \
    --cc=josef@toxicpanda.com \
    --cc=julia.lawall@inria.fr \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=lkp@intel.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.