]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: Remove typedef xfs_attr_shortform_t
authorCarlos Maiolino <cmaiolino@redhat.com>
Thu, 12 Nov 2020 21:50:02 +0000 (16:50 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Thu, 12 Nov 2020 21:50:02 +0000 (16:50 -0500)
Source kernel commit: 47e6cc100054c8c6b809e25c286a2fd82e82bcb7

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
db/attrshort.c
db/check.c
db/inode.c
db/metadump.c
libxfs/xfs_attr_leaf.c
libxfs/xfs_da_format.h
repair/attr_repair.c
repair/dinode.c

index ca9f1818c3dcf93c780af85ed25ddfdeef71f85b..65febf4ec19039690a3883814e9180b786701f9d 100644 (file)
@@ -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);
index 553249dc9a41e068ff92c2d445fce48cb676a8a8..ce6be889c32dcf9afdd954a9d82e83ed2a958679 100644 (file)
@@ -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 "
index c65a7c7474bc3ac0d3853a2f75ba1392ede6d206..06fa078268ef43ad547872b7ae137e1c7942a33c 100644 (file)
@@ -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) *
index 626c47eeac275e93eaaadad542e77c44dd922dea..7231a6eca8219f56dc6aec8446d64a7087fad9e7 100644 (file)
@@ -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;
 
index 0ed5297ed3570fc16bb4cf26378bf6b50bdeadd3..a14cdbda1d703128e130212ecb5f5932a205d033 100644 (file)
@@ -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);
index 059ac108b1b394076a6f150632348e72fd464394..e708b714bf99d36016699ce9592ac1a36fa8227f 100644 (file)
@@ -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 */
index 8eeebaa2406226de6e1f0110ac6b0c88052cfc52..dac07b097a71ba65a54ed28aee28ffde0e10e8c5 100644 (file)
@@ -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) {
index 77c34801f5bec30dd6c9ebf817583259a58d24fb..1becaa975be04508542807f6b4e337a28f18c6cd 100644 (file)
@@ -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"),