]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: convert bmap extent type flags to unsigned.
authorDave Chinner <dchinner@redhat.com>
Wed, 22 Jun 2022 19:28:52 +0000 (14:28 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 22 Jun 2022 19:28:52 +0000 (14:28 -0500)
Source kernel commit: 0e5b8e45229bc2680f4b10505da338f1ca15a6d2

5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned
fields to be unsigned.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Chandan Babu R <chandan.babu@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_bmap.c
libxfs/xfs_bmap.h

index 793092460872bdb81efc27ec944e0ea69136e6b1..4386b5123b4a3bfe4e684b2a44f694c10dad9bd2 100644 (file)
@@ -1390,7 +1390,7 @@ xfs_bmap_add_extent_delay_real(
        xfs_bmbt_irec_t         r[3];   /* neighbor extent entries */
                                        /* left is 0, right is 1, prev is 2 */
        int                     rval=0; /* return value (logging flags) */
-       int                     state = xfs_bmap_fork_to_state(whichfork);
+       uint32_t                state = xfs_bmap_fork_to_state(whichfork);
        xfs_filblks_t           da_new; /* new count del alloc blocks used */
        xfs_filblks_t           da_old; /* old count del alloc blocks used */
        xfs_filblks_t           temp=0; /* value for da_new calculations */
@@ -1941,7 +1941,7 @@ xfs_bmap_add_extent_unwritten_real(
        xfs_bmbt_irec_t         r[3];   /* neighbor extent entries */
                                        /* left is 0, right is 1, prev is 2 */
        int                     rval=0; /* return value (logging flags) */
-       int                     state = xfs_bmap_fork_to_state(whichfork);
+       uint32_t                state = xfs_bmap_fork_to_state(whichfork);
        struct xfs_mount        *mp = ip->i_mount;
        struct xfs_bmbt_irec    old;
 
@@ -2470,7 +2470,7 @@ xfs_bmap_add_extent_hole_delay(
        xfs_filblks_t           newlen=0;       /* new indirect size */
        xfs_filblks_t           oldlen=0;       /* old indirect size */
        xfs_bmbt_irec_t         right;  /* right neighbor extent entry */
-       int                     state = xfs_bmap_fork_to_state(whichfork);
+       uint32_t                state = xfs_bmap_fork_to_state(whichfork);
        xfs_filblks_t           temp;    /* temp for indirect calculations */
 
        ifp = XFS_IFORK_PTR(ip, whichfork);
@@ -2617,7 +2617,7 @@ xfs_bmap_add_extent_hole_real(
        xfs_bmbt_irec_t         left;   /* left neighbor extent entry */
        xfs_bmbt_irec_t         right;  /* right neighbor extent entry */
        int                     rval=0; /* return value (logging flags) */
-       int                     state = xfs_bmap_fork_to_state(whichfork);
+       uint32_t                state = xfs_bmap_fork_to_state(whichfork);
        struct xfs_bmbt_irec    old;
 
        ASSERT(!isnullstartblock(new->br_startblock));
@@ -4795,7 +4795,7 @@ xfs_bmap_del_extent_delay(
        int64_t                 da_old, da_new, da_diff = 0;
        xfs_fileoff_t           del_endoff, got_endoff;
        xfs_filblks_t           got_indlen, new_indlen, stolen;
-       int                     state = xfs_bmap_fork_to_state(whichfork);
+       uint32_t                state = xfs_bmap_fork_to_state(whichfork);
        int                     error = 0;
        bool                    isrt;
 
@@ -4920,7 +4920,7 @@ xfs_bmap_del_extent_cow(
        struct xfs_ifork        *ifp = XFS_IFORK_PTR(ip, XFS_COW_FORK);
        struct xfs_bmbt_irec    new;
        xfs_fileoff_t           del_endoff, got_endoff;
-       int                     state = BMAP_COWFORK;
+       uint32_t                state = BMAP_COWFORK;
 
        XFS_STATS_INC(mp, xs_del_exlist);
 
@@ -5009,7 +5009,7 @@ xfs_bmap_del_extent_real(
        xfs_bmbt_irec_t         new;    /* new record to be inserted */
        /* REFERENCED */
        uint                    qfield; /* quota field to update */
-       int                     state = xfs_bmap_fork_to_state(whichfork);
+       uint32_t                state = xfs_bmap_fork_to_state(whichfork);
        struct xfs_bmbt_irec    old;
 
        mp = ip->i_mount;
index 03d9aaf8741335b8c46edca99118d244a12abf01..29d38c3c26073f3dcaccf046d9d9dd5cdd75e872 100644 (file)
@@ -124,16 +124,16 @@ static inline int xfs_bmapi_whichfork(int bmapi_flags)
 /*
  * Flags for xfs_bmap_add_extent*.
  */
-#define BMAP_LEFT_CONTIG       (1 << 0)
-#define BMAP_RIGHT_CONTIG      (1 << 1)
-#define BMAP_LEFT_FILLING      (1 << 2)
-#define BMAP_RIGHT_FILLING     (1 << 3)
-#define BMAP_LEFT_DELAY                (1 << 4)
-#define BMAP_RIGHT_DELAY       (1 << 5)
-#define BMAP_LEFT_VALID                (1 << 6)
-#define BMAP_RIGHT_VALID       (1 << 7)
-#define BMAP_ATTRFORK          (1 << 8)
-#define BMAP_COWFORK           (1 << 9)
+#define BMAP_LEFT_CONTIG       (1u << 0)
+#define BMAP_RIGHT_CONTIG      (1u << 1)
+#define BMAP_LEFT_FILLING      (1u << 2)
+#define BMAP_RIGHT_FILLING     (1u << 3)
+#define BMAP_LEFT_DELAY                (1u << 4)
+#define BMAP_RIGHT_DELAY       (1u << 5)
+#define BMAP_LEFT_VALID                (1u << 6)
+#define BMAP_RIGHT_VALID       (1u << 7)
+#define BMAP_ATTRFORK          (1u << 8)
+#define BMAP_COWFORK           (1u << 9)
 
 #define XFS_BMAP_EXT_FLAGS \
        { BMAP_LEFT_CONTIG,     "LC" }, \
@@ -243,7 +243,7 @@ void        xfs_bmap_map_extent(struct xfs_trans *tp, struct xfs_inode *ip,
 void   xfs_bmap_unmap_extent(struct xfs_trans *tp, struct xfs_inode *ip,
                struct xfs_bmbt_irec *imap);
 
-static inline int xfs_bmap_fork_to_state(int whichfork)
+static inline uint32_t xfs_bmap_fork_to_state(int whichfork)
 {
        switch (whichfork) {
        case XFS_ATTR_FORK: