public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Carlos Maiolino <cmaiolino@redhat.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH v4 4/4] xfs: Convert xfs_attr_sf macros to inline functions
Date: Mon, 7 Sep 2020 08:00:11 +1000	[thread overview]
Message-ID: <20200906220011.GN12131@dread.disaster.area> (raw)
In-Reply-To: <20200903161859.85511-1-cmaiolino@redhat.com>

On Thu, Sep 03, 2020 at 06:18:59PM +0200, Carlos Maiolino wrote:
> xfs_attr_sf_totsize() requires access to xfs_inode structure, so, once
> xfs_attr_shortform_addname() is its only user, move it to xfs_attr.c
> instead of playing with more #includes.
> 
> Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
> ---
> 
> Changelog:
> 	V2:
> 	 - keep macro comments above inline functions
> 	V3:
> 	- Add extra spacing in xfs_attr_sf_totsize()
> 	- Fix open curling braces on inline functions
> 	- use void * casting on xfs_attr_sf_nextentry()
> 	V4:
> 	- Fix open curling braces
> 	- remove unneeded parenthesis
> 
>  fs/xfs/libxfs/xfs_attr.c      | 15 ++++++++++++---
>  fs/xfs/libxfs/xfs_attr_leaf.c | 18 +++++++++---------
>  fs/xfs/libxfs/xfs_attr_sf.h   | 30 +++++++++++++++++++-----------
>  fs/xfs/xfs_attr_list.c        |  4 ++--
>  4 files changed, 42 insertions(+), 25 deletions(-)

Couple of minor nits below.

> diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
> index 2e055c079f397..16ef80943b8ef 100644
> --- a/fs/xfs/libxfs/xfs_attr.c
> +++ b/fs/xfs/libxfs/xfs_attr.c
> @@ -428,7 +428,7 @@ xfs_attr_set(
>  		 */
>  		if (XFS_IFORK_Q(dp) == 0) {
>  			int sf_size = sizeof(struct xfs_attr_sf_hdr) +
> -				XFS_ATTR_SF_ENTSIZE_BYNAME(args->namelen,
> +				xfs_attr_sf_entsize_byname(args->namelen,
>  						args->valuelen);
>  
>  			error = xfs_bmap_add_attrfork(dp, sf_size, rsvd);
> @@ -523,6 +523,15 @@ xfs_attr_set(
>   * External routines when attribute list is inside the inode
>   *========================================================================*/
>  
> +/* total space in use */

Comment is redundant.

> +static inline int xfs_attr_sf_totsize(struct xfs_inode *dp)
> +{
> +	struct xfs_attr_shortform *sf =
> +		(struct xfs_attr_shortform *)dp->i_afp->if_u1.if_data;
> +
> +	return be16_to_cpu(sf->hdr.totsize);
> +}

If you have to break the declaration line like that, you
may as well just do:

+	struct xfs_attr_shortform *sf;
+
+	sf = (struct xfs_attr_shortform *)dp->i_afp->if_u1.if_data;
+	return be16_to_cpu(sf->hdr.totsize);


Otherwise the patch looks fine.

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

  parent reply	other threads:[~2020-09-06 22:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03 14:28 [PATCH v3 0/4] Clean up xfs_attr_sf_entry Carlos Maiolino
2020-09-03 14:28 ` [PATCH 1/4] xfs: remove typedef xfs_attr_sf_entry_t Carlos Maiolino
2020-09-06 21:52   ` Dave Chinner
2020-09-03 14:28 ` [PATCH 2/4] xfs: Remove typedef xfs_attr_shortform_t Carlos Maiolino
2020-09-06 21:53   ` Dave Chinner
2020-09-03 14:28 ` [PATCH v3 3/4] xfs: Use variable-size array for nameval in xfs_attr_sf_entry Carlos Maiolino
2020-09-03 14:32   ` Christoph Hellwig
2020-09-03 16:17   ` [PATCH v4 " Carlos Maiolino
2020-09-03 16:18     ` [PATCH v4 4/4] xfs: Convert xfs_attr_sf macros to inline functions Carlos Maiolino
2020-09-04  7:53       ` Carlos Maiolino
2020-09-04 15:42         ` Darrick J. Wong
2020-09-04 15:41       ` Darrick J. Wong
2020-09-06 22:00       ` Dave Chinner [this message]
2020-09-07 11:33         ` Carlos Maiolino
2020-09-07 11:47       ` [PATCH V5 " Carlos Maiolino
2020-09-04 15:42     ` [PATCH v4 3/4] xfs: Use variable-size array for nameval in xfs_attr_sf_entry Darrick J. Wong
2020-09-06 21:53     ` Dave Chinner
2020-09-03 14:28 ` [PATCH v3 4/4] xfs: Convert xfs_attr_sf macros to inline functions Carlos Maiolino
2020-09-03 14:33   ` Christoph Hellwig
2020-09-03 16:05     ` Carlos Maiolino

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=20200906220011.GN12131@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=cmaiolino@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox