All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: xiakaixu1987@gmail.com
Cc: linux-xfs@vger.kernel.org, darrick.wong@oracle.com,
	Kaixu Xia <kaixuxia@tencent.com>
Subject: Re: [PATCH] xfs: remove unnecessary check of the variable resblks in xfs_symlink
Date: Mon, 20 Apr 2020 12:22:18 -0400	[thread overview]
Message-ID: <20200420162218.GC27216@bfoster> (raw)
In-Reply-To: <1587187851-11130-1-git-send-email-kaixuxia@tencent.com>

On Sat, Apr 18, 2020 at 01:30:51PM +0800, xiakaixu1987@gmail.com wrote:
> From: Kaixu Xia <kaixuxia@tencent.com>
> 
> Since the "no-allocation" reservations has been removed, the resblks
> value should be larger than zero, so remove the unnecessary check.
> 
> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
> ---

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

>  fs/xfs/xfs_symlink.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
> index 13fb4b919648..973441992b08 100644
> --- a/fs/xfs/xfs_symlink.c
> +++ b/fs/xfs/xfs_symlink.c
> @@ -243,8 +243,7 @@ xfs_symlink(
>  	 */
>  	xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp, pdqp);
>  
> -	if (resblks)
> -		resblks -= XFS_IALLOC_SPACE_RES(mp);
> +	resblks -= XFS_IALLOC_SPACE_RES(mp);
>  	/*
>  	 * If the symlink will fit into the inode, write it inline.
>  	 */
> @@ -265,8 +264,7 @@ xfs_symlink(
>  		if (error)
>  			goto out_trans_cancel;
>  
> -		if (resblks)
> -			resblks -= fs_blocks;
> +		resblks -= fs_blocks;
>  		ip->i_d.di_size = pathlen;
>  		xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
>  
> -- 
> 2.20.0
> 


  reply	other threads:[~2020-04-20 16:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-18  5:30 [PATCH] xfs: remove unnecessary check of the variable resblks in xfs_symlink xiakaixu1987
2020-04-20 16:22 ` Brian Foster [this message]
2020-04-27 17:57 ` Darrick J. Wong

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=20200420162218.GC27216@bfoster \
    --to=bfoster@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=kaixuxia@tencent.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=xiakaixu1987@gmail.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.