diff mbox series

[1/3] xfs: convert noroom, okalloc in xfs_dialloc() to bool

Message ID 20201124155130.40848-1-hsiangkao@redhat.com (mailing list archive)
State Superseded
Headers show
Series [1/3] xfs: convert noroom, okalloc in xfs_dialloc() to bool | expand

Commit Message

Gao Xiang Nov. 24, 2020, 3:51 p.m. UTC
Boolean is preferred for such use.

Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
---
 fs/xfs/libxfs/xfs_ialloc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Christoph Hellwig Dec. 1, 2020, 10:19 a.m. UTC | #1
Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
Darrick J. Wong Dec. 1, 2020, 4:56 p.m. UTC | #2
On Tue, Nov 24, 2020 at 11:51:28PM +0800, Gao Xiang wrote:
> Boolean is preferred for such use.
> 
> Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Looks simple enough,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/libxfs/xfs_ialloc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
> index 974e71bc4a3a..45cf7e55f5ee 100644
> --- a/fs/xfs/libxfs/xfs_ialloc.c
> +++ b/fs/xfs/libxfs/xfs_ialloc.c
> @@ -1716,11 +1716,11 @@ xfs_dialloc(
>  	xfs_agnumber_t		agno;
>  	int			error;
>  	int			ialloced;
> -	int			noroom = 0;
> +	bool			noroom = false;
>  	xfs_agnumber_t		start_agno;
>  	struct xfs_perag	*pag;
>  	struct xfs_ino_geometry	*igeo = M_IGEO(mp);
> -	int			okalloc = 1;
> +	bool			okalloc = true;
>  
>  	if (*IO_agbp) {
>  		/*
> @@ -1753,8 +1753,8 @@ xfs_dialloc(
>  	if (igeo->maxicount &&
>  	    percpu_counter_read_positive(&mp->m_icount) + igeo->ialloc_inos
>  							> igeo->maxicount) {
> -		noroom = 1;
> -		okalloc = 0;
> +		noroom = true;
> +		okalloc = false;
>  	}
>  
>  	/*
> -- 
> 2.18.4
>
diff mbox series

Patch

diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
index 974e71bc4a3a..45cf7e55f5ee 100644
--- a/fs/xfs/libxfs/xfs_ialloc.c
+++ b/fs/xfs/libxfs/xfs_ialloc.c
@@ -1716,11 +1716,11 @@  xfs_dialloc(
 	xfs_agnumber_t		agno;
 	int			error;
 	int			ialloced;
-	int			noroom = 0;
+	bool			noroom = false;
 	xfs_agnumber_t		start_agno;
 	struct xfs_perag	*pag;
 	struct xfs_ino_geometry	*igeo = M_IGEO(mp);
-	int			okalloc = 1;
+	bool			okalloc = true;
 
 	if (*IO_agbp) {
 		/*
@@ -1753,8 +1753,8 @@  xfs_dialloc(
 	if (igeo->maxicount &&
 	    percpu_counter_read_positive(&mp->m_icount) + igeo->ialloc_inos
 							> igeo->maxicount) {
-		noroom = 1;
-		okalloc = 0;
+		noroom = true;
+		okalloc = false;
 	}
 
 	/*