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

xfs: convert bmapi 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
e7d410ac 0e5b8e45

+29 -29
+11 -11
fs/xfs/libxfs/xfs_bmap.c
··· 485 485 xfs_bmap_validate_ret( 486 486 xfs_fileoff_t bno, 487 487 xfs_filblks_t len, 488 - int flags, 488 + uint32_t flags, 489 489 xfs_bmbt_irec_t *mval, 490 490 int nmap, 491 491 int ret_nmap) ··· 2616 2616 struct xfs_btree_cur **curp, 2617 2617 struct xfs_bmbt_irec *new, 2618 2618 int *logflagsp, 2619 - int flags) 2619 + uint32_t flags) 2620 2620 { 2621 2621 struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); 2622 2622 struct xfs_mount *mp = ip->i_mount; ··· 3766 3766 xfs_fileoff_t obno, 3767 3767 xfs_fileoff_t end, 3768 3768 int n, 3769 - int flags) 3769 + uint32_t flags) 3770 3770 { 3771 3771 if ((flags & XFS_BMAPI_ENTIRE) || 3772 3772 got->br_startoff + got->br_blockcount <= obno) { ··· 3811 3811 xfs_fileoff_t obno, 3812 3812 xfs_fileoff_t end, 3813 3813 int *n, 3814 - int flags) 3814 + uint32_t flags) 3815 3815 { 3816 3816 xfs_bmbt_irec_t *mval = *map; 3817 3817 ··· 3864 3864 xfs_filblks_t len, 3865 3865 struct xfs_bmbt_irec *mval, 3866 3866 int *nmap, 3867 - int flags) 3867 + uint32_t flags) 3868 3868 { 3869 3869 struct xfs_mount *mp = ip->i_mount; 3870 3870 int whichfork = xfs_bmapi_whichfork(flags); ··· 4184 4184 struct xfs_bmalloca *bma, 4185 4185 struct xfs_bmbt_irec *mval, 4186 4186 xfs_filblks_t len, 4187 - int flags) 4187 + uint32_t flags) 4188 4188 { 4189 4189 int whichfork = xfs_bmapi_whichfork(flags); 4190 4190 struct xfs_ifork *ifp = XFS_IFORK_PTR(bma->ip, whichfork); ··· 4312 4312 struct xfs_inode *ip, /* incore inode */ 4313 4313 xfs_fileoff_t bno, /* starting file offs. mapped */ 4314 4314 xfs_filblks_t len, /* length to map in file */ 4315 - int flags, /* XFS_BMAPI_... */ 4315 + uint32_t flags, /* XFS_BMAPI_... */ 4316 4316 xfs_extlen_t total, /* total blocks needed */ 4317 4317 struct xfs_bmbt_irec *mval, /* output: map values */ 4318 4318 int *nmap) /* i/o: mval size/count */ ··· 4629 4629 xfs_fileoff_t bno, 4630 4630 xfs_filblks_t len, 4631 4631 xfs_fsblock_t startblock, 4632 - int flags) 4632 + uint32_t flags) 4633 4633 { 4634 4634 struct xfs_mount *mp = ip->i_mount; 4635 4635 struct xfs_ifork *ifp; ··· 4999 4999 xfs_bmbt_irec_t *del, /* data to remove from extents */ 5000 5000 int *logflagsp, /* inode logging flags */ 5001 5001 int whichfork, /* data or attr fork */ 5002 - int bflags) /* bmapi flags */ 5002 + uint32_t bflags) /* bmapi flags */ 5003 5003 { 5004 5004 xfs_fsblock_t del_endblock=0; /* first block past del */ 5005 5005 xfs_fileoff_t del_endoff; /* first offset past del */ ··· 5281 5281 struct xfs_inode *ip, /* incore inode */ 5282 5282 xfs_fileoff_t start, /* first file offset deleted */ 5283 5283 xfs_filblks_t *rlen, /* i/o: amount remaining */ 5284 - int flags, /* misc flags */ 5284 + uint32_t flags, /* misc flags */ 5285 5285 xfs_extnum_t nexts) /* number of extents max */ 5286 5286 { 5287 5287 struct xfs_btree_cur *cur; /* bmap btree cursor */ ··· 5609 5609 struct xfs_inode *ip, 5610 5610 xfs_fileoff_t bno, 5611 5611 xfs_filblks_t len, 5612 - int flags, 5612 + uint32_t flags, 5613 5613 xfs_extnum_t nexts, 5614 5614 int *done) 5615 5615 {
+18 -18
fs/xfs/libxfs/xfs_bmap.h
··· 39 39 bool aeof; /* allocated space at eof */ 40 40 bool conv; /* overwriting unwritten extents */ 41 41 int datatype;/* data type being allocated */ 42 - int flags; 42 + uint32_t flags; 43 43 }; 44 44 45 45 #define XFS_BMAP_MAX_NMAP 4 ··· 47 47 /* 48 48 * Flags for xfs_bmapi_* 49 49 */ 50 - #define XFS_BMAPI_ENTIRE 0x001 /* return entire extent, not trimmed */ 51 - #define XFS_BMAPI_METADATA 0x002 /* mapping metadata not user data */ 52 - #define XFS_BMAPI_ATTRFORK 0x004 /* use attribute fork not data */ 53 - #define XFS_BMAPI_PREALLOC 0x008 /* preallocation op: unwritten space */ 54 - #define XFS_BMAPI_CONTIG 0x020 /* must allocate only one extent */ 50 + #define XFS_BMAPI_ENTIRE (1u << 0) /* return entire extent untrimmed */ 51 + #define XFS_BMAPI_METADATA (1u << 1) /* mapping metadata not user data */ 52 + #define XFS_BMAPI_ATTRFORK (1u << 2) /* use attribute fork not data */ 53 + #define XFS_BMAPI_PREALLOC (1u << 3) /* preallocating unwritten space */ 54 + #define XFS_BMAPI_CONTIG (1u << 4) /* must allocate only one extent */ 55 55 /* 56 56 * unwritten extent conversion - this needs write cache flushing and no additional 57 57 * allocation alignments. When specified with XFS_BMAPI_PREALLOC it converts 58 58 * from written to unwritten, otherwise convert from unwritten to written. 59 59 */ 60 - #define XFS_BMAPI_CONVERT 0x040 60 + #define XFS_BMAPI_CONVERT (1u << 5) 61 61 62 62 /* 63 63 * allocate zeroed extents - this requires all newly allocated user data extents ··· 65 65 * Use in conjunction with XFS_BMAPI_CONVERT to convert unwritten extents found 66 66 * during the allocation range to zeroed written extents. 67 67 */ 68 - #define XFS_BMAPI_ZERO 0x080 68 + #define XFS_BMAPI_ZERO (1u << 6) 69 69 70 70 /* 71 71 * Map the inode offset to the block given in ap->firstblock. Primarily ··· 75 75 * For bunmapi, this flag unmaps the range without adjusting quota, reducing 76 76 * refcount, or freeing the blocks. 77 77 */ 78 - #define XFS_BMAPI_REMAP 0x100 78 + #define XFS_BMAPI_REMAP (1u << 7) 79 79 80 80 /* Map something in the CoW fork. */ 81 - #define XFS_BMAPI_COWFORK 0x200 81 + #define XFS_BMAPI_COWFORK (1u << 8) 82 82 83 83 /* Skip online discard of freed extents */ 84 - #define XFS_BMAPI_NODISCARD 0x1000 84 + #define XFS_BMAPI_NODISCARD (1u << 9) 85 85 86 86 /* Do not update the rmap btree. Used for reconstructing bmbt from rmapbt. */ 87 - #define XFS_BMAPI_NORMAP 0x2000 87 + #define XFS_BMAPI_NORMAP (1u << 10) 88 88 89 89 #define XFS_BMAPI_FLAGS \ 90 90 { XFS_BMAPI_ENTIRE, "ENTIRE" }, \ ··· 106 106 (w == XFS_COW_FORK ? XFS_BMAPI_COWFORK : 0)); 107 107 } 108 108 109 - static inline int xfs_bmapi_whichfork(int bmapi_flags) 109 + static inline int xfs_bmapi_whichfork(uint32_t bmapi_flags) 110 110 { 111 111 if (bmapi_flags & XFS_BMAPI_COWFORK) 112 112 return XFS_COW_FORK; ··· 183 183 int whichfork); 184 184 int xfs_bmapi_read(struct xfs_inode *ip, xfs_fileoff_t bno, 185 185 xfs_filblks_t len, struct xfs_bmbt_irec *mval, 186 - int *nmap, int flags); 186 + int *nmap, uint32_t flags); 187 187 int xfs_bmapi_write(struct xfs_trans *tp, struct xfs_inode *ip, 188 - xfs_fileoff_t bno, xfs_filblks_t len, int flags, 188 + xfs_fileoff_t bno, xfs_filblks_t len, uint32_t flags, 189 189 xfs_extlen_t total, struct xfs_bmbt_irec *mval, int *nmap); 190 190 int __xfs_bunmapi(struct xfs_trans *tp, struct xfs_inode *ip, 191 - xfs_fileoff_t bno, xfs_filblks_t *rlen, int flags, 191 + xfs_fileoff_t bno, xfs_filblks_t *rlen, uint32_t flags, 192 192 xfs_extnum_t nexts); 193 193 int xfs_bunmapi(struct xfs_trans *tp, struct xfs_inode *ip, 194 - xfs_fileoff_t bno, xfs_filblks_t len, int flags, 194 + xfs_fileoff_t bno, xfs_filblks_t len, uint32_t flags, 195 195 xfs_extnum_t nexts, int *done); 196 196 int xfs_bmap_del_extent_delay(struct xfs_inode *ip, int whichfork, 197 197 struct xfs_iext_cursor *cur, struct xfs_bmbt_irec *got, ··· 260 260 261 261 int xfs_bmapi_remap(struct xfs_trans *tp, struct xfs_inode *ip, 262 262 xfs_fileoff_t bno, xfs_filblks_t len, xfs_fsblock_t startblock, 263 - int flags); 263 + uint32_t flags); 264 264 265 265 extern struct kmem_cache *xfs_bmap_intent_cache; 266 266