From: Brian Foster <bfoster@redhat.com>
To: Chandan Rajendra <chandanrlinux@gmail.com>
Cc: linux-xfs@vger.kernel.org, david@fromorbit.com,
chandan@linux.ibm.com, darrick.wong@oracle.com
Subject: Re: [PATCH V3 1/2] xfs: Pass xattr name and value length explicitly to xfs_attr_leaf_newentsize
Date: Wed, 12 Feb 2020 10:11:15 -0500 [thread overview]
Message-ID: <20200212151115.GA17921@bfoster> (raw)
In-Reply-To: <20200129045939.10380-1-chandanrlinux@gmail.com>
On Wed, Jan 29, 2020 at 10:29:38AM +0530, Chandan Rajendra wrote:
> This commit changes xfs_attr_leaf_newentsize() to explicitly accept name and
> value length instead of a pointer to struct xfs_da_args. The next commit will
> need to invoke xfs_attr_leaf_newentsize() from functions that do not have
> a struct xfs_da_args to pass in.
>
> Signed-off-by: Chandan Rajendra <chandanrlinux@gmail.com>
> ---
> fs/xfs/libxfs/xfs_attr.c | 3 ++-
> fs/xfs/libxfs/xfs_attr_leaf.c | 41 ++++++++++++++++++++++++-----------
> fs/xfs/libxfs/xfs_attr_leaf.h | 3 ++-
> 3 files changed, 32 insertions(+), 15 deletions(-)
>
...
> diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
> index 08d4b10ae2d53..7cd57e5844d80 100644
> --- a/fs/xfs/libxfs/xfs_attr_leaf.c
> +++ b/fs/xfs/libxfs/xfs_attr_leaf.c
...
> @@ -2687,20 +2700,22 @@ xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index)
> */
> int
> xfs_attr_leaf_newentsize(
> - struct xfs_da_args *args,
> + struct xfs_mount *mp,
Any reason not to just pass the geo here rather than the mount?
Otherwise looks fine to me.
Brian
> + int namelen,
> + int valuelen,
> int *local)
> {
> int size;
>
> - size = xfs_attr_leaf_entsize_local(args->namelen, args->valuelen);
> - if (size < xfs_attr_leaf_entsize_local_max(args->geo->blksize)) {
> + size = xfs_attr_leaf_entsize_local(namelen, valuelen);
> + if (size < xfs_attr_leaf_entsize_local_max(mp->m_attr_geo->blksize)) {
> if (local)
> *local = 1;
> return size;
> }
> if (local)
> *local = 0;
> - return xfs_attr_leaf_entsize_remote(args->namelen);
> + return xfs_attr_leaf_entsize_remote(namelen);
> }
>
>
> diff --git a/fs/xfs/libxfs/xfs_attr_leaf.h b/fs/xfs/libxfs/xfs_attr_leaf.h
> index f4a188e28b7b6..0ce1f9301157e 100644
> --- a/fs/xfs/libxfs/xfs_attr_leaf.h
> +++ b/fs/xfs/libxfs/xfs_attr_leaf.h
> @@ -106,7 +106,8 @@ void xfs_attr3_leaf_unbalance(struct xfs_da_state *state,
> xfs_dahash_t xfs_attr_leaf_lasthash(struct xfs_buf *bp, int *count);
> int xfs_attr_leaf_order(struct xfs_buf *leaf1_bp,
> struct xfs_buf *leaf2_bp);
> -int xfs_attr_leaf_newentsize(struct xfs_da_args *args, int *local);
> +int xfs_attr_leaf_newentsize(struct xfs_mount *mp, int namelen,
> + int valuelen, int *local);
> int xfs_attr3_leaf_read(struct xfs_trans *tp, struct xfs_inode *dp,
> xfs_dablk_t bno, struct xfs_buf **bpp);
> void xfs_attr3_leaf_hdr_from_disk(struct xfs_da_geometry *geo,
> --
> 2.19.1
>
next prev parent reply other threads:[~2020-02-12 15:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-29 4:59 [PATCH V3 1/2] xfs: Pass xattr name and value length explicitly to xfs_attr_leaf_newentsize Chandan Rajendra
2020-01-29 4:59 ` [PATCH V3 2/2] xfs: Fix log reservation calculation for xattr insert operation Chandan Rajendra
2020-02-12 15:13 ` Brian Foster
2020-02-13 14:47 ` Chandan Rajendra
2020-02-12 17:27 ` Darrick J. Wong
2020-02-12 15:11 ` Brian Foster [this message]
2020-02-17 7:57 ` [PATCH V3 1/2] xfs: Pass xattr name and value length explicitly to xfs_attr_leaf_newentsize Chandan Rajendra
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=20200212151115.GA17921@bfoster \
--to=bfoster@redhat.com \
--cc=chandan@linux.ibm.com \
--cc=chandanrlinux@gmail.com \
--cc=darrick.wong@oracle.com \
--cc=david@fromorbit.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 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.