Skip to content

Commit 898a768

Browse files
committed
Merge branch 'guilt/xfs-unsigned-flags-5.18' into xfs-5.19-for-next
2 parents 1499b8a + c60d13e commit 898a768

27 files changed

+240
-238
lines changed

fs/xfs/libxfs/xfs_alloc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2777,7 +2777,7 @@ xfs_alloc_get_freelist(
27772777
xfs_agblock_t bno;
27782778
__be32 *agfl_bno;
27792779
int error;
2780-
int logflags;
2780+
uint32_t logflags;
27812781
struct xfs_mount *mp = tp->t_mountp;
27822782
struct xfs_perag *pag;
27832783

@@ -2830,9 +2830,9 @@ xfs_alloc_get_freelist(
28302830
*/
28312831
void
28322832
xfs_alloc_log_agf(
2833-
xfs_trans_t *tp, /* transaction pointer */
2834-
struct xfs_buf *bp, /* buffer for a.g. freelist header */
2835-
int fields) /* mask of fields to be logged (XFS_AGF_...) */
2833+
struct xfs_trans *tp,
2834+
struct xfs_buf *bp,
2835+
uint32_t fields)
28362836
{
28372837
int first; /* first byte offset */
28382838
int last; /* last byte offset */
@@ -2902,7 +2902,7 @@ xfs_alloc_put_freelist(
29022902
struct xfs_perag *pag;
29032903
__be32 *blockp;
29042904
int error;
2905-
int logflags;
2905+
uint32_t logflags;
29062906
__be32 *agfl_bno;
29072907
int startoff;
29082908

fs/xfs/libxfs/xfs_alloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void
121121
xfs_alloc_log_agf(
122122
struct xfs_trans *tp, /* transaction pointer */
123123
struct xfs_buf *bp, /* buffer for a.g. freelist header */
124-
int fields);/* mask of fields to be logged (XFS_AGF_...) */
124+
uint32_t fields);/* mask of fields to be logged (XFS_AGF_...) */
125125

126126
/*
127127
* Interface for inode allocation to force the pag data to be initialized.

fs/xfs/libxfs/xfs_bmap.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ STATIC void
485485
xfs_bmap_validate_ret(
486486
xfs_fileoff_t bno,
487487
xfs_filblks_t len,
488-
int flags,
488+
uint32_t flags,
489489
xfs_bmbt_irec_t *mval,
490490
int nmap,
491491
int ret_nmap)
@@ -1399,7 +1399,7 @@ xfs_bmap_add_extent_delay_real(
13991399
xfs_bmbt_irec_t r[3]; /* neighbor extent entries */
14001400
/* left is 0, right is 1, prev is 2 */
14011401
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);
14031403
xfs_filblks_t da_new; /* new count del alloc blocks used */
14041404
xfs_filblks_t da_old; /* old count del alloc blocks used */
14051405
xfs_filblks_t temp=0; /* value for da_new calculations */
@@ -1950,7 +1950,7 @@ xfs_bmap_add_extent_unwritten_real(
19501950
xfs_bmbt_irec_t r[3]; /* neighbor extent entries */
19511951
/* left is 0, right is 1, prev is 2 */
19521952
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);
19541954
struct xfs_mount *mp = ip->i_mount;
19551955
struct xfs_bmbt_irec old;
19561956

@@ -2479,7 +2479,7 @@ xfs_bmap_add_extent_hole_delay(
24792479
xfs_filblks_t newlen=0; /* new indirect size */
24802480
xfs_filblks_t oldlen=0; /* old indirect size */
24812481
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);
24832483
xfs_filblks_t temp; /* temp for indirect calculations */
24842484

24852485
ifp = XFS_IFORK_PTR(ip, whichfork);
@@ -2616,7 +2616,7 @@ xfs_bmap_add_extent_hole_real(
26162616
struct xfs_btree_cur **curp,
26172617
struct xfs_bmbt_irec *new,
26182618
int *logflagsp,
2619-
int flags)
2619+
uint32_t flags)
26202620
{
26212621
struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork);
26222622
struct xfs_mount *mp = ip->i_mount;
@@ -2626,7 +2626,7 @@ xfs_bmap_add_extent_hole_real(
26262626
xfs_bmbt_irec_t left; /* left neighbor extent entry */
26272627
xfs_bmbt_irec_t right; /* right neighbor extent entry */
26282628
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);
26302630
struct xfs_bmbt_irec old;
26312631

26322632
ASSERT(!isnullstartblock(new->br_startblock));
@@ -3766,7 +3766,7 @@ xfs_bmapi_trim_map(
37663766
xfs_fileoff_t obno,
37673767
xfs_fileoff_t end,
37683768
int n,
3769-
int flags)
3769+
uint32_t flags)
37703770
{
37713771
if ((flags & XFS_BMAPI_ENTIRE) ||
37723772
got->br_startoff + got->br_blockcount <= obno) {
@@ -3811,7 +3811,7 @@ xfs_bmapi_update_map(
38113811
xfs_fileoff_t obno,
38123812
xfs_fileoff_t end,
38133813
int *n,
3814-
int flags)
3814+
uint32_t flags)
38153815
{
38163816
xfs_bmbt_irec_t *mval = *map;
38173817

@@ -3864,7 +3864,7 @@ xfs_bmapi_read(
38643864
xfs_filblks_t len,
38653865
struct xfs_bmbt_irec *mval,
38663866
int *nmap,
3867-
int flags)
3867+
uint32_t flags)
38683868
{
38693869
struct xfs_mount *mp = ip->i_mount;
38703870
int whichfork = xfs_bmapi_whichfork(flags);
@@ -4184,7 +4184,7 @@ xfs_bmapi_convert_unwritten(
41844184
struct xfs_bmalloca *bma,
41854185
struct xfs_bmbt_irec *mval,
41864186
xfs_filblks_t len,
4187-
int flags)
4187+
uint32_t flags)
41884188
{
41894189
int whichfork = xfs_bmapi_whichfork(flags);
41904190
struct xfs_ifork *ifp = XFS_IFORK_PTR(bma->ip, whichfork);
@@ -4312,7 +4312,7 @@ xfs_bmapi_write(
43124312
struct xfs_inode *ip, /* incore inode */
43134313
xfs_fileoff_t bno, /* starting file offs. mapped */
43144314
xfs_filblks_t len, /* length to map in file */
4315-
int flags, /* XFS_BMAPI_... */
4315+
uint32_t flags, /* XFS_BMAPI_... */
43164316
xfs_extlen_t total, /* total blocks needed */
43174317
struct xfs_bmbt_irec *mval, /* output: map values */
43184318
int *nmap) /* i/o: mval size/count */
@@ -4629,7 +4629,7 @@ xfs_bmapi_remap(
46294629
xfs_fileoff_t bno,
46304630
xfs_filblks_t len,
46314631
xfs_fsblock_t startblock,
4632-
int flags)
4632+
uint32_t flags)
46334633
{
46344634
struct xfs_mount *mp = ip->i_mount;
46354635
struct xfs_ifork *ifp;
@@ -4801,7 +4801,7 @@ xfs_bmap_del_extent_delay(
48014801
int64_t da_old, da_new, da_diff = 0;
48024802
xfs_fileoff_t del_endoff, got_endoff;
48034803
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);
48054805
int error = 0;
48064806
bool isrt;
48074807

@@ -4926,7 +4926,7 @@ xfs_bmap_del_extent_cow(
49264926
struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_COW_FORK);
49274927
struct xfs_bmbt_irec new;
49284928
xfs_fileoff_t del_endoff, got_endoff;
4929-
int state = BMAP_COWFORK;
4929+
uint32_t state = BMAP_COWFORK;
49304930

49314931
XFS_STATS_INC(mp, xs_del_exlist);
49324932

@@ -4999,7 +4999,7 @@ xfs_bmap_del_extent_real(
49994999
xfs_bmbt_irec_t *del, /* data to remove from extents */
50005000
int *logflagsp, /* inode logging flags */
50015001
int whichfork, /* data or attr fork */
5002-
int bflags) /* bmapi flags */
5002+
uint32_t bflags) /* bmapi flags */
50035003
{
50045004
xfs_fsblock_t del_endblock=0; /* first block past del */
50055005
xfs_fileoff_t del_endoff; /* first offset past del */
@@ -5015,7 +5015,7 @@ xfs_bmap_del_extent_real(
50155015
xfs_bmbt_irec_t new; /* new record to be inserted */
50165016
/* REFERENCED */
50175017
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);
50195019
struct xfs_bmbt_irec old;
50205020

50215021
mp = ip->i_mount;
@@ -5281,7 +5281,7 @@ __xfs_bunmapi(
52815281
struct xfs_inode *ip, /* incore inode */
52825282
xfs_fileoff_t start, /* first file offset deleted */
52835283
xfs_filblks_t *rlen, /* i/o: amount remaining */
5284-
int flags, /* misc flags */
5284+
uint32_t flags, /* misc flags */
52855285
xfs_extnum_t nexts) /* number of extents max */
52865286
{
52875287
struct xfs_btree_cur *cur; /* bmap btree cursor */
@@ -5609,7 +5609,7 @@ xfs_bunmapi(
56095609
struct xfs_inode *ip,
56105610
xfs_fileoff_t bno,
56115611
xfs_filblks_t len,
5612-
int flags,
5612+
uint32_t flags,
56135613
xfs_extnum_t nexts,
56145614
int *done)
56155615
{

fs/xfs/libxfs/xfs_bmap.h

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -39,33 +39,33 @@ struct xfs_bmalloca {
3939
bool aeof; /* allocated space at eof */
4040
bool conv; /* overwriting unwritten extents */
4141
int datatype;/* data type being allocated */
42-
int flags;
42+
uint32_t flags;
4343
};
4444

4545
#define XFS_BMAP_MAX_NMAP 4
4646

4747
/*
4848
* Flags for xfs_bmapi_*
4949
*/
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 */
5555
/*
5656
* unwritten extent conversion - this needs write cache flushing and no additional
5757
* allocation alignments. When specified with XFS_BMAPI_PREALLOC it converts
5858
* from written to unwritten, otherwise convert from unwritten to written.
5959
*/
60-
#define XFS_BMAPI_CONVERT 0x040
60+
#define XFS_BMAPI_CONVERT (1u << 5)
6161

6262
/*
6363
* allocate zeroed extents - this requires all newly allocated user data extents
6464
* to be initialised to zero. It will be ignored if XFS_BMAPI_METADATA is set.
6565
* Use in conjunction with XFS_BMAPI_CONVERT to convert unwritten extents found
6666
* during the allocation range to zeroed written extents.
6767
*/
68-
#define XFS_BMAPI_ZERO 0x080
68+
#define XFS_BMAPI_ZERO (1u << 6)
6969

7070
/*
7171
* Map the inode offset to the block given in ap->firstblock. Primarily
@@ -75,16 +75,16 @@ struct xfs_bmalloca {
7575
* For bunmapi, this flag unmaps the range without adjusting quota, reducing
7676
* refcount, or freeing the blocks.
7777
*/
78-
#define XFS_BMAPI_REMAP 0x100
78+
#define XFS_BMAPI_REMAP (1u << 7)
7979

8080
/* Map something in the CoW fork. */
81-
#define XFS_BMAPI_COWFORK 0x200
81+
#define XFS_BMAPI_COWFORK (1u << 8)
8282

8383
/* Skip online discard of freed extents */
84-
#define XFS_BMAPI_NODISCARD 0x1000
84+
#define XFS_BMAPI_NODISCARD (1u << 9)
8585

8686
/* 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)
8888

8989
#define XFS_BMAPI_FLAGS \
9090
{ XFS_BMAPI_ENTIRE, "ENTIRE" }, \
@@ -106,7 +106,7 @@ static inline int xfs_bmapi_aflag(int w)
106106
(w == XFS_COW_FORK ? XFS_BMAPI_COWFORK : 0));
107107
}
108108

109-
static inline int xfs_bmapi_whichfork(int bmapi_flags)
109+
static inline int xfs_bmapi_whichfork(uint32_t bmapi_flags)
110110
{
111111
if (bmapi_flags & XFS_BMAPI_COWFORK)
112112
return XFS_COW_FORK;
@@ -124,16 +124,16 @@ static inline int xfs_bmapi_whichfork(int bmapi_flags)
124124
/*
125125
* Flags for xfs_bmap_add_extent*.
126126
*/
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)
137137

138138
#define XFS_BMAP_EXT_FLAGS \
139139
{ BMAP_LEFT_CONTIG, "LC" }, \
@@ -183,15 +183,15 @@ int xfs_bmap_last_offset(struct xfs_inode *ip, xfs_fileoff_t *unused,
183183
int whichfork);
184184
int xfs_bmapi_read(struct xfs_inode *ip, xfs_fileoff_t bno,
185185
xfs_filblks_t len, struct xfs_bmbt_irec *mval,
186-
int *nmap, int flags);
186+
int *nmap, uint32_t flags);
187187
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,
189189
xfs_extlen_t total, struct xfs_bmbt_irec *mval, int *nmap);
190190
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,
192192
xfs_extnum_t nexts);
193193
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,
195195
xfs_extnum_t nexts, int *done);
196196
int xfs_bmap_del_extent_delay(struct xfs_inode *ip, int whichfork,
197197
struct xfs_iext_cursor *cur, struct xfs_bmbt_irec *got,
@@ -243,7 +243,7 @@ void xfs_bmap_map_extent(struct xfs_trans *tp, struct xfs_inode *ip,
243243
void xfs_bmap_unmap_extent(struct xfs_trans *tp, struct xfs_inode *ip,
244244
struct xfs_bmbt_irec *imap);
245245

246-
static inline int xfs_bmap_fork_to_state(int whichfork)
246+
static inline uint32_t xfs_bmap_fork_to_state(int whichfork)
247247
{
248248
switch (whichfork) {
249249
case XFS_ATTR_FORK:
@@ -260,7 +260,7 @@ xfs_failaddr_t xfs_bmap_validate_extent(struct xfs_inode *ip, int whichfork,
260260

261261
int xfs_bmapi_remap(struct xfs_trans *tp, struct xfs_inode *ip,
262262
xfs_fileoff_t bno, xfs_filblks_t len, xfs_fsblock_t startblock,
263-
int flags);
263+
uint32_t flags);
264264

265265
extern struct kmem_cache *xfs_bmap_intent_cache;
266266

fs/xfs/libxfs/xfs_btree.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -751,20 +751,20 @@ xfs_btree_lastrec(
751751
*/
752752
void
753753
xfs_btree_offsets(
754-
int64_t fields, /* bitmask of fields */
754+
uint32_t fields, /* bitmask of fields */
755755
const short *offsets, /* table of field offsets */
756756
int nbits, /* number of bits to inspect */
757757
int *first, /* output: first byte offset */
758758
int *last) /* output: last byte offset */
759759
{
760760
int i; /* current bit number */
761-
int64_t imask; /* mask for current bit number */
761+
uint32_t imask; /* mask for current bit number */
762762

763763
ASSERT(fields != 0);
764764
/*
765765
* Find the lowest bit, so the first byte offset.
766766
*/
767-
for (i = 0, imask = 1LL; ; i++, imask <<= 1) {
767+
for (i = 0, imask = 1u; ; i++, imask <<= 1) {
768768
if (imask & fields) {
769769
*first = offsets[i];
770770
break;
@@ -773,7 +773,7 @@ xfs_btree_offsets(
773773
/*
774774
* Find the highest bit, so the last byte offset.
775775
*/
776-
for (i = nbits - 1, imask = 1LL << i; ; i--, imask >>= 1) {
776+
for (i = nbits - 1, imask = 1u << i; ; i--, imask >>= 1) {
777777
if (imask & fields) {
778778
*last = offsets[i + 1] - 1;
779779
break;
@@ -1456,7 +1456,7 @@ void
14561456
xfs_btree_log_block(
14571457
struct xfs_btree_cur *cur, /* btree cursor */
14581458
struct xfs_buf *bp, /* buffer containing btree block */
1459-
int fields) /* mask of fields: XFS_BB_... */
1459+
uint32_t fields) /* mask of fields: XFS_BB_... */
14601460
{
14611461
int first; /* first byte offset logged */
14621462
int last; /* last byte offset logged */

0 commit comments

Comments
 (0)