From: Carlos Maiolino <cmaiolino@xxxxxxxxxx> Source kernel commit: 47e6cc100054c8c6b809e25c286a2fd82e82bcb7 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 | 18 +++++++++--------- db/check.c | 4 ++-- db/inode.c | 4 ++-- db/metadump.c | 4 ++-- libxfs/xfs_attr_leaf.c | 16 ++++++++-------- libxfs/xfs_da_format.h | 4 ++-- repair/attr_repair.c | 8 ++++---- repair/dinode.c | 6 +++--- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/db/attrshort.c b/db/attrshort.c index 15532a062caa..5746c66a62e0 100644 --- a/db/attrshort.c +++ b/db/attrshort.c @@ -18,7 +18,7 @@ static int attr_sf_entry_value_offset(void *obj, int startoff, int idx); static int attr_shortform_list_count(void *obj, int startoff); static int attr_shortform_list_offset(void *obj, int startoff, int idx); -#define OFF(f) bitize(offsetof(xfs_attr_shortform_t, f)) +#define OFF(f) bitize(offsetof(struct xfs_attr_shortform, f)) const field_t attr_shortform_flds[] = { { "hdr", FLDT_ATTR_SF_HDR, OI(OFF(hdr)), C1, 0, TYP_NONE }, { "list", FLDT_ATTR_SF_ENTRY, attr_shortform_list_offset, @@ -71,10 +71,10 @@ attr_sf_entry_size( { struct xfs_attr_sf_entry *e; int i; - xfs_attr_shortform_t *sf; + struct xfs_attr_shortform *sf; ASSERT(bitoffs(startoff) == 0); - sf = (xfs_attr_shortform_t *)((char *)obj + byteize(startoff)); + sf = (struct xfs_attr_shortform *)((char *)obj + byteize(startoff)); e = &sf->list[0]; for (i = 0; i < idx; i++) e = XFS_ATTR_SF_NEXTENTRY(e); @@ -113,10 +113,10 @@ attr_shortform_list_count( void *obj, int startoff) { - xfs_attr_shortform_t *sf; + struct xfs_attr_shortform *sf; ASSERT(bitoffs(startoff) == 0); - sf = (xfs_attr_shortform_t *)((char *)obj + byteize(startoff)); + sf = (struct xfs_attr_shortform *)((char *)obj + byteize(startoff)); return sf->hdr.count; } @@ -128,10 +128,10 @@ attr_shortform_list_offset( { struct xfs_attr_sf_entry *e; int i; - xfs_attr_shortform_t *sf; + struct xfs_attr_shortform *sf; ASSERT(bitoffs(startoff) == 0); - sf = (xfs_attr_shortform_t *)((char *)obj + byteize(startoff)); + sf = (struct xfs_attr_shortform *)((char *)obj + byteize(startoff)); e = &sf->list[0]; for (i = 0; i < idx; i++) e = XFS_ATTR_SF_NEXTENTRY(e); @@ -147,11 +147,11 @@ attrshort_size( { struct xfs_attr_sf_entry *e; int i; - xfs_attr_shortform_t *sf; + struct xfs_attr_shortform *sf; ASSERT(bitoffs(startoff) == 0); ASSERT(idx == 0); - sf = (xfs_attr_shortform_t *)((char *)obj + byteize(startoff)); + sf = (struct xfs_attr_shortform *)((char *)obj + byteize(startoff)); e = &sf->list[0]; for (i = 0; i < sf->hdr.count; i++) e = XFS_ATTR_SF_NEXTENTRY(e); diff --git a/db/check.c b/db/check.c index 5aede6cca15c..0696542a60bb 100644 --- a/db/check.c +++ b/db/check.c @@ -3046,7 +3046,7 @@ process_lclinode( blkmap_t **blkmapp, int whichfork) { - xfs_attr_shortform_t *asf; + struct xfs_attr_shortform *asf; xfs_fsblock_t bno; bno = XFS_INO_TO_FSB(mp, id->ino); @@ -3059,7 +3059,7 @@ process_lclinode( error++; } else if (whichfork == XFS_ATTR_FORK) { - asf = (xfs_attr_shortform_t *)XFS_DFORK_APTR(dip); + asf = (struct xfs_attr_shortform *)XFS_DFORK_APTR(dip); if (be16_to_cpu(asf->hdr.totsize) > XFS_DFORK_ASIZE(dip, mp)) { if (!sflag || id->ilist || CHECK_BLIST(bno)) dbprintf(_("local inode %lld attr is too large " diff --git a/db/inode.c b/db/inode.c index f0e08ebf5ad9..94eaa91d68af 100644 --- a/db/inode.c +++ b/db/inode.c @@ -327,7 +327,7 @@ inode_a_size( int startoff, int idx) { - xfs_attr_shortform_t *asf; + struct xfs_attr_shortform *asf; xfs_dinode_t *dip; ASSERT(startoff == 0); @@ -335,7 +335,7 @@ inode_a_size( dip = obj; switch (dip->di_aformat) { case XFS_DINODE_FMT_LOCAL: - asf = (xfs_attr_shortform_t *)XFS_DFORK_APTR(dip); + asf = (struct xfs_attr_shortform *)XFS_DFORK_APTR(dip); return bitize(be16_to_cpu(asf->hdr.totsize)); case XFS_DINODE_FMT_EXTENTS: return (int)be16_to_cpu(dip->di_anextents) * diff --git a/db/metadump.c b/db/metadump.c index 12a5cba7616d..468235cc94b1 100644 --- a/db/metadump.c +++ b/db/metadump.c @@ -1370,12 +1370,12 @@ process_sf_attr( * values with 'v' (to see a valid string length, as opposed to NULLs) */ - xfs_attr_shortform_t *asfp; + struct xfs_attr_shortform *asfp; struct xfs_attr_sf_entry *asfep; int ino_attr_size; int i; - asfp = (xfs_attr_shortform_t *)XFS_DFORK_APTR(dip); + asfp = (struct xfs_attr_shortform *)XFS_DFORK_APTR(dip); if (asfp->hdr.count == 0) return; diff --git a/libxfs/xfs_attr_leaf.c b/libxfs/xfs_attr_leaf.c index 0ed5297ed357..a14cdbda1d70 100644 --- a/libxfs/xfs_attr_leaf.c +++ b/libxfs/xfs_attr_leaf.c @@ -725,14 +725,14 @@ xfs_attr_shortform_add( ifp = dp->i_afp; ASSERT(ifp->if_flags & XFS_IFINLINE); - sf = (xfs_attr_shortform_t *)ifp->if_u1.if_data; + sf = (struct xfs_attr_shortform *)ifp->if_u1.if_data; if (xfs_attr_sf_findname(args, &sfe, NULL) == -EEXIST) ASSERT(0); offset = (char *)sfe - (char *)sf; 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; + sf = (struct xfs_attr_shortform *)ifp->if_u1.if_data; sfe = (struct xfs_attr_sf_entry *)((char *)sf + offset); sfe->namelen = args->namelen; @@ -784,7 +784,7 @@ xfs_attr_shortform_remove( dp = args->dp; mp = dp->i_mount; - sf = (xfs_attr_shortform_t *)dp->i_afp->if_u1.if_data; + sf = (struct xfs_attr_shortform *)dp->i_afp->if_u1.if_data; error = xfs_attr_sf_findname(args, &sfe, &base); if (error != -EEXIST) @@ -834,7 +834,7 @@ xfs_attr_shortform_remove( int xfs_attr_shortform_lookup(xfs_da_args_t *args) { - xfs_attr_shortform_t *sf; + struct xfs_attr_shortform *sf; struct xfs_attr_sf_entry *sfe; int i; struct xfs_ifork *ifp; @@ -843,7 +843,7 @@ xfs_attr_shortform_lookup(xfs_da_args_t *args) ifp = args->dp->i_afp; ASSERT(ifp->if_flags & XFS_IFINLINE); - sf = (xfs_attr_shortform_t *)ifp->if_u1.if_data; + sf = (struct xfs_attr_shortform *)ifp->if_u1.if_data; sfe = &sf->list[0]; for (i = 0; i < sf->hdr.count; sfe = XFS_ATTR_SF_NEXTENTRY(sfe), i++) { @@ -870,7 +870,7 @@ xfs_attr_shortform_getvalue( int i; ASSERT(args->dp->i_afp->if_flags == XFS_IFINLINE); - sf = (xfs_attr_shortform_t *)args->dp->i_afp->if_u1.if_data; + sf = (struct xfs_attr_shortform *)args->dp->i_afp->if_u1.if_data; sfe = &sf->list[0]; for (i = 0; i < sf->hdr.count; sfe = XFS_ATTR_SF_NEXTENTRY(sfe), i++) { @@ -905,12 +905,12 @@ xfs_attr_shortform_to_leaf( dp = args->dp; ifp = dp->i_afp; - sf = (xfs_attr_shortform_t *)ifp->if_u1.if_data; + sf = (struct xfs_attr_shortform *)ifp->if_u1.if_data; size = be16_to_cpu(sf->hdr.totsize); tmpbuffer = kmem_alloc(size, 0); ASSERT(tmpbuffer != NULL); memcpy(tmpbuffer, ifp->if_u1.if_data, size); - sf = (xfs_attr_shortform_t *)tmpbuffer; + sf = (struct xfs_attr_shortform *)tmpbuffer; xfs_idata_realloc(dp, -size, XFS_ATTR_FORK); xfs_bmap_local_to_extents_empty(args->trans, dp, XFS_ATTR_FORK); diff --git a/libxfs/xfs_da_format.h b/libxfs/xfs_da_format.h index 059ac108b1b3..e708b714bf99 100644 --- a/libxfs/xfs_da_format.h +++ b/libxfs/xfs_da_format.h @@ -579,7 +579,7 @@ xfs_dir2_block_leaf_p(struct xfs_dir2_block_tail *btp) /* * Entries are packed toward the top as tight as possible. */ -typedef struct xfs_attr_shortform { +struct xfs_attr_shortform { struct xfs_attr_sf_hdr { /* constant-structure header block */ __be16 totsize; /* total bytes in shortform list */ __u8 count; /* count of active entries */ @@ -591,7 +591,7 @@ typedef struct xfs_attr_shortform { uint8_t flags; /* flags bits (see xfs_attr_leaf.h) */ uint8_t nameval[1]; /* name & value bytes concatenated */ } list[1]; /* variable sized array */ -} xfs_attr_shortform_t; +}; typedef struct xfs_attr_leaf_map { /* RLE map of free bytes */ __be16 base; /* base of free region */ diff --git a/repair/attr_repair.c b/repair/attr_repair.c index d2410c76c1fd..e0580141c479 100644 --- a/repair/attr_repair.c +++ b/repair/attr_repair.c @@ -210,14 +210,14 @@ process_shortform_attr( xfs_dinode_t *dip, int *repair) { - xfs_attr_shortform_t *asf; + struct xfs_attr_shortform *asf; struct xfs_attr_sf_entry *currententry, *nextentry, *tempentry; int i, junkit; int currentsize, remainingspace; *repair = 0; - asf = (xfs_attr_shortform_t *) XFS_DFORK_APTR(dip); + asf = (struct xfs_attr_shortform *) XFS_DFORK_APTR(dip); /* Assumption: hdr.totsize is less than a leaf block and was checked * by lclinode for valid sizes. Check the count though. @@ -1212,9 +1212,9 @@ process_attributes( int err; __u8 aformat = dip->di_aformat; #ifdef DEBUG - xfs_attr_shortform_t *asf; + struct xfs_attr_shortform *asf; - asf = (xfs_attr_shortform_t *) XFS_DFORK_APTR(dip); + asf = (struct xfs_attr_shortform *) XFS_DFORK_APTR(dip); #endif if (aformat == XFS_DINODE_FMT_LOCAL) { diff --git a/repair/dinode.c b/repair/dinode.c index 16f52c38a43a..076fc34bfb1c 100644 --- a/repair/dinode.c +++ b/repair/dinode.c @@ -92,7 +92,7 @@ _("would have cleared inode %" PRIu64 " attributes\n"), ino_num); */ if (!no_modify) { - xfs_attr_shortform_t *asf = (xfs_attr_shortform_t *) + struct xfs_attr_shortform *asf = (struct xfs_attr_shortform *) XFS_DFORK_APTR(dino); asf->hdr.totsize = cpu_to_be16(sizeof(xfs_attr_sf_hdr_t)); asf->hdr.count = 0; @@ -977,7 +977,7 @@ process_lclinode( xfs_dinode_t *dip, int whichfork) { - xfs_attr_shortform_t *asf; + struct xfs_attr_shortform *asf; xfs_ino_t lino; lino = XFS_AGINO_TO_INO(mp, agno, ino); @@ -989,7 +989,7 @@ process_lclinode( XFS_DFORK_DSIZE(dip, mp)); return(1); } else if (whichfork == XFS_ATTR_FORK) { - asf = (xfs_attr_shortform_t *)XFS_DFORK_APTR(dip); + asf = (struct xfs_attr_shortform *)XFS_DFORK_APTR(dip); if (be16_to_cpu(asf->hdr.totsize) > XFS_DFORK_ASIZE(dip, mp)) { do_warn( _("local inode %" PRIu64 " attr fork too large (size %d, max = %zu)\n"),