From: Carlos Maiolino <cmaiolino@xxxxxxxxxx> Source kernel commit: 6337c84466c250d5da797bc5d6941c501d500e48 Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Reviewed-by: Christoph Hellwig <hch@xxxxxx> Signed-off-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> --- db/attrshort.c | 20 ++++++++++---------- db/metadump.c | 4 ++-- libxfs/xfs_attr_leaf.c | 4 ++-- libxfs/xfs_attr_sf.h | 11 ++++++----- repair/attr_repair.c | 8 ++++---- 5 files changed, 24 insertions(+), 23 deletions(-) diff --git a/db/attrshort.c b/db/attrshort.c index 90c95dd44128..15532a062caa 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 }, @@ -56,10 +56,10 @@ attr_sf_entry_name_count( 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; } @@ -69,7 +69,7 @@ attr_sf_entry_size( int startoff, int idx) { - xfs_attr_sf_entry_t *e; + struct xfs_attr_sf_entry *e; int i; xfs_attr_shortform_t *sf; @@ -86,10 +86,10 @@ attr_sf_entry_value_count( 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; } @@ -100,11 +100,11 @@ attr_sf_entry_value_offset( 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)); } @@ -126,7 +126,7 @@ attr_shortform_list_offset( int startoff, int idx) { - xfs_attr_sf_entry_t *e; + struct xfs_attr_sf_entry *e; int i; xfs_attr_shortform_t *sf; @@ -145,7 +145,7 @@ attrshort_size( int startoff, int idx) { - xfs_attr_sf_entry_t *e; + struct xfs_attr_sf_entry *e; int i; xfs_attr_shortform_t *sf; diff --git a/db/metadump.c b/db/metadump.c index e5cb3aa57ade..12a5cba7616d 100644 --- a/db/metadump.c +++ b/db/metadump.c @@ -1371,7 +1371,7 @@ process_sf_attr( */ xfs_attr_shortform_t *asfp; - xfs_attr_sf_entry_t *asfep; + struct xfs_attr_sf_entry *asfep; int ino_attr_size; int i; @@ -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 269efb7a5a5c..0ed5297ed357 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 bb004fb7944a..c4afb3307918 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 d92909e1c831..d2410c76c1fd 100644 --- a/repair/attr_repair.c +++ b/repair/attr_repair.c @@ -211,7 +211,7 @@ process_shortform_attr( int *repair) { xfs_attr_shortform_t *asf; - xfs_attr_sf_entry_t *currententry, *nextentry, *tempentry; + struct xfs_attr_sf_entry *currententry, *nextentry, *tempentry; int i, junkit; int currentsize, remainingspace; @@ -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);