diff mbox

[2/2] xfs: kill meaningless variable 'zero'

Message ID 20170907034254.7180-2-eguan@redhat.com (mailing list archive)
State Accepted
Headers show

Commit Message

Eryu Guan Sept. 7, 2017, 3:42 a.m. UTC
In xfs_file_aio_write_checks(), variable 'zero' is there only to
satisfy xfs_zero_eof(), the result of it is ignored. Now, with
iomap_zero_range() based xfs_zero_eof(), we can safely pass NULL as
the last param of it and kill 'zero'.

Signed-off-by: Eryu Guan <eguan@redhat.com>
---
 fs/xfs/xfs_file.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Carlos Maiolino Sept. 7, 2017, 9:05 a.m. UTC | #1
On Thu, Sep 07, 2017 at 11:42:54AM +0800, Eryu Guan wrote:
> In xfs_file_aio_write_checks(), variable 'zero' is there only to
> satisfy xfs_zero_eof(), the result of it is ignored. Now, with
> iomap_zero_range() based xfs_zero_eof(), we can safely pass NULL as
> the last param of it and kill 'zero'.
> 

Looks good to me, you can add:

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>


> Signed-off-by: Eryu Guan <eguan@redhat.com>
> ---
>  fs/xfs/xfs_file.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> index 812cd17b331f..e7dbeed0f0cb 100644
> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -373,8 +373,6 @@ xfs_file_aio_write_checks(
>  	 */
>  	spin_lock(&ip->i_flags_lock);
>  	if (iocb->ki_pos > i_size_read(inode)) {
> -		bool	zero = false;
> -
>  		spin_unlock(&ip->i_flags_lock);
>  		if (!drained_dio) {
>  			if (*iolock == XFS_IOLOCK_SHARED) {
> @@ -395,7 +393,7 @@ xfs_file_aio_write_checks(
>  			drained_dio = true;
>  			goto restart;
>  		}
> -		error = xfs_zero_eof(ip, iocb->ki_pos, i_size_read(inode), &zero);
> +		error = xfs_zero_eof(ip, iocb->ki_pos, i_size_read(inode), NULL);
>  		if (error)
>  			return error;
>  	} else
> -- 
> 2.13.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig Sept. 8, 2017, 7:37 a.m. UTC | #2
Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 812cd17b331f..e7dbeed0f0cb 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -373,8 +373,6 @@  xfs_file_aio_write_checks(
 	 */
 	spin_lock(&ip->i_flags_lock);
 	if (iocb->ki_pos > i_size_read(inode)) {
-		bool	zero = false;
-
 		spin_unlock(&ip->i_flags_lock);
 		if (!drained_dio) {
 			if (*iolock == XFS_IOLOCK_SHARED) {
@@ -395,7 +393,7 @@  xfs_file_aio_write_checks(
 			drained_dio = true;
 			goto restart;
 		}
-		error = xfs_zero_eof(ip, iocb->ki_pos, i_size_read(inode), &zero);
+		error = xfs_zero_eof(ip, iocb->ki_pos, i_size_read(inode), NULL);
 		if (error)
 			return error;
 	} else