diff mbox series

[09/12] xfs: use bool for done in xfs_inode_ag_walk

Message ID 159011606568.77079.15373820626926543851.stgit@magnolia (mailing list archive)
State Accepted
Headers show
Series xfs: refactor incore inode walking | expand

Commit Message

Darrick J. Wong May 22, 2020, 2:54 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

This is a boolean variable, so use the bool type.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_icache.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Brian Foster May 22, 2020, 12:23 p.m. UTC | #1
On Thu, May 21, 2020 at 07:54:25PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> This is a boolean variable, so use the bool type.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_icache.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> index 31d85cc4bd8b..791544a1d54c 100644
> --- a/fs/xfs/xfs_icache.c
> +++ b/fs/xfs/xfs_icache.c
> @@ -803,11 +803,11 @@ xfs_inode_ag_walk(
>  	uint32_t		first_index;
>  	int			last_error = 0;
>  	int			skipped;
> -	int			done;
> +	bool			done;
>  	int			nr_found;
>  
>  restart:
> -	done = 0;
> +	done = false;
>  	skipped = 0;
>  	first_index = 0;
>  	nr_found = 0;
> @@ -859,7 +859,7 @@ xfs_inode_ag_walk(
>  				continue;
>  			first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1);
>  			if (first_index < XFS_INO_TO_AGINO(mp, ip->i_ino))
> -				done = 1;
> +				done = true;
>  		}
>  
>  		/* unlock now we've grabbed the inodes. */
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 31d85cc4bd8b..791544a1d54c 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -803,11 +803,11 @@  xfs_inode_ag_walk(
 	uint32_t		first_index;
 	int			last_error = 0;
 	int			skipped;
-	int			done;
+	bool			done;
 	int			nr_found;
 
 restart:
-	done = 0;
+	done = false;
 	skipped = 0;
 	first_index = 0;
 	nr_found = 0;
@@ -859,7 +859,7 @@  xfs_inode_ag_walk(
 				continue;
 			first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1);
 			if (first_index < XFS_INO_TO_AGINO(mp, ip->i_ino))
-				done = 1;
+				done = true;
 		}
 
 		/* unlock now we've grabbed the inodes. */