Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfs: convert bmap extent type flags to unsigned.

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>

authored by

Dave Chinner and committed by
Dave Chinner
0e5b8e45 79539c7c

+18 -18
+7 -7
fs/xfs/libxfs/xfs_bmap.c
··· 1399 1399 xfs_bmbt_irec_t r[3]; /* neighbor extent entries */ 1400 1400 /* left is 0, right is 1, prev is 2 */ 1401 1401 int rval=0; /* return value (logging flags) */ 1402 - int state = xfs_bmap_fork_to_state(whichfork); 1402 + uint32_t state = xfs_bmap_fork_to_state(whichfork); 1403 1403 xfs_filblks_t da_new; /* new count del alloc blocks used */ 1404 1404 xfs_filblks_t da_old; /* old count del alloc blocks used */ 1405 1405 xfs_filblks_t temp=0; /* value for da_new calculations */ ··· 1950 1950 xfs_bmbt_irec_t r[3]; /* neighbor extent entries */ 1951 1951 /* left is 0, right is 1, prev is 2 */ 1952 1952 int rval=0; /* return value (logging flags) */ 1953 - int state = xfs_bmap_fork_to_state(whichfork); 1953 + uint32_t state = xfs_bmap_fork_to_state(whichfork); 1954 1954 struct xfs_mount *mp = ip->i_mount; 1955 1955 struct xfs_bmbt_irec old; 1956 1956 ··· 2479 2479 xfs_filblks_t newlen=0; /* new indirect size */ 2480 2480 xfs_filblks_t oldlen=0; /* old indirect size */ 2481 2481 xfs_bmbt_irec_t right; /* right neighbor extent entry */ 2482 - int state = xfs_bmap_fork_to_state(whichfork); 2482 + uint32_t state = xfs_bmap_fork_to_state(whichfork); 2483 2483 xfs_filblks_t temp; /* temp for indirect calculations */ 2484 2484 2485 2485 ifp = XFS_IFORK_PTR(ip, whichfork); ··· 2626 2626 xfs_bmbt_irec_t left; /* left neighbor extent entry */ 2627 2627 xfs_bmbt_irec_t right; /* right neighbor extent entry */ 2628 2628 int rval=0; /* return value (logging flags) */ 2629 - int state = xfs_bmap_fork_to_state(whichfork); 2629 + uint32_t state = xfs_bmap_fork_to_state(whichfork); 2630 2630 struct xfs_bmbt_irec old; 2631 2631 2632 2632 ASSERT(!isnullstartblock(new->br_startblock)); ··· 4801 4801 int64_t da_old, da_new, da_diff = 0; 4802 4802 xfs_fileoff_t del_endoff, got_endoff; 4803 4803 xfs_filblks_t got_indlen, new_indlen, stolen; 4804 - int state = xfs_bmap_fork_to_state(whichfork); 4804 + uint32_t state = xfs_bmap_fork_to_state(whichfork); 4805 4805 int error = 0; 4806 4806 bool isrt; 4807 4807 ··· 4926 4926 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_COW_FORK); 4927 4927 struct xfs_bmbt_irec new; 4928 4928 xfs_fileoff_t del_endoff, got_endoff; 4929 - int state = BMAP_COWFORK; 4929 + uint32_t state = BMAP_COWFORK; 4930 4930 4931 4931 XFS_STATS_INC(mp, xs_del_exlist); 4932 4932 ··· 5015 5015 xfs_bmbt_irec_t new; /* new record to be inserted */ 5016 5016 /* REFERENCED */ 5017 5017 uint qfield; /* quota field to update */ 5018 - int state = xfs_bmap_fork_to_state(whichfork); 5018 + uint32_t state = xfs_bmap_fork_to_state(whichfork); 5019 5019 struct xfs_bmbt_irec old; 5020 5020 5021 5021 mp = ip->i_mount;
+11 -11
fs/xfs/libxfs/xfs_bmap.h
··· 124 124 /* 125 125 * Flags for xfs_bmap_add_extent*. 126 126 */ 127 - #define BMAP_LEFT_CONTIG (1 << 0) 128 - #define BMAP_RIGHT_CONTIG (1 << 1) 129 - #define BMAP_LEFT_FILLING (1 << 2) 130 - #define BMAP_RIGHT_FILLING (1 << 3) 131 - #define BMAP_LEFT_DELAY (1 << 4) 132 - #define BMAP_RIGHT_DELAY (1 << 5) 133 - #define BMAP_LEFT_VALID (1 << 6) 134 - #define BMAP_RIGHT_VALID (1 << 7) 135 - #define BMAP_ATTRFORK (1 << 8) 136 - #define BMAP_COWFORK (1 << 9) 127 + #define BMAP_LEFT_CONTIG (1u << 0) 128 + #define BMAP_RIGHT_CONTIG (1u << 1) 129 + #define BMAP_LEFT_FILLING (1u << 2) 130 + #define BMAP_RIGHT_FILLING (1u << 3) 131 + #define BMAP_LEFT_DELAY (1u << 4) 132 + #define BMAP_RIGHT_DELAY (1u << 5) 133 + #define BMAP_LEFT_VALID (1u << 6) 134 + #define BMAP_RIGHT_VALID (1u << 7) 135 + #define BMAP_ATTRFORK (1u << 8) 136 + #define BMAP_COWFORK (1u << 9) 137 137 138 138 #define XFS_BMAP_EXT_FLAGS \ 139 139 { BMAP_LEFT_CONTIG, "LC" }, \ ··· 243 243 void xfs_bmap_unmap_extent(struct xfs_trans *tp, struct xfs_inode *ip, 244 244 struct xfs_bmbt_irec *imap); 245 245 246 - static inline int xfs_bmap_fork_to_state(int whichfork) 246 + static inline uint32_t xfs_bmap_fork_to_state(int whichfork) 247 247 { 248 248 switch (whichfork) { 249 249 case XFS_ATTR_FORK: