All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alli <allison.henderson@oracle.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: linux-xfs@vger.kernel.org, david@fromorbit.com
Subject: Re: [PATCH 6/7] xfs: clean up state variable usage in xfs_attr_node_remove_attr
Date: Thu, 19 May 2022 13:34:19 -0700	[thread overview]
Message-ID: <10fb9319f267fb51ea6f527d4cb5a69324a8024b.camel@oracle.com> (raw)
In-Reply-To: <165290017800.1647637.17976841524804650684.stgit@magnolia>

On Wed, 2022-05-18 at 11:56 -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> The state variable is now a local variable pointing to a heap
> allocation, so we don't need to zero-initialize it, nor do we need
> the
> conditional to decide if we should free it.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Looks ok
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
> ---
>  fs/xfs/libxfs/xfs_attr.c |    7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> 
> diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
> index 162fbac78524..b1300bd10318 100644
> --- a/fs/xfs/libxfs/xfs_attr.c
> +++ b/fs/xfs/libxfs/xfs_attr.c
> @@ -1516,7 +1516,7 @@ xfs_attr_node_remove_attr(
>  	struct xfs_attr_item		*attr)
>  {
>  	struct xfs_da_args		*args = attr->xattri_da_args;
> -	struct xfs_da_state		*state = NULL;
> +	struct xfs_da_state		*state =
> xfs_da_state_alloc(args);
>  	int				retval = 0;
>  	int				error = 0;
>  
> @@ -1526,8 +1526,6 @@ xfs_attr_node_remove_attr(
>  	 * attribute entry after any split ops.
>  	 */
>  	args->attr_filter |= XFS_ATTR_INCOMPLETE;
> -	state = xfs_da_state_alloc(args);
> -	state->inleaf = 0;
>  	error = xfs_da3_node_lookup_int(state, &retval);
>  	if (error)
>  		goto out;
> @@ -1545,8 +1543,7 @@ xfs_attr_node_remove_attr(
>  	retval = error = 0;
>  
>  out:
> -	if (state)
> -		xfs_da_state_free(state);
> +	xfs_da_state_free(state);
>  	if (error)
>  		return error;
>  	return retval;
> 


  reply	other threads:[~2022-05-19 20:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18 18:55 [PATCHSET v2 0/7] xfs: cleanups for logged xattr updates Darrick J. Wong
2022-05-18 18:55 ` [PATCH 1/7] xfs: clean up xfs_attr_node_hasname Darrick J. Wong
2022-05-20  3:42   ` Dave Chinner
2022-05-20 15:49     ` Darrick J. Wong
2022-05-18 18:55 ` [PATCH 2/7] xfs: put the xattr intent item op flags in their own namespace Darrick J. Wong
2022-05-19 20:34   ` Alli
2022-05-20  3:42   ` Dave Chinner
2022-05-18 18:56 ` [PATCH 3/7] xfs: use a separate slab cache for deferred xattr work state Darrick J. Wong
2022-05-20  3:50   ` Dave Chinner
2022-05-18 18:56 ` [PATCH 4/7] xfs: remove struct xfs_attr_item.xattri_flags Darrick J. Wong
2022-05-20  4:07   ` Dave Chinner
2022-05-18 18:56 ` [PATCH 5/7] xfs: put attr[id] log item cache init with the others Darrick J. Wong
2022-05-20  4:08   ` Dave Chinner
2022-05-18 18:56 ` [PATCH 6/7] xfs: clean up state variable usage in xfs_attr_node_remove_attr Darrick J. Wong
2022-05-19 20:34   ` Alli [this message]
2022-05-20  4:09   ` Dave Chinner
2022-05-18 18:56 ` [PATCH 7/7] xfs: rename struct xfs_attr_item to xfs_attr_intent Darrick J. Wong
2022-05-20  4:10   ` Dave Chinner

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=10fb9319f267fb51ea6f527d4cb5a69324a8024b.camel@oracle.com \
    --to=allison.henderson@oracle.com \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /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.