From: Carlos Maiolino Date: Thu, 12 Nov 2020 21:49:52 +0000 (-0500) Subject: xfs: remove typedef xfs_attr_sf_entry_t X-Git-Tag: v5.10.0-rc0~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc3650f70e08eef5b2530564daebbb5bf4e8842f;p=thirdparty%2Fxfsprogs-dev.git xfs: remove typedef xfs_attr_sf_entry_t Source kernel commit: 6337c84466c250d5da797bc5d6941c501d500e48 Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Carlos Maiolino Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/db/attrshort.c b/db/attrshort.c index 90c95dd44..ca9f1818c 100644 --- a/db/attrshort.c +++ b/db/attrshort.c @@ -33,7 +33,7 @@ const field_t attr_sf_hdr_flds[] = { { NULL } }; -#define EOFF(f) bitize(offsetof(xfs_attr_sf_entry_t, f)) +#define EOFF(f) bitize(offsetof(struct xfs_attr_sf_entry, f)) const field_t attr_sf_entry_flds[] = { { "namelen", FLDT_UINT8D, OI(EOFF(namelen)), C1, 0, TYP_NONE }, { "valuelen", FLDT_UINT8D, OI(EOFF(valuelen)), C1, 0, TYP_NONE }, @@ -53,25 +53,25 @@ const field_t attr_sf_entry_flds[] = { static int attr_sf_entry_name_count( - void *obj, - int startoff) + void *obj, + int startoff) { - xfs_attr_sf_entry_t *e; + struct xfs_attr_sf_entry *e; ASSERT(bitoffs(startoff) == 0); - e = (xfs_attr_sf_entry_t *)((char *)obj + byteize(startoff)); + e = (struct xfs_attr_sf_entry *)((char *)obj + byteize(startoff)); return e->namelen; } int attr_sf_entry_size( - void *obj, - int startoff, - int idx) + void *obj, + int startoff, + int idx) { - xfs_attr_sf_entry_t *e; - int i; - xfs_attr_shortform_t *sf; + struct xfs_attr_sf_entry *e; + int i; + xfs_attr_shortform_t *sf; ASSERT(bitoffs(startoff) == 0); sf = (xfs_attr_shortform_t *)((char *)obj + byteize(startoff)); @@ -83,28 +83,28 @@ attr_sf_entry_size( static int attr_sf_entry_value_count( - void *obj, - int startoff) + void *obj, + int startoff) { - xfs_attr_sf_entry_t *e; + struct xfs_attr_sf_entry *e; ASSERT(bitoffs(startoff) == 0); - e = (xfs_attr_sf_entry_t *)((char *)obj + byteize(startoff)); + e = (struct xfs_attr_sf_entry *)((char *)obj + byteize(startoff)); return e->valuelen; } /*ARGSUSED*/ static int attr_sf_entry_value_offset( - void *obj, - int startoff, - int idx) + void *obj, + int startoff, + int idx) { - xfs_attr_sf_entry_t *e; + struct xfs_attr_sf_entry *e; ASSERT(bitoffs(startoff) == 0); ASSERT(idx == 0); - e = (xfs_attr_sf_entry_t *)((char *)obj + byteize(startoff)); + e = (struct xfs_attr_sf_entry *)((char *)obj + byteize(startoff)); return bitize((int)((char *)&e->nameval[e->namelen] - (char *)e)); } @@ -122,13 +122,13 @@ attr_shortform_list_count( static int attr_shortform_list_offset( - void *obj, - int startoff, - int idx) + void *obj, + int startoff, + int idx) { - xfs_attr_sf_entry_t *e; - int i; - xfs_attr_shortform_t *sf; + struct xfs_attr_sf_entry *e; + int i; + xfs_attr_shortform_t *sf; ASSERT(bitoffs(startoff) == 0); sf = (xfs_attr_shortform_t *)((char *)obj + byteize(startoff)); @@ -141,13 +141,13 @@ attr_shortform_list_offset( /*ARGSUSED*/ int attrshort_size( - void *obj, - int startoff, - int idx) + void *obj, + int startoff, + int idx) { - xfs_attr_sf_entry_t *e; - int i; - xfs_attr_shortform_t *sf; + struct xfs_attr_sf_entry *e; + int i; + xfs_attr_shortform_t *sf; ASSERT(bitoffs(startoff) == 0); ASSERT(idx == 0); diff --git a/db/metadump.c b/db/metadump.c index e5cb3aa57..626c47eea 100644 --- a/db/metadump.c +++ b/db/metadump.c @@ -1363,17 +1363,17 @@ process_sf_symlink( static void process_sf_attr( - xfs_dinode_t *dip) + xfs_dinode_t *dip) { /* * with extended attributes, obfuscate the names and fill the actual * values with 'v' (to see a valid string length, as opposed to NULLs) */ - xfs_attr_shortform_t *asfp; - xfs_attr_sf_entry_t *asfep; - int ino_attr_size; - int i; + xfs_attr_shortform_t *asfp; + struct xfs_attr_sf_entry *asfep; + int ino_attr_size; + int i; asfp = (xfs_attr_shortform_t *)XFS_DFORK_APTR(dip); if (asfp->hdr.count == 0) @@ -1413,7 +1413,7 @@ process_sf_attr( asfep->valuelen); } - asfep = (xfs_attr_sf_entry_t *)((char *)asfep + + asfep = (struct xfs_attr_sf_entry *)((char *)asfep + XFS_ATTR_SF_ENTSIZE(asfep)); } diff --git a/libxfs/xfs_attr_leaf.c b/libxfs/xfs_attr_leaf.c index 269efb7a5..0ed5297ed 100644 --- a/libxfs/xfs_attr_leaf.c +++ b/libxfs/xfs_attr_leaf.c @@ -733,7 +733,7 @@ xfs_attr_shortform_add( size = XFS_ATTR_SF_ENTSIZE_BYNAME(args->namelen, args->valuelen); xfs_idata_realloc(dp, size, XFS_ATTR_FORK); sf = (xfs_attr_shortform_t *)ifp->if_u1.if_data; - sfe = (xfs_attr_sf_entry_t *)((char *)sf + offset); + sfe = (struct xfs_attr_sf_entry *)((char *)sf + offset); sfe->namelen = args->namelen; sfe->valuelen = args->valuelen; @@ -835,7 +835,7 @@ int xfs_attr_shortform_lookup(xfs_da_args_t *args) { xfs_attr_shortform_t *sf; - xfs_attr_sf_entry_t *sfe; + struct xfs_attr_sf_entry *sfe; int i; struct xfs_ifork *ifp; diff --git a/libxfs/xfs_attr_sf.h b/libxfs/xfs_attr_sf.h index bb004fb79..c4afb3307 100644 --- a/libxfs/xfs_attr_sf.h +++ b/libxfs/xfs_attr_sf.h @@ -13,7 +13,6 @@ * to fit into the literal area of the inode. */ typedef struct xfs_attr_sf_hdr xfs_attr_sf_hdr_t; -typedef struct xfs_attr_sf_entry xfs_attr_sf_entry_t; /* * We generate this then sort it, attr_list() must return things in hash-order. @@ -28,15 +27,17 @@ typedef struct xfs_attr_sf_sort { } xfs_attr_sf_sort_t; #define XFS_ATTR_SF_ENTSIZE_BYNAME(nlen,vlen) /* space name/value uses */ \ - (((int)sizeof(xfs_attr_sf_entry_t)-1 + (nlen)+(vlen))) + (((int)sizeof(struct xfs_attr_sf_entry)-1 + (nlen)+(vlen))) #define XFS_ATTR_SF_ENTSIZE_MAX /* max space for name&value */ \ ((1 << (NBBY*(int)sizeof(uint8_t))) - 1) #define XFS_ATTR_SF_ENTSIZE(sfep) /* space an entry uses */ \ - ((int)sizeof(xfs_attr_sf_entry_t)-1 + (sfep)->namelen+(sfep)->valuelen) + ((int)sizeof(struct xfs_attr_sf_entry)-1 + \ + (sfep)->namelen+(sfep)->valuelen) #define XFS_ATTR_SF_NEXTENTRY(sfep) /* next entry in struct */ \ - ((xfs_attr_sf_entry_t *)((char *)(sfep) + XFS_ATTR_SF_ENTSIZE(sfep))) + ((struct xfs_attr_sf_entry *)((char *)(sfep) + \ + XFS_ATTR_SF_ENTSIZE(sfep))) #define XFS_ATTR_SF_TOTSIZE(dp) /* total space in use */ \ - (be16_to_cpu(((xfs_attr_shortform_t *) \ + (be16_to_cpu(((struct xfs_attr_shortform *) \ ((dp)->i_afp->if_u1.if_data))->hdr.totsize)) #endif /* __XFS_ATTR_SF_H__ */ diff --git a/repair/attr_repair.c b/repair/attr_repair.c index d92909e1c..8eeebaa24 100644 --- a/repair/attr_repair.c +++ b/repair/attr_repair.c @@ -205,15 +205,15 @@ valuecheck( */ static int process_shortform_attr( - struct xfs_mount *mp, - xfs_ino_t ino, - xfs_dinode_t *dip, - int *repair) + struct xfs_mount *mp, + xfs_ino_t ino, + xfs_dinode_t *dip, + int *repair) { xfs_attr_shortform_t *asf; - xfs_attr_sf_entry_t *currententry, *nextentry, *tempentry; - int i, junkit; - int currentsize, remainingspace; + struct xfs_attr_sf_entry *currententry, *nextentry, *tempentry; + int i, junkit; + int currentsize, remainingspace; *repair = 0; @@ -250,7 +250,7 @@ process_shortform_attr( junkit = 0; /* don't go off the end if the hdr.count was off */ - if ((currentsize + (sizeof(xfs_attr_sf_entry_t) - 1)) > + if ((currentsize + (sizeof(struct xfs_attr_sf_entry) - 1)) > be16_to_cpu(asf->hdr.totsize)) break; /* get out and reset count and totSize */ @@ -322,7 +322,7 @@ process_shortform_attr( do_warn( _("removing attribute entry %d for inode %" PRIu64 "\n"), i, ino); - tempentry = (xfs_attr_sf_entry_t *) + tempentry = (struct xfs_attr_sf_entry *) ((intptr_t) currententry + XFS_ATTR_SF_ENTSIZE(currententry)); memmove(currententry,tempentry,remainingspace); @@ -338,7 +338,7 @@ process_shortform_attr( } /* Let's get ready for the next entry... */ - nextentry = (xfs_attr_sf_entry_t *)((intptr_t) nextentry + + nextentry = (struct xfs_attr_sf_entry *)((intptr_t) nextentry + XFS_ATTR_SF_ENTSIZE(currententry)); currentsize = currentsize + XFS_ATTR_SF_ENTSIZE(currententry);