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@xxxxxxxxx> > --- > 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 >