[PATCH for-next 1/3] btrfs: fix to return bool instead of int

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
Signed-off-by: Naohiro Aota <naohiro.aota@xxxxxxx>
---
 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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux