Commit 1fb4b0de authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Chandan Babu R

xfs: use xfs_attr_sf_findname in xfs_attr_shortform_getvalue

xfs_attr_shortform_getvalue duplicates the logic in xfs_attr_sf_findname.
Use the helper instead.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatar"Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
parent 22b7b1f5
...@@ -848,23 +848,17 @@ int ...@@ -848,23 +848,17 @@ int
xfs_attr_shortform_getvalue( xfs_attr_shortform_getvalue(
struct xfs_da_args *args) struct xfs_da_args *args)
{ {
struct xfs_attr_shortform *sf = args->dp->i_af.if_data;
struct xfs_attr_sf_entry *sfe; struct xfs_attr_sf_entry *sfe;
int i;
ASSERT(args->dp->i_af.if_format == XFS_DINODE_FMT_LOCAL); ASSERT(args->dp->i_af.if_format == XFS_DINODE_FMT_LOCAL);
trace_xfs_attr_sf_lookup(args); trace_xfs_attr_sf_lookup(args);
sfe = &sf->list[0]; sfe = xfs_attr_sf_findname(args);
for (i = 0; i < sf->hdr.count; if (!sfe)
sfe = xfs_attr_sf_nextentry(sfe), i++) {
if (xfs_attr_match(args, sfe->namelen, sfe->nameval,
sfe->flags))
return xfs_attr_copy_value(args,
&sfe->nameval[args->namelen], sfe->valuelen);
}
return -ENOATTR; return -ENOATTR;
return xfs_attr_copy_value(args, &sfe->nameval[args->namelen],
sfe->valuelen);
} }
/* Convert from using the shortform to the leaf format. */ /* Convert from using the shortform to the leaf format. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment