]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove typedef xfs_attr_sf_entry_t
authorCarlos Maiolino <cmaiolino@redhat.com>
Thu, 12 Nov 2020 21:49:52 +0000 (16:49 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Thu, 12 Nov 2020 21:49:52 +0000 (16:49 -0500)
Source kernel commit: 6337c84466c250d5da797bc5d6941c501d500e48

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/metadump.c
libxfs/xfs_attr_leaf.c
libxfs/xfs_attr_sf.h
repair/attr_repair.c

index 90c95dd44128384fbffe0f0927f4fdf914a2e983..ca9f1818c3dcf93c780af85ed25ddfdeef71f85b 100644 (file)
@@ -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);
index e5cb3aa57ade6ce9989a5aaeba5b2ee5aa6f1b9a..626c47eeac275e93eaaadad542e77c44dd922dea 100644 (file)
@@ -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));
        }
 
index 269efb7a5a5cb524bbf2776b2d27df6de60dddc0..0ed5297ed3570fc16bb4cf26378bf6b50bdeadd3 100644 (file)
@@ -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;
 
index bb004fb7944a75b6703bd5a1880f7fc9887044df..c4afb33079184723120ea01e090bd3423d320eeb 100644 (file)
@@ -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__ */
index d92909e1c8312b1f96c60bea7d02966871026ef6..8eeebaa2406226de6e1f0110ac6b0c88052cfc52 100644 (file)
@@ -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);