Commit 63211876 authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: rearrange xfs_attr_match parameters

Rearrange the parameters to this function so that they match the order
of attr listent: attr_flags -> name -> namelen -> value -> valuelen.
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent ea0b3e81
...@@ -510,9 +510,9 @@ xfs_attr3_leaf_read( ...@@ -510,9 +510,9 @@ xfs_attr3_leaf_read(
static bool static bool
xfs_attr_match( xfs_attr_match(
struct xfs_da_args *args, struct xfs_da_args *args,
uint8_t namelen, unsigned int attr_flags,
unsigned char *name, const unsigned char *name,
int flags) unsigned int namelen)
{ {
if (args->namelen != namelen) if (args->namelen != namelen)
...@@ -522,12 +522,12 @@ xfs_attr_match( ...@@ -522,12 +522,12 @@ xfs_attr_match(
/* Recovery ignores the INCOMPLETE flag. */ /* Recovery ignores the INCOMPLETE flag. */
if ((args->op_flags & XFS_DA_OP_RECOVERY) && if ((args->op_flags & XFS_DA_OP_RECOVERY) &&
args->attr_filter == (flags & XFS_ATTR_NSP_ONDISK_MASK)) args->attr_filter == (attr_flags & XFS_ATTR_NSP_ONDISK_MASK))
return true; return true;
/* All remaining matches need to be filtered by INCOMPLETE state. */ /* All remaining matches need to be filtered by INCOMPLETE state. */
if (args->attr_filter != if (args->attr_filter !=
(flags & (XFS_ATTR_NSP_ONDISK_MASK | XFS_ATTR_INCOMPLETE))) (attr_flags & (XFS_ATTR_NSP_ONDISK_MASK | XFS_ATTR_INCOMPLETE)))
return false; return false;
return true; return true;
} }
...@@ -746,8 +746,8 @@ xfs_attr_sf_findname( ...@@ -746,8 +746,8 @@ xfs_attr_sf_findname(
for (sfe = xfs_attr_sf_firstentry(sf); for (sfe = xfs_attr_sf_firstentry(sf);
sfe < xfs_attr_sf_endptr(sf); sfe < xfs_attr_sf_endptr(sf);
sfe = xfs_attr_sf_nextentry(sfe)) { sfe = xfs_attr_sf_nextentry(sfe)) {
if (xfs_attr_match(args, sfe->namelen, sfe->nameval, if (xfs_attr_match(args, sfe->flags, sfe->nameval,
sfe->flags)) sfe->namelen))
return sfe; return sfe;
} }
...@@ -2443,15 +2443,16 @@ xfs_attr3_leaf_lookup_int( ...@@ -2443,15 +2443,16 @@ xfs_attr3_leaf_lookup_int(
*/ */
if (entry->flags & XFS_ATTR_LOCAL) { if (entry->flags & XFS_ATTR_LOCAL) {
name_loc = xfs_attr3_leaf_name_local(leaf, probe); name_loc = xfs_attr3_leaf_name_local(leaf, probe);
if (!xfs_attr_match(args, name_loc->namelen, if (!xfs_attr_match(args, entry->flags,
name_loc->nameval, entry->flags)) name_loc->nameval,
name_loc->namelen))
continue; continue;
args->index = probe; args->index = probe;
return -EEXIST; return -EEXIST;
} else { } else {
name_rmt = xfs_attr3_leaf_name_remote(leaf, probe); name_rmt = xfs_attr3_leaf_name_remote(leaf, probe);
if (!xfs_attr_match(args, name_rmt->namelen, if (!xfs_attr_match(args, entry->flags, name_rmt->name,
name_rmt->name, entry->flags)) name_rmt->namelen))
continue; continue;
args->index = probe; args->index = probe;
args->rmtvaluelen = be32_to_cpu(name_rmt->valuelen); args->rmtvaluelen = be32_to_cpu(name_rmt->valuelen);
......
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