xfs: cleanup struct xfs_attr_list_context

Replace the alist char pointer with a void buffer given that different
callers use it in different ways.  Use the chance to remove the typedef
and reduce the indentation of the struct definition so that it doesn't
overflow 80 char lines all over.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Chandan Rajendra <chandanrlinux@gmail.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:
Christoph Hellwig
2020-02-26 17:30:37 -08:00
committed by Darrick J. Wong
parent 377f16ac67
commit a9c8c69b49
4 changed files with 54 additions and 53 deletions

View File

@@ -134,7 +134,7 @@ __xfs_xattr_put_listent(
if (context->count < 0 || context->seen_enough)
return;
if (!context->alist)
if (!context->buffer)
goto compute_size;
arraytop = context->count + prefix_len + namelen + 1;
@@ -143,7 +143,7 @@ __xfs_xattr_put_listent(
context->seen_enough = 1;
return;
}
offset = (char *)context->alist + context->count;
offset = context->buffer + context->count;
strncpy(offset, prefix, prefix_len);
offset += prefix_len;
strncpy(offset, (char *)name, namelen); /* real name */
@@ -229,7 +229,7 @@ xfs_vn_listxattr(
context.dp = XFS_I(inode);
context.cursor = &cursor;
context.resynch = 1;
context.alist = size ? data : NULL;
context.buffer = size ? data : NULL;
context.bufsize = size;
context.firstu = context.bufsize;
context.put_listent = xfs_xattr_put_listent;