From: Carlos Maiolino Date: Thu, 12 Nov 2020 21:50:02 +0000 (-0500) Subject: xfs: Remove typedef xfs_attr_shortform_t X-Git-Tag: v5.10.0-rc0~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2fd0935342a8af2f2a261785632bbfec9834b738;p=thirdparty%2Fxfsprogs-dev.git xfs: Remove typedef xfs_attr_shortform_t Source kernel commit: 47e6cc100054c8c6b809e25c286a2fd82e82bcb7 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 ca9f1818c..65febf4ec 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); @@ -110,13 +110,13 @@ attr_sf_entry_value_offset( static int attr_shortform_list_count( - void *obj, - int startoff) + 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 553249dc9..ce6be889c 100644 --- a/db/check.c +++ b/db/check.c @@ -3010,17 +3010,17 @@ process_inode( /* ARGSUSED */ static void process_lclinode( - inodata_t *id, - xfs_dinode_t *dip, - dbm_t type, - xfs_rfsblock_t *totd, - xfs_rfsblock_t *toti, - xfs_extnum_t *nex, - blkmap_t **blkmapp, - int whichfork) + inodata_t *id, + xfs_dinode_t *dip, + dbm_t type, + xfs_rfsblock_t *totd, + xfs_rfsblock_t *toti, + xfs_extnum_t *nex, + blkmap_t **blkmapp, + int whichfork) { - xfs_attr_shortform_t *asf; - xfs_fsblock_t bno; + struct xfs_attr_shortform *asf; + xfs_fsblock_t bno; bno = XFS_INO_TO_FSB(mp, id->ino); if (whichfork == XFS_DATA_FORK && be64_to_cpu(dip->di_size) > @@ -3032,7 +3032,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 c65a7c747..06fa07826 100644 --- a/db/inode.c +++ b/db/inode.c @@ -322,19 +322,19 @@ inode_a_sfattr_count( int inode_a_size( - void *obj, - int startoff, - int idx) + void *obj, + int startoff, + int idx) { - xfs_attr_shortform_t *asf; - xfs_dinode_t *dip; + struct xfs_attr_shortform *asf; + xfs_dinode_t *dip; ASSERT(startoff == 0); ASSERT(idx == 0); 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 626c47eea..7231a6eca 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 0ed5297ed..a14cdbda1 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 059ac108b..e708b714b 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 8eeebaa24..dac07b097 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 77c34801f..1becaa975 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; @@ -927,14 +927,14 @@ process_exinode( */ static int process_lclinode( - xfs_mount_t *mp, - xfs_agnumber_t agno, - xfs_agino_t ino, - xfs_dinode_t *dip, - int whichfork) + xfs_mount_t *mp, + xfs_agnumber_t agno, + xfs_agino_t ino, + xfs_dinode_t *dip, + int whichfork) { - xfs_attr_shortform_t *asf; - xfs_ino_t lino; + struct xfs_attr_shortform *asf; + xfs_ino_t lino; lino = XFS_AGINO_TO_INO(mp, agno, ino); if (whichfork == XFS_DATA_FORK && be64_to_cpu(dip->di_size) > @@ -945,7 +945,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"),