summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_attr_list.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-02-26 17:30:37 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2020-03-02 20:55:54 -0800
commita9c8c69b496117912162cdc38dcae953a07b87f7 (patch)
tree43f2f9604d721550551f5f0acf4d40d149972225 /fs/xfs/xfs_attr_list.c
parent377f16ac67237c8cda05daf363bcbea95212b000 (diff)
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>
Diffstat (limited to 'fs/xfs/xfs_attr_list.c')
-rw-r--r--fs/xfs/xfs_attr_list.c53
1 files changed, 27 insertions, 26 deletions
diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c
index b4305217bcc0..0fe12474a952 100644
--- a/fs/xfs/xfs_attr_list.c
+++ b/fs/xfs/xfs_attr_list.c
@@ -488,10 +488,11 @@ xfs_attr3_leaf_list_int(
* Copy out attribute entries for attr_list(), for leaf attribute lists.
*/
STATIC int
-xfs_attr_leaf_list(xfs_attr_list_context_t *context)
+xfs_attr_leaf_list(
+ struct xfs_attr_list_context *context)
{
- int error;
- struct xfs_buf *bp;
+ struct xfs_buf *bp;
+ int error;
trace_xfs_attr_leaf_list(context);
@@ -527,11 +528,11 @@ xfs_attr_list_int_ilocked(
int
xfs_attr_list_int(
- xfs_attr_list_context_t *context)
+ struct xfs_attr_list_context *context)
{
- int error;
- xfs_inode_t *dp = context->dp;
- uint lock_mode;
+ struct xfs_inode *dp = context->dp;
+ uint lock_mode;
+ int error;
XFS_STATS_INC(dp->i_mount, xs_attr_list);
@@ -557,15 +558,15 @@ xfs_attr_list_int(
*/
STATIC void
xfs_attr_put_listent(
- xfs_attr_list_context_t *context,
- int flags,
- unsigned char *name,
- int namelen,
- int valuelen)
+ struct xfs_attr_list_context *context,
+ int flags,
+ unsigned char *name,
+ int namelen,
+ int valuelen)
{
- struct attrlist *alist = (struct attrlist *)context->alist;
- attrlist_ent_t *aep;
- int arraytop;
+ struct attrlist *alist = context->buffer;
+ struct attrlist_ent *aep;
+ int arraytop;
ASSERT(!context->seen_enough);
ASSERT(context->count >= 0);
@@ -593,7 +594,7 @@ xfs_attr_put_listent(
return;
}
- aep = (attrlist_ent_t *)&context->alist[context->firstu];
+ aep = context->buffer + context->firstu;
aep->a_valuelen = valuelen;
memcpy(aep->a_name, name, namelen);
aep->a_name[namelen] = 0;
@@ -612,15 +613,15 @@ xfs_attr_put_listent(
*/
int
xfs_attr_list(
- xfs_inode_t *dp,
- char *buffer,
- int bufsize,
- int flags,
- attrlist_cursor_kern_t *cursor)
+ struct xfs_inode *dp,
+ char *buffer,
+ int bufsize,
+ int flags,
+ struct attrlist_cursor_kern *cursor)
{
- xfs_attr_list_context_t context;
- struct attrlist *alist;
- int error;
+ struct xfs_attr_list_context context;
+ struct attrlist *alist;
+ int error;
/*
* Validate the cursor.
@@ -645,12 +646,12 @@ xfs_attr_list(
context.cursor = cursor;
context.resynch = 1;
context.flags = flags;
- context.alist = buffer;
+ context.buffer = buffer;
context.bufsize = (bufsize & ~(sizeof(int)-1)); /* align */
context.firstu = context.bufsize;
context.put_listent = xfs_attr_put_listent;
- alist = (struct attrlist *)context.alist;
+ alist = context.buffer;
alist->al_count = 0;
alist->al_more = 0;
alist->al_offset[0] = context.bufsize;