Merge branch 'guilt/xfs-unsigned-flags-5.18' into xfs-5.19-for-next

This commit is contained in:
Dave Chinner 2022-04-21 16:45:03 +10:00
commit 898a768f54
27 changed files with 240 additions and 238 deletions

View file

@ -2777,7 +2777,7 @@ xfs_alloc_get_freelist(
xfs_agblock_t bno; xfs_agblock_t bno;
__be32 *agfl_bno; __be32 *agfl_bno;
int error; int error;
int logflags; uint32_t logflags;
struct xfs_mount *mp = tp->t_mountp; struct xfs_mount *mp = tp->t_mountp;
struct xfs_perag *pag; struct xfs_perag *pag;
@ -2830,9 +2830,9 @@ xfs_alloc_get_freelist(
*/ */
void void
xfs_alloc_log_agf( xfs_alloc_log_agf(
xfs_trans_t *tp, /* transaction pointer */ struct xfs_trans *tp,
struct xfs_buf *bp, /* buffer for a.g. freelist header */ struct xfs_buf *bp,
int fields) /* mask of fields to be logged (XFS_AGF_...) */ uint32_t fields)
{ {
int first; /* first byte offset */ int first; /* first byte offset */
int last; /* last byte offset */ int last; /* last byte offset */
@ -2902,7 +2902,7 @@ xfs_alloc_put_freelist(
struct xfs_perag *pag; struct xfs_perag *pag;
__be32 *blockp; __be32 *blockp;
int error; int error;
int logflags; uint32_t logflags;
__be32 *agfl_bno; __be32 *agfl_bno;
int startoff; int startoff;

View file

@ -121,7 +121,7 @@ void
xfs_alloc_log_agf( xfs_alloc_log_agf(
struct xfs_trans *tp, /* transaction pointer */ struct xfs_trans *tp, /* transaction pointer */
struct xfs_buf *bp, /* buffer for a.g. freelist header */ struct xfs_buf *bp, /* buffer for a.g. freelist header */
int fields);/* mask of fields to be logged (XFS_AGF_...) */ uint32_t fields);/* mask of fields to be logged (XFS_AGF_...) */
/* /*
* Interface for inode allocation to force the pag data to be initialized. * Interface for inode allocation to force the pag data to be initialized.

View file

@ -485,7 +485,7 @@ STATIC void
xfs_bmap_validate_ret( xfs_bmap_validate_ret(
xfs_fileoff_t bno, xfs_fileoff_t bno,
xfs_filblks_t len, xfs_filblks_t len,
int flags, uint32_t flags,
xfs_bmbt_irec_t *mval, xfs_bmbt_irec_t *mval,
int nmap, int nmap,
int ret_nmap) int ret_nmap)
@ -1399,7 +1399,7 @@ xfs_bmap_add_extent_delay_real(
xfs_bmbt_irec_t r[3]; /* neighbor extent entries */ xfs_bmbt_irec_t r[3]; /* neighbor extent entries */
/* left is 0, right is 1, prev is 2 */ /* left is 0, right is 1, prev is 2 */
int rval=0; /* return value (logging flags) */ 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_new; /* new count del alloc blocks used */
xfs_filblks_t da_old; /* old 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 */ xfs_filblks_t temp=0; /* value for da_new calculations */
@ -1950,7 +1950,7 @@ xfs_bmap_add_extent_unwritten_real(
xfs_bmbt_irec_t r[3]; /* neighbor extent entries */ xfs_bmbt_irec_t r[3]; /* neighbor extent entries */
/* left is 0, right is 1, prev is 2 */ /* left is 0, right is 1, prev is 2 */
int rval=0; /* return value (logging flags) */ 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_mount *mp = ip->i_mount;
struct xfs_bmbt_irec old; struct xfs_bmbt_irec old;
@ -2479,7 +2479,7 @@ xfs_bmap_add_extent_hole_delay(
xfs_filblks_t newlen=0; /* new indirect size */ xfs_filblks_t newlen=0; /* new indirect size */
xfs_filblks_t oldlen=0; /* old indirect size */ xfs_filblks_t oldlen=0; /* old indirect size */
xfs_bmbt_irec_t right; /* right neighbor extent entry */ 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 */ xfs_filblks_t temp; /* temp for indirect calculations */
ifp = XFS_IFORK_PTR(ip, whichfork); ifp = XFS_IFORK_PTR(ip, whichfork);
@ -2616,7 +2616,7 @@ xfs_bmap_add_extent_hole_real(
struct xfs_btree_cur **curp, struct xfs_btree_cur **curp,
struct xfs_bmbt_irec *new, struct xfs_bmbt_irec *new,
int *logflagsp, int *logflagsp,
int flags) uint32_t flags)
{ {
struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork);
struct xfs_mount *mp = ip->i_mount; struct xfs_mount *mp = ip->i_mount;
@ -2626,7 +2626,7 @@ xfs_bmap_add_extent_hole_real(
xfs_bmbt_irec_t left; /* left neighbor extent entry */ xfs_bmbt_irec_t left; /* left neighbor extent entry */
xfs_bmbt_irec_t right; /* right neighbor extent entry */ xfs_bmbt_irec_t right; /* right neighbor extent entry */
int rval=0; /* return value (logging flags) */ 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; struct xfs_bmbt_irec old;
ASSERT(!isnullstartblock(new->br_startblock)); ASSERT(!isnullstartblock(new->br_startblock));
@ -3766,7 +3766,7 @@ xfs_bmapi_trim_map(
xfs_fileoff_t obno, xfs_fileoff_t obno,
xfs_fileoff_t end, xfs_fileoff_t end,
int n, int n,
int flags) uint32_t flags)
{ {
if ((flags & XFS_BMAPI_ENTIRE) || if ((flags & XFS_BMAPI_ENTIRE) ||
got->br_startoff + got->br_blockcount <= obno) { got->br_startoff + got->br_blockcount <= obno) {
@ -3811,7 +3811,7 @@ xfs_bmapi_update_map(
xfs_fileoff_t obno, xfs_fileoff_t obno,
xfs_fileoff_t end, xfs_fileoff_t end,
int *n, int *n,
int flags) uint32_t flags)
{ {
xfs_bmbt_irec_t *mval = *map; xfs_bmbt_irec_t *mval = *map;
@ -3864,7 +3864,7 @@ xfs_bmapi_read(
xfs_filblks_t len, xfs_filblks_t len,
struct xfs_bmbt_irec *mval, struct xfs_bmbt_irec *mval,
int *nmap, int *nmap,
int flags) uint32_t flags)
{ {
struct xfs_mount *mp = ip->i_mount; struct xfs_mount *mp = ip->i_mount;
int whichfork = xfs_bmapi_whichfork(flags); int whichfork = xfs_bmapi_whichfork(flags);
@ -4184,7 +4184,7 @@ xfs_bmapi_convert_unwritten(
struct xfs_bmalloca *bma, struct xfs_bmalloca *bma,
struct xfs_bmbt_irec *mval, struct xfs_bmbt_irec *mval,
xfs_filblks_t len, xfs_filblks_t len,
int flags) uint32_t flags)
{ {
int whichfork = xfs_bmapi_whichfork(flags); int whichfork = xfs_bmapi_whichfork(flags);
struct xfs_ifork *ifp = XFS_IFORK_PTR(bma->ip, whichfork); struct xfs_ifork *ifp = XFS_IFORK_PTR(bma->ip, whichfork);
@ -4312,7 +4312,7 @@ xfs_bmapi_write(
struct xfs_inode *ip, /* incore inode */ struct xfs_inode *ip, /* incore inode */
xfs_fileoff_t bno, /* starting file offs. mapped */ xfs_fileoff_t bno, /* starting file offs. mapped */
xfs_filblks_t len, /* length to map in file */ xfs_filblks_t len, /* length to map in file */
int flags, /* XFS_BMAPI_... */ uint32_t flags, /* XFS_BMAPI_... */
xfs_extlen_t total, /* total blocks needed */ xfs_extlen_t total, /* total blocks needed */
struct xfs_bmbt_irec *mval, /* output: map values */ struct xfs_bmbt_irec *mval, /* output: map values */
int *nmap) /* i/o: mval size/count */ int *nmap) /* i/o: mval size/count */
@ -4629,7 +4629,7 @@ xfs_bmapi_remap(
xfs_fileoff_t bno, xfs_fileoff_t bno,
xfs_filblks_t len, xfs_filblks_t len,
xfs_fsblock_t startblock, xfs_fsblock_t startblock,
int flags) uint32_t flags)
{ {
struct xfs_mount *mp = ip->i_mount; struct xfs_mount *mp = ip->i_mount;
struct xfs_ifork *ifp; struct xfs_ifork *ifp;
@ -4801,7 +4801,7 @@ xfs_bmap_del_extent_delay(
int64_t da_old, da_new, da_diff = 0; int64_t da_old, da_new, da_diff = 0;
xfs_fileoff_t del_endoff, got_endoff; xfs_fileoff_t del_endoff, got_endoff;
xfs_filblks_t got_indlen, new_indlen, stolen; 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; int error = 0;
bool isrt; bool isrt;
@ -4926,7 +4926,7 @@ xfs_bmap_del_extent_cow(
struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_COW_FORK); struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_COW_FORK);
struct xfs_bmbt_irec new; struct xfs_bmbt_irec new;
xfs_fileoff_t del_endoff, got_endoff; xfs_fileoff_t del_endoff, got_endoff;
int state = BMAP_COWFORK; uint32_t state = BMAP_COWFORK;
XFS_STATS_INC(mp, xs_del_exlist); XFS_STATS_INC(mp, xs_del_exlist);
@ -4999,7 +4999,7 @@ xfs_bmap_del_extent_real(
xfs_bmbt_irec_t *del, /* data to remove from extents */ xfs_bmbt_irec_t *del, /* data to remove from extents */
int *logflagsp, /* inode logging flags */ int *logflagsp, /* inode logging flags */
int whichfork, /* data or attr fork */ int whichfork, /* data or attr fork */
int bflags) /* bmapi flags */ uint32_t bflags) /* bmapi flags */
{ {
xfs_fsblock_t del_endblock=0; /* first block past del */ xfs_fsblock_t del_endblock=0; /* first block past del */
xfs_fileoff_t del_endoff; /* first offset past del */ xfs_fileoff_t del_endoff; /* first offset past del */
@ -5015,7 +5015,7 @@ xfs_bmap_del_extent_real(
xfs_bmbt_irec_t new; /* new record to be inserted */ xfs_bmbt_irec_t new; /* new record to be inserted */
/* REFERENCED */ /* REFERENCED */
uint qfield; /* quota field to update */ 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; struct xfs_bmbt_irec old;
mp = ip->i_mount; mp = ip->i_mount;
@ -5281,7 +5281,7 @@ __xfs_bunmapi(
struct xfs_inode *ip, /* incore inode */ struct xfs_inode *ip, /* incore inode */
xfs_fileoff_t start, /* first file offset deleted */ xfs_fileoff_t start, /* first file offset deleted */
xfs_filblks_t *rlen, /* i/o: amount remaining */ xfs_filblks_t *rlen, /* i/o: amount remaining */
int flags, /* misc flags */ uint32_t flags, /* misc flags */
xfs_extnum_t nexts) /* number of extents max */ xfs_extnum_t nexts) /* number of extents max */
{ {
struct xfs_btree_cur *cur; /* bmap btree cursor */ struct xfs_btree_cur *cur; /* bmap btree cursor */
@ -5609,7 +5609,7 @@ xfs_bunmapi(
struct xfs_inode *ip, struct xfs_inode *ip,
xfs_fileoff_t bno, xfs_fileoff_t bno,
xfs_filblks_t len, xfs_filblks_t len,
int flags, uint32_t flags,
xfs_extnum_t nexts, xfs_extnum_t nexts,
int *done) int *done)
{ {

View file

@ -39,7 +39,7 @@ struct xfs_bmalloca {
bool aeof; /* allocated space at eof */ bool aeof; /* allocated space at eof */
bool conv; /* overwriting unwritten extents */ bool conv; /* overwriting unwritten extents */
int datatype;/* data type being allocated */ int datatype;/* data type being allocated */
int flags; uint32_t flags;
}; };
#define XFS_BMAP_MAX_NMAP 4 #define XFS_BMAP_MAX_NMAP 4
@ -47,17 +47,17 @@ struct xfs_bmalloca {
/* /*
* Flags for xfs_bmapi_* * Flags for xfs_bmapi_*
*/ */
#define XFS_BMAPI_ENTIRE 0x001 /* return entire extent, not trimmed */ #define XFS_BMAPI_ENTIRE (1u << 0) /* return entire extent untrimmed */
#define XFS_BMAPI_METADATA 0x002 /* mapping metadata not user data */ #define XFS_BMAPI_METADATA (1u << 1) /* mapping metadata not user data */
#define XFS_BMAPI_ATTRFORK 0x004 /* use attribute fork not data */ #define XFS_BMAPI_ATTRFORK (1u << 2) /* use attribute fork not data */
#define XFS_BMAPI_PREALLOC 0x008 /* preallocation op: unwritten space */ #define XFS_BMAPI_PREALLOC (1u << 3) /* preallocating unwritten space */
#define XFS_BMAPI_CONTIG 0x020 /* must allocate only one extent */ #define XFS_BMAPI_CONTIG (1u << 4) /* must allocate only one extent */
/* /*
* unwritten extent conversion - this needs write cache flushing and no additional * unwritten extent conversion - this needs write cache flushing and no additional
* allocation alignments. When specified with XFS_BMAPI_PREALLOC it converts * allocation alignments. When specified with XFS_BMAPI_PREALLOC it converts
* from written to unwritten, otherwise convert from unwritten to written. * from written to unwritten, otherwise convert from unwritten to written.
*/ */
#define XFS_BMAPI_CONVERT 0x040 #define XFS_BMAPI_CONVERT (1u << 5)
/* /*
* allocate zeroed extents - this requires all newly allocated user data extents * allocate zeroed extents - this requires all newly allocated user data extents
@ -65,7 +65,7 @@ struct xfs_bmalloca {
* Use in conjunction with XFS_BMAPI_CONVERT to convert unwritten extents found * Use in conjunction with XFS_BMAPI_CONVERT to convert unwritten extents found
* during the allocation range to zeroed written extents. * during the allocation range to zeroed written extents.
*/ */
#define XFS_BMAPI_ZERO 0x080 #define XFS_BMAPI_ZERO (1u << 6)
/* /*
* Map the inode offset to the block given in ap->firstblock. Primarily * Map the inode offset to the block given in ap->firstblock. Primarily
@ -75,16 +75,16 @@ struct xfs_bmalloca {
* For bunmapi, this flag unmaps the range without adjusting quota, reducing * For bunmapi, this flag unmaps the range without adjusting quota, reducing
* refcount, or freeing the blocks. * refcount, or freeing the blocks.
*/ */
#define XFS_BMAPI_REMAP 0x100 #define XFS_BMAPI_REMAP (1u << 7)
/* Map something in the CoW fork. */ /* Map something in the CoW fork. */
#define XFS_BMAPI_COWFORK 0x200 #define XFS_BMAPI_COWFORK (1u << 8)
/* Skip online discard of freed extents */ /* Skip online discard of freed extents */
#define XFS_BMAPI_NODISCARD 0x1000 #define XFS_BMAPI_NODISCARD (1u << 9)
/* Do not update the rmap btree. Used for reconstructing bmbt from rmapbt. */ /* Do not update the rmap btree. Used for reconstructing bmbt from rmapbt. */
#define XFS_BMAPI_NORMAP 0x2000 #define XFS_BMAPI_NORMAP (1u << 10)
#define XFS_BMAPI_FLAGS \ #define XFS_BMAPI_FLAGS \
{ XFS_BMAPI_ENTIRE, "ENTIRE" }, \ { XFS_BMAPI_ENTIRE, "ENTIRE" }, \
@ -106,7 +106,7 @@ static inline int xfs_bmapi_aflag(int w)
(w == XFS_COW_FORK ? XFS_BMAPI_COWFORK : 0)); (w == XFS_COW_FORK ? XFS_BMAPI_COWFORK : 0));
} }
static inline int xfs_bmapi_whichfork(int bmapi_flags) static inline int xfs_bmapi_whichfork(uint32_t bmapi_flags)
{ {
if (bmapi_flags & XFS_BMAPI_COWFORK) if (bmapi_flags & XFS_BMAPI_COWFORK)
return XFS_COW_FORK; return XFS_COW_FORK;
@ -124,16 +124,16 @@ static inline int xfs_bmapi_whichfork(int bmapi_flags)
/* /*
* Flags for xfs_bmap_add_extent*. * Flags for xfs_bmap_add_extent*.
*/ */
#define BMAP_LEFT_CONTIG (1 << 0) #define BMAP_LEFT_CONTIG (1u << 0)
#define BMAP_RIGHT_CONTIG (1 << 1) #define BMAP_RIGHT_CONTIG (1u << 1)
#define BMAP_LEFT_FILLING (1 << 2) #define BMAP_LEFT_FILLING (1u << 2)
#define BMAP_RIGHT_FILLING (1 << 3) #define BMAP_RIGHT_FILLING (1u << 3)
#define BMAP_LEFT_DELAY (1 << 4) #define BMAP_LEFT_DELAY (1u << 4)
#define BMAP_RIGHT_DELAY (1 << 5) #define BMAP_RIGHT_DELAY (1u << 5)
#define BMAP_LEFT_VALID (1 << 6) #define BMAP_LEFT_VALID (1u << 6)
#define BMAP_RIGHT_VALID (1 << 7) #define BMAP_RIGHT_VALID (1u << 7)
#define BMAP_ATTRFORK (1 << 8) #define BMAP_ATTRFORK (1u << 8)
#define BMAP_COWFORK (1 << 9) #define BMAP_COWFORK (1u << 9)
#define XFS_BMAP_EXT_FLAGS \ #define XFS_BMAP_EXT_FLAGS \
{ BMAP_LEFT_CONTIG, "LC" }, \ { BMAP_LEFT_CONTIG, "LC" }, \
@ -183,15 +183,15 @@ int xfs_bmap_last_offset(struct xfs_inode *ip, xfs_fileoff_t *unused,
int whichfork); int whichfork);
int xfs_bmapi_read(struct xfs_inode *ip, xfs_fileoff_t bno, int xfs_bmapi_read(struct xfs_inode *ip, xfs_fileoff_t bno,
xfs_filblks_t len, struct xfs_bmbt_irec *mval, xfs_filblks_t len, struct xfs_bmbt_irec *mval,
int *nmap, int flags); int *nmap, uint32_t flags);
int xfs_bmapi_write(struct xfs_trans *tp, struct xfs_inode *ip, int xfs_bmapi_write(struct xfs_trans *tp, struct xfs_inode *ip,
xfs_fileoff_t bno, xfs_filblks_t len, int flags, xfs_fileoff_t bno, xfs_filblks_t len, uint32_t flags,
xfs_extlen_t total, struct xfs_bmbt_irec *mval, int *nmap); xfs_extlen_t total, struct xfs_bmbt_irec *mval, int *nmap);
int __xfs_bunmapi(struct xfs_trans *tp, struct xfs_inode *ip, int __xfs_bunmapi(struct xfs_trans *tp, struct xfs_inode *ip,
xfs_fileoff_t bno, xfs_filblks_t *rlen, int flags, xfs_fileoff_t bno, xfs_filblks_t *rlen, uint32_t flags,
xfs_extnum_t nexts); xfs_extnum_t nexts);
int xfs_bunmapi(struct xfs_trans *tp, struct xfs_inode *ip, int xfs_bunmapi(struct xfs_trans *tp, struct xfs_inode *ip,
xfs_fileoff_t bno, xfs_filblks_t len, int flags, xfs_fileoff_t bno, xfs_filblks_t len, uint32_t flags,
xfs_extnum_t nexts, int *done); xfs_extnum_t nexts, int *done);
int xfs_bmap_del_extent_delay(struct xfs_inode *ip, int whichfork, int xfs_bmap_del_extent_delay(struct xfs_inode *ip, int whichfork,
struct xfs_iext_cursor *cur, struct xfs_bmbt_irec *got, 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,
void xfs_bmap_unmap_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); 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) { switch (whichfork) {
case XFS_ATTR_FORK: case XFS_ATTR_FORK:
@ -260,7 +260,7 @@ xfs_failaddr_t xfs_bmap_validate_extent(struct xfs_inode *ip, int whichfork,
int xfs_bmapi_remap(struct xfs_trans *tp, struct xfs_inode *ip, int xfs_bmapi_remap(struct xfs_trans *tp, struct xfs_inode *ip,
xfs_fileoff_t bno, xfs_filblks_t len, xfs_fsblock_t startblock, xfs_fileoff_t bno, xfs_filblks_t len, xfs_fsblock_t startblock,
int flags); uint32_t flags);
extern struct kmem_cache *xfs_bmap_intent_cache; extern struct kmem_cache *xfs_bmap_intent_cache;

View file

@ -751,20 +751,20 @@ xfs_btree_lastrec(
*/ */
void void
xfs_btree_offsets( xfs_btree_offsets(
int64_t fields, /* bitmask of fields */ uint32_t fields, /* bitmask of fields */
const short *offsets, /* table of field offsets */ const short *offsets, /* table of field offsets */
int nbits, /* number of bits to inspect */ int nbits, /* number of bits to inspect */
int *first, /* output: first byte offset */ int *first, /* output: first byte offset */
int *last) /* output: last byte offset */ int *last) /* output: last byte offset */
{ {
int i; /* current bit number */ int i; /* current bit number */
int64_t imask; /* mask for current bit number */ uint32_t imask; /* mask for current bit number */
ASSERT(fields != 0); ASSERT(fields != 0);
/* /*
* Find the lowest bit, so the first byte offset. * Find the lowest bit, so the first byte offset.
*/ */
for (i = 0, imask = 1LL; ; i++, imask <<= 1) { for (i = 0, imask = 1u; ; i++, imask <<= 1) {
if (imask & fields) { if (imask & fields) {
*first = offsets[i]; *first = offsets[i];
break; break;
@ -773,7 +773,7 @@ xfs_btree_offsets(
/* /*
* Find the highest bit, so the last byte offset. * Find the highest bit, so the last byte offset.
*/ */
for (i = nbits - 1, imask = 1LL << i; ; i--, imask >>= 1) { for (i = nbits - 1, imask = 1u << i; ; i--, imask >>= 1) {
if (imask & fields) { if (imask & fields) {
*last = offsets[i + 1] - 1; *last = offsets[i + 1] - 1;
break; break;
@ -1456,7 +1456,7 @@ void
xfs_btree_log_block( xfs_btree_log_block(
struct xfs_btree_cur *cur, /* btree cursor */ struct xfs_btree_cur *cur, /* btree cursor */
struct xfs_buf *bp, /* buffer containing btree block */ struct xfs_buf *bp, /* buffer containing btree block */
int fields) /* mask of fields: XFS_BB_... */ uint32_t fields) /* mask of fields: XFS_BB_... */
{ {
int first; /* first byte offset logged */ int first; /* first byte offset logged */
int last; /* last byte offset logged */ int last; /* last byte offset logged */

View file

@ -68,19 +68,19 @@ uint32_t xfs_btree_magic(int crc, xfs_btnum_t btnum);
/* /*
* For logging record fields. * For logging record fields.
*/ */
#define XFS_BB_MAGIC (1 << 0) #define XFS_BB_MAGIC (1u << 0)
#define XFS_BB_LEVEL (1 << 1) #define XFS_BB_LEVEL (1u << 1)
#define XFS_BB_NUMRECS (1 << 2) #define XFS_BB_NUMRECS (1u << 2)
#define XFS_BB_LEFTSIB (1 << 3) #define XFS_BB_LEFTSIB (1u << 3)
#define XFS_BB_RIGHTSIB (1 << 4) #define XFS_BB_RIGHTSIB (1u << 4)
#define XFS_BB_BLKNO (1 << 5) #define XFS_BB_BLKNO (1u << 5)
#define XFS_BB_LSN (1 << 6) #define XFS_BB_LSN (1u << 6)
#define XFS_BB_UUID (1 << 7) #define XFS_BB_UUID (1u << 7)
#define XFS_BB_OWNER (1 << 8) #define XFS_BB_OWNER (1u << 8)
#define XFS_BB_NUM_BITS 5 #define XFS_BB_NUM_BITS 5
#define XFS_BB_ALL_BITS ((1 << XFS_BB_NUM_BITS) - 1) #define XFS_BB_ALL_BITS ((1u << XFS_BB_NUM_BITS) - 1)
#define XFS_BB_NUM_BITS_CRC 9 #define XFS_BB_NUM_BITS_CRC 9
#define XFS_BB_ALL_BITS_CRC ((1 << XFS_BB_NUM_BITS_CRC) - 1) #define XFS_BB_ALL_BITS_CRC ((1u << XFS_BB_NUM_BITS_CRC) - 1)
/* /*
* Generic stats interface * Generic stats interface
@ -345,7 +345,7 @@ xfs_btree_dup_cursor(
*/ */
void void
xfs_btree_offsets( xfs_btree_offsets(
int64_t fields, /* bitmask of fields */ uint32_t fields, /* bitmask of fields */
const short *offsets,/* table of field offsets */ const short *offsets,/* table of field offsets */
int nbits, /* number of bits to inspect */ int nbits, /* number of bits to inspect */
int *first, /* output: first byte offset */ int *first, /* output: first byte offset */
@ -435,7 +435,7 @@ bool xfs_btree_sblock_verify_crc(struct xfs_buf *);
/* /*
* Internal btree helpers also used by xfs_bmap.c. * Internal btree helpers also used by xfs_bmap.c.
*/ */
void xfs_btree_log_block(struct xfs_btree_cur *, struct xfs_buf *, int); void xfs_btree_log_block(struct xfs_btree_cur *, struct xfs_buf *, uint32_t);
void xfs_btree_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int, int); void xfs_btree_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int, int);
/* /*

View file

@ -76,19 +76,19 @@ typedef struct xfs_da_args {
xfs_dablk_t rmtblkno2; /* remote attr value starting blkno */ xfs_dablk_t rmtblkno2; /* remote attr value starting blkno */
int rmtblkcnt2; /* remote attr value block count */ int rmtblkcnt2; /* remote attr value block count */
int rmtvaluelen2; /* remote attr value length in bytes */ int rmtvaluelen2; /* remote attr value length in bytes */
int op_flags; /* operation flags */ uint32_t op_flags; /* operation flags */
enum xfs_dacmp cmpresult; /* name compare result for lookups */ enum xfs_dacmp cmpresult; /* name compare result for lookups */
} xfs_da_args_t; } xfs_da_args_t;
/* /*
* Operation flags: * Operation flags:
*/ */
#define XFS_DA_OP_JUSTCHECK 0x0001 /* check for ok with no space */ #define XFS_DA_OP_JUSTCHECK (1u << 0) /* check for ok with no space */
#define XFS_DA_OP_RENAME 0x0002 /* this is an atomic rename op */ #define XFS_DA_OP_RENAME (1u << 1) /* this is an atomic rename op */
#define XFS_DA_OP_ADDNAME 0x0004 /* this is an add operation */ #define XFS_DA_OP_ADDNAME (1u << 2) /* this is an add operation */
#define XFS_DA_OP_OKNOENT 0x0008 /* lookup/add op, ENOENT ok, else die */ #define XFS_DA_OP_OKNOENT (1u << 3) /* lookup op, ENOENT ok, else die */
#define XFS_DA_OP_CILOOKUP 0x0010 /* lookup to return CI name if found */ #define XFS_DA_OP_CILOOKUP (1u << 4) /* lookup returns CI name if found */
#define XFS_DA_OP_NOTIME 0x0020 /* don't update inode timestamps */ #define XFS_DA_OP_NOTIME (1u << 5) /* don't update inode timestamps */
#define XFS_DA_OP_FLAGS \ #define XFS_DA_OP_FLAGS \
{ XFS_DA_OP_JUSTCHECK, "JUSTCHECK" }, \ { XFS_DA_OP_JUSTCHECK, "JUSTCHECK" }, \
@ -197,7 +197,7 @@ int xfs_da3_node_read_mapped(struct xfs_trans *tp, struct xfs_inode *dp,
* Utility routines. * Utility routines.
*/ */
#define XFS_DABUF_MAP_HOLE_OK (1 << 0) #define XFS_DABUF_MAP_HOLE_OK (1u << 0)
int xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno); int xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno);
int xfs_da_grow_inode_int(struct xfs_da_args *args, xfs_fileoff_t *bno, int xfs_da_grow_inode_int(struct xfs_da_args *args, xfs_fileoff_t *bno,

View file

@ -688,10 +688,10 @@ struct xfs_attr3_leafblock {
#define XFS_ATTR_ROOT_BIT 1 /* limit access to trusted attrs */ #define XFS_ATTR_ROOT_BIT 1 /* limit access to trusted attrs */
#define XFS_ATTR_SECURE_BIT 2 /* limit access to secure attrs */ #define XFS_ATTR_SECURE_BIT 2 /* limit access to secure attrs */
#define XFS_ATTR_INCOMPLETE_BIT 7 /* attr in middle of create/delete */ #define XFS_ATTR_INCOMPLETE_BIT 7 /* attr in middle of create/delete */
#define XFS_ATTR_LOCAL (1 << XFS_ATTR_LOCAL_BIT) #define XFS_ATTR_LOCAL (1u << XFS_ATTR_LOCAL_BIT)
#define XFS_ATTR_ROOT (1 << XFS_ATTR_ROOT_BIT) #define XFS_ATTR_ROOT (1u << XFS_ATTR_ROOT_BIT)
#define XFS_ATTR_SECURE (1 << XFS_ATTR_SECURE_BIT) #define XFS_ATTR_SECURE (1u << XFS_ATTR_SECURE_BIT)
#define XFS_ATTR_INCOMPLETE (1 << XFS_ATTR_INCOMPLETE_BIT) #define XFS_ATTR_INCOMPLETE (1u << XFS_ATTR_INCOMPLETE_BIT)
#define XFS_ATTR_NSP_ONDISK_MASK (XFS_ATTR_ROOT | XFS_ATTR_SECURE) #define XFS_ATTR_NSP_ONDISK_MASK (XFS_ATTR_ROOT | XFS_ATTR_SECURE)
/* /*

View file

@ -525,26 +525,26 @@ typedef struct xfs_agf {
#define XFS_AGF_CRC_OFF offsetof(struct xfs_agf, agf_crc) #define XFS_AGF_CRC_OFF offsetof(struct xfs_agf, agf_crc)
#define XFS_AGF_MAGICNUM 0x00000001 #define XFS_AGF_MAGICNUM (1u << 0)
#define XFS_AGF_VERSIONNUM 0x00000002 #define XFS_AGF_VERSIONNUM (1u << 1)
#define XFS_AGF_SEQNO 0x00000004 #define XFS_AGF_SEQNO (1u << 2)
#define XFS_AGF_LENGTH 0x00000008 #define XFS_AGF_LENGTH (1u << 3)
#define XFS_AGF_ROOTS 0x00000010 #define XFS_AGF_ROOTS (1u << 4)
#define XFS_AGF_LEVELS 0x00000020 #define XFS_AGF_LEVELS (1u << 5)
#define XFS_AGF_FLFIRST 0x00000040 #define XFS_AGF_FLFIRST (1u << 6)
#define XFS_AGF_FLLAST 0x00000080 #define XFS_AGF_FLLAST (1u << 7)
#define XFS_AGF_FLCOUNT 0x00000100 #define XFS_AGF_FLCOUNT (1u << 8)
#define XFS_AGF_FREEBLKS 0x00000200 #define XFS_AGF_FREEBLKS (1u << 9)
#define XFS_AGF_LONGEST 0x00000400 #define XFS_AGF_LONGEST (1u << 10)
#define XFS_AGF_BTREEBLKS 0x00000800 #define XFS_AGF_BTREEBLKS (1u << 11)
#define XFS_AGF_UUID 0x00001000 #define XFS_AGF_UUID (1u << 12)
#define XFS_AGF_RMAP_BLOCKS 0x00002000 #define XFS_AGF_RMAP_BLOCKS (1u << 13)
#define XFS_AGF_REFCOUNT_BLOCKS 0x00004000 #define XFS_AGF_REFCOUNT_BLOCKS (1u << 14)
#define XFS_AGF_REFCOUNT_ROOT 0x00008000 #define XFS_AGF_REFCOUNT_ROOT (1u << 15)
#define XFS_AGF_REFCOUNT_LEVEL 0x00010000 #define XFS_AGF_REFCOUNT_LEVEL (1u << 16)
#define XFS_AGF_SPARE64 0x00020000 #define XFS_AGF_SPARE64 (1u << 17)
#define XFS_AGF_NUM_BITS 18 #define XFS_AGF_NUM_BITS 18
#define XFS_AGF_ALL_BITS ((1 << XFS_AGF_NUM_BITS) - 1) #define XFS_AGF_ALL_BITS ((1u << XFS_AGF_NUM_BITS) - 1)
#define XFS_AGF_FLAGS \ #define XFS_AGF_FLAGS \
{ XFS_AGF_MAGICNUM, "MAGICNUM" }, \ { XFS_AGF_MAGICNUM, "MAGICNUM" }, \
@ -619,22 +619,22 @@ typedef struct xfs_agi {
#define XFS_AGI_CRC_OFF offsetof(struct xfs_agi, agi_crc) #define XFS_AGI_CRC_OFF offsetof(struct xfs_agi, agi_crc)
#define XFS_AGI_MAGICNUM (1 << 0) #define XFS_AGI_MAGICNUM (1u << 0)
#define XFS_AGI_VERSIONNUM (1 << 1) #define XFS_AGI_VERSIONNUM (1u << 1)
#define XFS_AGI_SEQNO (1 << 2) #define XFS_AGI_SEQNO (1u << 2)
#define XFS_AGI_LENGTH (1 << 3) #define XFS_AGI_LENGTH (1u << 3)
#define XFS_AGI_COUNT (1 << 4) #define XFS_AGI_COUNT (1u << 4)
#define XFS_AGI_ROOT (1 << 5) #define XFS_AGI_ROOT (1u << 5)
#define XFS_AGI_LEVEL (1 << 6) #define XFS_AGI_LEVEL (1u << 6)
#define XFS_AGI_FREECOUNT (1 << 7) #define XFS_AGI_FREECOUNT (1u << 7)
#define XFS_AGI_NEWINO (1 << 8) #define XFS_AGI_NEWINO (1u << 8)
#define XFS_AGI_DIRINO (1 << 9) #define XFS_AGI_DIRINO (1u << 9)
#define XFS_AGI_UNLINKED (1 << 10) #define XFS_AGI_UNLINKED (1u << 10)
#define XFS_AGI_NUM_BITS_R1 11 /* end of the 1st agi logging region */ #define XFS_AGI_NUM_BITS_R1 11 /* end of the 1st agi logging region */
#define XFS_AGI_ALL_BITS_R1 ((1 << XFS_AGI_NUM_BITS_R1) - 1) #define XFS_AGI_ALL_BITS_R1 ((1u << XFS_AGI_NUM_BITS_R1) - 1)
#define XFS_AGI_FREE_ROOT (1 << 11) #define XFS_AGI_FREE_ROOT (1u << 11)
#define XFS_AGI_FREE_LEVEL (1 << 12) #define XFS_AGI_FREE_LEVEL (1u << 12)
#define XFS_AGI_IBLOCKS (1 << 13) /* both inobt/finobt block counters */ #define XFS_AGI_IBLOCKS (1u << 13) /* both inobt/finobt block counters */
#define XFS_AGI_NUM_BITS_R2 14 #define XFS_AGI_NUM_BITS_R2 14
/* disk block (xfs_daddr_t) in the AG */ /* disk block (xfs_daddr_t) in the AG */
@ -1085,10 +1085,10 @@ static inline bool xfs_dinode_has_bigtime(const struct xfs_dinode *dip)
#define XFS_DQUOT_MAGIC 0x4451 /* 'DQ' */ #define XFS_DQUOT_MAGIC 0x4451 /* 'DQ' */
#define XFS_DQUOT_VERSION (uint8_t)0x01 /* latest version number */ #define XFS_DQUOT_VERSION (uint8_t)0x01 /* latest version number */
#define XFS_DQTYPE_USER 0x01 /* user dquot record */ #define XFS_DQTYPE_USER (1u << 0) /* user dquot record */
#define XFS_DQTYPE_PROJ 0x02 /* project dquot record */ #define XFS_DQTYPE_PROJ (1u << 1) /* project dquot record */
#define XFS_DQTYPE_GROUP 0x04 /* group dquot record */ #define XFS_DQTYPE_GROUP (1u << 2) /* group dquot record */
#define XFS_DQTYPE_BIGTIME 0x80 /* large expiry timestamps */ #define XFS_DQTYPE_BIGTIME (1u << 7) /* large expiry timestamps */
/* bitmask to determine if this is a user/group/project dquot */ /* bitmask to determine if this is a user/group/project dquot */
#define XFS_DQTYPE_REC_MASK (XFS_DQTYPE_USER | \ #define XFS_DQTYPE_REC_MASK (XFS_DQTYPE_USER | \

View file

@ -699,34 +699,34 @@ struct xfs_scrub_metadata {
#define XFS_SCRUB_TYPE_NR 25 #define XFS_SCRUB_TYPE_NR 25
/* i: Repair this metadata. */ /* i: Repair this metadata. */
#define XFS_SCRUB_IFLAG_REPAIR (1 << 0) #define XFS_SCRUB_IFLAG_REPAIR (1u << 0)
/* o: Metadata object needs repair. */ /* o: Metadata object needs repair. */
#define XFS_SCRUB_OFLAG_CORRUPT (1 << 1) #define XFS_SCRUB_OFLAG_CORRUPT (1u << 1)
/* /*
* o: Metadata object could be optimized. It's not corrupt, but * o: Metadata object could be optimized. It's not corrupt, but
* we could improve on it somehow. * we could improve on it somehow.
*/ */
#define XFS_SCRUB_OFLAG_PREEN (1 << 2) #define XFS_SCRUB_OFLAG_PREEN (1u << 2)
/* o: Cross-referencing failed. */ /* o: Cross-referencing failed. */
#define XFS_SCRUB_OFLAG_XFAIL (1 << 3) #define XFS_SCRUB_OFLAG_XFAIL (1u << 3)
/* o: Metadata object disagrees with cross-referenced metadata. */ /* o: Metadata object disagrees with cross-referenced metadata. */
#define XFS_SCRUB_OFLAG_XCORRUPT (1 << 4) #define XFS_SCRUB_OFLAG_XCORRUPT (1u << 4)
/* o: Scan was not complete. */ /* o: Scan was not complete. */
#define XFS_SCRUB_OFLAG_INCOMPLETE (1 << 5) #define XFS_SCRUB_OFLAG_INCOMPLETE (1u << 5)
/* o: Metadata object looked funny but isn't corrupt. */ /* o: Metadata object looked funny but isn't corrupt. */
#define XFS_SCRUB_OFLAG_WARNING (1 << 6) #define XFS_SCRUB_OFLAG_WARNING (1u << 6)
/* /*
* o: IFLAG_REPAIR was set but metadata object did not need fixing or * o: IFLAG_REPAIR was set but metadata object did not need fixing or
* optimization and has therefore not been altered. * optimization and has therefore not been altered.
*/ */
#define XFS_SCRUB_OFLAG_NO_REPAIR_NEEDED (1 << 7) #define XFS_SCRUB_OFLAG_NO_REPAIR_NEEDED (1u << 7)
#define XFS_SCRUB_FLAGS_IN (XFS_SCRUB_IFLAG_REPAIR) #define XFS_SCRUB_FLAGS_IN (XFS_SCRUB_IFLAG_REPAIR)
#define XFS_SCRUB_FLAGS_OUT (XFS_SCRUB_OFLAG_CORRUPT | \ #define XFS_SCRUB_FLAGS_OUT (XFS_SCRUB_OFLAG_CORRUPT | \

View file

@ -2414,9 +2414,9 @@ xfs_imap(
*/ */
void void
xfs_ialloc_log_agi( xfs_ialloc_log_agi(
xfs_trans_t *tp, /* transaction pointer */ struct xfs_trans *tp,
struct xfs_buf *bp, /* allocation group header buffer */ struct xfs_buf *bp,
int fields) /* bitmask of fields to log */ uint32_t fields)
{ {
int first; /* first byte number */ int first; /* first byte number */
int last; /* last byte number */ int last; /* last byte number */

View file

@ -60,7 +60,7 @@ void
xfs_ialloc_log_agi( xfs_ialloc_log_agi(
struct xfs_trans *tp, /* transaction pointer */ struct xfs_trans *tp, /* transaction pointer */
struct xfs_buf *bp, /* allocation group header buffer */ struct xfs_buf *bp, /* allocation group header buffer */
int fields); /* bitmask of fields to log */ uint32_t fields); /* bitmask of fields to log */
/* /*
* Read in the allocation group header (inode allocation section) * Read in the allocation group header (inode allocation section)

View file

@ -29,8 +29,8 @@ typedef uint8_t xfs_dqtype_t;
/* /*
* flags for q_flags field in the dquot. * flags for q_flags field in the dquot.
*/ */
#define XFS_DQFLAG_DIRTY (1 << 0) /* dquot is dirty */ #define XFS_DQFLAG_DIRTY (1u << 0) /* dquot is dirty */
#define XFS_DQFLAG_FREEING (1 << 1) /* dquot is being torn down */ #define XFS_DQFLAG_FREEING (1u << 1) /* dquot is being torn down */
#define XFS_DQFLAG_STRINGS \ #define XFS_DQFLAG_STRINGS \
{ XFS_DQFLAG_DIRTY, "DIRTY" }, \ { XFS_DQFLAG_DIRTY, "DIRTY" }, \
@ -73,29 +73,45 @@ typedef uint8_t xfs_dqtype_t;
* to a single function. None of these XFS_QMOPT_* flags are meant to have * to a single function. None of these XFS_QMOPT_* flags are meant to have
* persistent values (ie. their values can and will change between versions) * persistent values (ie. their values can and will change between versions)
*/ */
#define XFS_QMOPT_UQUOTA 0x0000004 /* user dquot requested */ #define XFS_QMOPT_UQUOTA (1u << 0) /* user dquot requested */
#define XFS_QMOPT_PQUOTA 0x0000008 /* project dquot requested */ #define XFS_QMOPT_GQUOTA (1u << 1) /* group dquot requested */
#define XFS_QMOPT_FORCE_RES 0x0000010 /* ignore quota limits */ #define XFS_QMOPT_PQUOTA (1u << 2) /* project dquot requested */
#define XFS_QMOPT_SBVERSION 0x0000040 /* change superblock version num */ #define XFS_QMOPT_FORCE_RES (1u << 3) /* ignore quota limits */
#define XFS_QMOPT_GQUOTA 0x0002000 /* group dquot requested */ #define XFS_QMOPT_SBVERSION (1u << 4) /* change superblock version num */
/* /*
* flags to xfs_trans_mod_dquot to indicate which field needs to be * flags to xfs_trans_mod_dquot to indicate which field needs to be
* modified. * modified.
*/ */
#define XFS_QMOPT_RES_REGBLKS 0x0010000 #define XFS_QMOPT_RES_REGBLKS (1u << 7)
#define XFS_QMOPT_RES_RTBLKS 0x0020000 #define XFS_QMOPT_RES_RTBLKS (1u << 8)
#define XFS_QMOPT_BCOUNT 0x0040000 #define XFS_QMOPT_BCOUNT (1u << 9)
#define XFS_QMOPT_ICOUNT 0x0080000 #define XFS_QMOPT_ICOUNT (1u << 10)
#define XFS_QMOPT_RTBCOUNT 0x0100000 #define XFS_QMOPT_RTBCOUNT (1u << 11)
#define XFS_QMOPT_DELBCOUNT 0x0200000 #define XFS_QMOPT_DELBCOUNT (1u << 12)
#define XFS_QMOPT_DELRTBCOUNT 0x0400000 #define XFS_QMOPT_DELRTBCOUNT (1u << 13)
#define XFS_QMOPT_RES_INOS 0x0800000 #define XFS_QMOPT_RES_INOS (1u << 14)
/* /*
* flags for dqalloc. * flags for dqalloc.
*/ */
#define XFS_QMOPT_INHERIT 0x1000000 #define XFS_QMOPT_INHERIT (1u << 31)
#define XFS_QMOPT_FLAGS \
{ XFS_QMOPT_UQUOTA, "UQUOTA" }, \
{ XFS_QMOPT_PQUOTA, "PQUOTA" }, \
{ XFS_QMOPT_FORCE_RES, "FORCE_RES" }, \
{ XFS_QMOPT_SBVERSION, "SBVERSION" }, \
{ XFS_QMOPT_GQUOTA, "GQUOTA" }, \
{ XFS_QMOPT_INHERIT, "INHERIT" }, \
{ XFS_QMOPT_RES_REGBLKS, "RES_REGBLKS" }, \
{ XFS_QMOPT_RES_RTBLKS, "RES_RTBLKS" }, \
{ XFS_QMOPT_BCOUNT, "BCOUNT" }, \
{ XFS_QMOPT_ICOUNT, "ICOUNT" }, \
{ XFS_QMOPT_RTBCOUNT, "RTBCOUNT" }, \
{ XFS_QMOPT_DELBCOUNT, "DELBCOUNT" }, \
{ XFS_QMOPT_DELRTBCOUNT, "DELRTBCOUNT" }, \
{ XFS_QMOPT_RES_INOS, "RES_INOS" }
/* /*
* flags to xfs_trans_mod_dquot. * flags to xfs_trans_mod_dquot.
@ -114,6 +130,7 @@ typedef uint8_t xfs_dqtype_t;
(XFS_QMOPT_UQUOTA | XFS_QMOPT_PQUOTA | XFS_QMOPT_GQUOTA) (XFS_QMOPT_UQUOTA | XFS_QMOPT_PQUOTA | XFS_QMOPT_GQUOTA)
#define XFS_QMOPT_RESBLK_MASK (XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_RES_RTBLKS) #define XFS_QMOPT_RESBLK_MASK (XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_RES_RTBLKS)
extern xfs_failaddr_t xfs_dquot_verify(struct xfs_mount *mp, extern xfs_failaddr_t xfs_dquot_verify(struct xfs_mount *mp,
struct xfs_disk_dquot *ddq, xfs_dqid_t id); struct xfs_disk_dquot *ddq, xfs_dqid_t id);
extern xfs_failaddr_t xfs_dqblk_verify(struct xfs_mount *mp, extern xfs_failaddr_t xfs_dqblk_verify(struct xfs_mount *mp,

View file

@ -8,15 +8,18 @@
/* kernel only definitions */ /* kernel only definitions */
struct xfs_buf;
struct xfs_mount;
/* buf log item flags */ /* buf log item flags */
#define XFS_BLI_HOLD 0x01 #define XFS_BLI_HOLD (1u << 0)
#define XFS_BLI_DIRTY 0x02 #define XFS_BLI_DIRTY (1u << 1)
#define XFS_BLI_STALE 0x04 #define XFS_BLI_STALE (1u << 2)
#define XFS_BLI_LOGGED 0x08 #define XFS_BLI_LOGGED (1u << 3)
#define XFS_BLI_INODE_ALLOC_BUF 0x10 #define XFS_BLI_INODE_ALLOC_BUF (1u << 4)
#define XFS_BLI_STALE_INODE 0x20 #define XFS_BLI_STALE_INODE (1u << 5)
#define XFS_BLI_INODE_BUF 0x40 #define XFS_BLI_INODE_BUF (1u << 6)
#define XFS_BLI_ORDERED 0x80 #define XFS_BLI_ORDERED (1u << 7)
#define XFS_BLI_FLAGS \ #define XFS_BLI_FLAGS \
{ XFS_BLI_HOLD, "HOLD" }, \ { XFS_BLI_HOLD, "HOLD" }, \
@ -28,11 +31,6 @@
{ XFS_BLI_INODE_BUF, "INODE_BUF" }, \ { XFS_BLI_INODE_BUF, "INODE_BUF" }, \
{ XFS_BLI_ORDERED, "ORDERED" } { XFS_BLI_ORDERED, "ORDERED" }
struct xfs_buf;
struct xfs_mount;
struct xfs_buf_log_item;
/* /*
* This is the in core log item structure used to track information * This is the in core log item structure used to track information
* needed to log buffers. It tracks how many times the lock has been * needed to log buffers. It tracks how many times the lock has been

View file

@ -64,16 +64,16 @@ extern int xfs_errortag_clearall(struct xfs_mount *mp);
* XFS panic tags -- allow a call to xfs_alert_tag() be turned into * XFS panic tags -- allow a call to xfs_alert_tag() be turned into
* a panic by setting xfs_panic_mask in a sysctl. * a panic by setting xfs_panic_mask in a sysctl.
*/ */
#define XFS_NO_PTAG 0 #define XFS_NO_PTAG 0u
#define XFS_PTAG_IFLUSH 0x00000001 #define XFS_PTAG_IFLUSH (1u << 0)
#define XFS_PTAG_LOGRES 0x00000002 #define XFS_PTAG_LOGRES (1u << 1)
#define XFS_PTAG_AILDELETE 0x00000004 #define XFS_PTAG_AILDELETE (1u << 2)
#define XFS_PTAG_ERROR_REPORT 0x00000008 #define XFS_PTAG_ERROR_REPORT (1u << 3)
#define XFS_PTAG_SHUTDOWN_CORRUPT 0x00000010 #define XFS_PTAG_SHUTDOWN_CORRUPT (1u << 4)
#define XFS_PTAG_SHUTDOWN_IOERROR 0x00000020 #define XFS_PTAG_SHUTDOWN_IOERROR (1u << 5)
#define XFS_PTAG_SHUTDOWN_LOGERROR 0x00000040 #define XFS_PTAG_SHUTDOWN_LOGERROR (1u << 6)
#define XFS_PTAG_FSBLOCK_ZERO 0x00000080 #define XFS_PTAG_FSBLOCK_ZERO (1u << 7)
#define XFS_PTAG_VERIFIER_ERROR 0x00000100 #define XFS_PTAG_VERIFIER_ERROR (1u << 8)
#define XFS_PTAG_STRINGS \ #define XFS_PTAG_STRINGS \
{ XFS_NO_PTAG, "none" }, \ { XFS_NO_PTAG, "none" }, \

View file

@ -310,7 +310,7 @@ STATIC ssize_t
xfs_file_write_checks( xfs_file_write_checks(
struct kiocb *iocb, struct kiocb *iocb,
struct iov_iter *from, struct iov_iter *from,
int *iolock) unsigned int *iolock)
{ {
struct file *file = iocb->ki_filp; struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host; struct inode *inode = file->f_mapping->host;
@ -513,7 +513,7 @@ xfs_file_dio_write_aligned(
struct kiocb *iocb, struct kiocb *iocb,
struct iov_iter *from) struct iov_iter *from)
{ {
int iolock = XFS_IOLOCK_SHARED; unsigned int iolock = XFS_IOLOCK_SHARED;
ssize_t ret; ssize_t ret;
ret = xfs_ilock_iocb(iocb, iolock); ret = xfs_ilock_iocb(iocb, iolock);
@ -566,7 +566,7 @@ xfs_file_dio_write_unaligned(
{ {
size_t isize = i_size_read(VFS_I(ip)); size_t isize = i_size_read(VFS_I(ip));
size_t count = iov_iter_count(from); size_t count = iov_iter_count(from);
int iolock = XFS_IOLOCK_SHARED; unsigned int iolock = XFS_IOLOCK_SHARED;
unsigned int flags = IOMAP_DIO_OVERWRITE_ONLY; unsigned int flags = IOMAP_DIO_OVERWRITE_ONLY;
ssize_t ret; ssize_t ret;
@ -655,7 +655,7 @@ xfs_file_dax_write(
{ {
struct inode *inode = iocb->ki_filp->f_mapping->host; struct inode *inode = iocb->ki_filp->f_mapping->host;
struct xfs_inode *ip = XFS_I(inode); struct xfs_inode *ip = XFS_I(inode);
int iolock = XFS_IOLOCK_EXCL; unsigned int iolock = XFS_IOLOCK_EXCL;
ssize_t ret, error = 0; ssize_t ret, error = 0;
loff_t pos; loff_t pos;
@ -698,7 +698,7 @@ xfs_file_buffered_write(
struct xfs_inode *ip = XFS_I(inode); struct xfs_inode *ip = XFS_I(inode);
ssize_t ret; ssize_t ret;
bool cleared_space = false; bool cleared_space = false;
int iolock; unsigned int iolock;
if (iocb->ki_flags & IOCB_NOWAIT) if (iocb->ki_flags & IOCB_NOWAIT)
return -EOPNOTSUPP; return -EOPNOTSUPP;
@ -1175,7 +1175,7 @@ xfs_dir_open(
struct file *file) struct file *file)
{ {
struct xfs_inode *ip = XFS_I(inode); struct xfs_inode *ip = XFS_I(inode);
int mode; unsigned int mode;
int error; int error;
error = xfs_file_open(inode, file); error = xfs_file_open(inode, file);

View file

@ -509,7 +509,7 @@ xfs_fs_goingdown(
void void
xfs_do_force_shutdown( xfs_do_force_shutdown(
struct xfs_mount *mp, struct xfs_mount *mp,
int flags, uint32_t flags,
char *fname, char *fname,
int lnnum) int lnnum)
{ {

View file

@ -416,10 +416,12 @@ xfs_lockdep_subclass_ok(
* parent locking. Care must be taken to ensure we don't overrun the subclass * parent locking. Care must be taken to ensure we don't overrun the subclass
* storage fields in the class mask we build. * storage fields in the class mask we build.
*/ */
static inline int static inline uint
xfs_lock_inumorder(int lock_mode, int subclass) xfs_lock_inumorder(
uint lock_mode,
uint subclass)
{ {
int class = 0; uint class = 0;
ASSERT(!(lock_mode & (XFS_ILOCK_PARENT | XFS_ILOCK_RTBITMAP | ASSERT(!(lock_mode & (XFS_ILOCK_PARENT | XFS_ILOCK_RTBITMAP |
XFS_ILOCK_RTSUM))); XFS_ILOCK_RTSUM)));
@ -464,7 +466,10 @@ xfs_lock_inodes(
int inodes, int inodes,
uint lock_mode) uint lock_mode)
{ {
int attempts = 0, i, j, try_lock; int attempts = 0;
uint i;
int j;
bool try_lock;
struct xfs_log_item *lp; struct xfs_log_item *lp;
/* /*
@ -489,9 +494,9 @@ xfs_lock_inodes(
} else if (lock_mode & XFS_MMAPLOCK_EXCL) } else if (lock_mode & XFS_MMAPLOCK_EXCL)
ASSERT(!(lock_mode & XFS_ILOCK_EXCL)); ASSERT(!(lock_mode & XFS_ILOCK_EXCL));
try_lock = 0;
i = 0;
again: again:
try_lock = false;
i = 0;
for (; i < inodes; i++) { for (; i < inodes; i++) {
ASSERT(ips[i]); ASSERT(ips[i]);
@ -506,7 +511,7 @@ xfs_lock_inodes(
for (j = (i - 1); j >= 0 && !try_lock; j--) { for (j = (i - 1); j >= 0 && !try_lock; j--) {
lp = &ips[j]->i_itemp->ili_item; lp = &ips[j]->i_itemp->ili_item;
if (lp && test_bit(XFS_LI_IN_AIL, &lp->li_flags)) if (lp && test_bit(XFS_LI_IN_AIL, &lp->li_flags))
try_lock++; try_lock = true;
} }
} }
@ -546,8 +551,6 @@ xfs_lock_inodes(
if ((attempts % 5) == 0) { if ((attempts % 5) == 0) {
delay(1); /* Don't just spin the CPU */ delay(1); /* Don't just spin the CPU */
} }
i = 0;
try_lock = 0;
goto again; goto again;
} }
} }

View file

@ -278,12 +278,12 @@ static inline bool xfs_inode_has_bigtime(struct xfs_inode *ip)
* Bit ranges: 1<<1 - 1<<16-1 -- iolock/ilock modes (bitfield) * Bit ranges: 1<<1 - 1<<16-1 -- iolock/ilock modes (bitfield)
* 1<<16 - 1<<32-1 -- lockdep annotation (integers) * 1<<16 - 1<<32-1 -- lockdep annotation (integers)
*/ */
#define XFS_IOLOCK_EXCL (1<<0) #define XFS_IOLOCK_EXCL (1u << 0)
#define XFS_IOLOCK_SHARED (1<<1) #define XFS_IOLOCK_SHARED (1u << 1)
#define XFS_ILOCK_EXCL (1<<2) #define XFS_ILOCK_EXCL (1u << 2)
#define XFS_ILOCK_SHARED (1<<3) #define XFS_ILOCK_SHARED (1u << 3)
#define XFS_MMAPLOCK_EXCL (1<<4) #define XFS_MMAPLOCK_EXCL (1u << 4)
#define XFS_MMAPLOCK_SHARED (1<<5) #define XFS_MMAPLOCK_SHARED (1u << 5)
#define XFS_LOCK_MASK (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED \ #define XFS_LOCK_MASK (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED \
| XFS_ILOCK_EXCL | XFS_ILOCK_SHARED \ | XFS_ILOCK_EXCL | XFS_ILOCK_SHARED \
@ -350,19 +350,19 @@ static inline bool xfs_inode_has_bigtime(struct xfs_inode *ip)
*/ */
#define XFS_IOLOCK_SHIFT 16 #define XFS_IOLOCK_SHIFT 16
#define XFS_IOLOCK_MAX_SUBCLASS 3 #define XFS_IOLOCK_MAX_SUBCLASS 3
#define XFS_IOLOCK_DEP_MASK 0x000f0000 #define XFS_IOLOCK_DEP_MASK 0x000f0000u
#define XFS_MMAPLOCK_SHIFT 20 #define XFS_MMAPLOCK_SHIFT 20
#define XFS_MMAPLOCK_NUMORDER 0 #define XFS_MMAPLOCK_NUMORDER 0
#define XFS_MMAPLOCK_MAX_SUBCLASS 3 #define XFS_MMAPLOCK_MAX_SUBCLASS 3
#define XFS_MMAPLOCK_DEP_MASK 0x00f00000 #define XFS_MMAPLOCK_DEP_MASK 0x00f00000u
#define XFS_ILOCK_SHIFT 24 #define XFS_ILOCK_SHIFT 24
#define XFS_ILOCK_PARENT_VAL 5 #define XFS_ILOCK_PARENT_VAL 5u
#define XFS_ILOCK_MAX_SUBCLASS (XFS_ILOCK_PARENT_VAL - 1) #define XFS_ILOCK_MAX_SUBCLASS (XFS_ILOCK_PARENT_VAL - 1)
#define XFS_ILOCK_RTBITMAP_VAL 6 #define XFS_ILOCK_RTBITMAP_VAL 6u
#define XFS_ILOCK_RTSUM_VAL 7 #define XFS_ILOCK_RTSUM_VAL 7u
#define XFS_ILOCK_DEP_MASK 0xff000000 #define XFS_ILOCK_DEP_MASK 0xff000000u
#define XFS_ILOCK_PARENT (XFS_ILOCK_PARENT_VAL << XFS_ILOCK_SHIFT) #define XFS_ILOCK_PARENT (XFS_ILOCK_PARENT_VAL << XFS_ILOCK_SHIFT)
#define XFS_ILOCK_RTBITMAP (XFS_ILOCK_RTBITMAP_VAL << XFS_ILOCK_SHIFT) #define XFS_ILOCK_RTBITMAP (XFS_ILOCK_RTBITMAP_VAL << XFS_ILOCK_SHIFT)
#define XFS_ILOCK_RTSUM (XFS_ILOCK_RTSUM_VAL << XFS_ILOCK_SHIFT) #define XFS_ILOCK_RTSUM (XFS_ILOCK_RTSUM_VAL << XFS_ILOCK_SHIFT)

View file

@ -3829,7 +3829,7 @@ xlog_verify_iclog(
bool bool
xlog_force_shutdown( xlog_force_shutdown(
struct xlog *log, struct xlog *log,
int shutdown_flags) uint32_t shutdown_flags)
{ {
bool log_error = (shutdown_flags & SHUTDOWN_LOG_IO_ERROR); bool log_error = (shutdown_flags & SHUTDOWN_LOG_IO_ERROR);

View file

@ -140,7 +140,7 @@ void xfs_log_clean(struct xfs_mount *mp);
bool xfs_log_check_lsn(struct xfs_mount *, xfs_lsn_t); bool xfs_log_check_lsn(struct xfs_mount *, xfs_lsn_t);
xfs_lsn_t xlog_grant_push_threshold(struct xlog *log, int need_bytes); xfs_lsn_t xlog_grant_push_threshold(struct xlog *log, int need_bytes);
bool xlog_force_shutdown(struct xlog *log, int shutdown_flags); bool xlog_force_shutdown(struct xlog *log, uint32_t shutdown_flags);
void xlog_use_incompat_feat(struct xlog *log); void xlog_use_incompat_feat(struct xlog *log);
void xlog_drop_incompat_feat(struct xlog *log); void xlog_drop_incompat_feat(struct xlog *log);

View file

@ -51,8 +51,8 @@ enum xlog_iclog_state {
/* /*
* In core log flags * In core log flags
*/ */
#define XLOG_ICL_NEED_FLUSH (1 << 0) /* iclog needs REQ_PREFLUSH */ #define XLOG_ICL_NEED_FLUSH (1u << 0) /* iclog needs REQ_PREFLUSH */
#define XLOG_ICL_NEED_FUA (1 << 1) /* iclog needs REQ_FUA */ #define XLOG_ICL_NEED_FUA (1u << 1) /* iclog needs REQ_FUA */
#define XLOG_ICL_STRINGS \ #define XLOG_ICL_STRINGS \
{ XLOG_ICL_NEED_FLUSH, "XLOG_ICL_NEED_FLUSH" }, \ { XLOG_ICL_NEED_FLUSH, "XLOG_ICL_NEED_FLUSH" }, \
@ -62,7 +62,7 @@ enum xlog_iclog_state {
/* /*
* Log ticket flags * Log ticket flags
*/ */
#define XLOG_TIC_PERM_RESERV 0x1 /* permanent reservation */ #define XLOG_TIC_PERM_RESERV (1u << 0) /* permanent reservation */
#define XLOG_TIC_FLAGS \ #define XLOG_TIC_FLAGS \
{ XLOG_TIC_PERM_RESERV, "XLOG_TIC_PERM_RESERV" } { XLOG_TIC_PERM_RESERV, "XLOG_TIC_PERM_RESERV" }
@ -165,7 +165,7 @@ typedef struct xlog_ticket {
char t_ocnt; /* original count : 1 */ char t_ocnt; /* original count : 1 */
char t_cnt; /* current count : 1 */ char t_cnt; /* current count : 1 */
char t_clientid; /* who does this belong to; : 1 */ char t_clientid; /* who does this belong to; : 1 */
char t_flags; /* properties of reservation : 1 */ uint8_t t_flags; /* properties of reservation : 1 */
/* reservation array fields */ /* reservation array fields */
uint t_res_num; /* num in array : 4 */ uint t_res_num; /* num in array : 4 */

View file

@ -54,7 +54,7 @@ xfs_printk_level(
void void
_xfs_alert_tag( _xfs_alert_tag(
const struct xfs_mount *mp, const struct xfs_mount *mp,
int panic_tag, uint32_t panic_tag,
const char *fmt, ...) const char *fmt, ...)
{ {
struct va_format vaf; struct va_format vaf;

View file

@ -43,7 +43,8 @@ void xfs_printk_level(const char *kern_level, const struct xfs_mount *mp,
}) })
extern __printf(3, 4) extern __printf(3, 4)
void _xfs_alert_tag(const struct xfs_mount *mp, int tag, const char *fmt, ...); void _xfs_alert_tag(const struct xfs_mount *mp, uint32_t tag,
const char *fmt, ...);
#define xfs_printk_ratelimited(func, dev, fmt, ...) \ #define xfs_printk_ratelimited(func, dev, fmt, ...) \
do { \ do { \

View file

@ -427,16 +427,15 @@ __XFS_IS_OPSTATE(blockgc_enabled, BLOCKGC_ENABLED)
#define XFS_MAX_IO_LOG 30 /* 1G */ #define XFS_MAX_IO_LOG 30 /* 1G */
#define XFS_MIN_IO_LOG PAGE_SHIFT #define XFS_MIN_IO_LOG PAGE_SHIFT
#define xfs_is_shutdown(mp) xfs_is_shutdown(mp) void xfs_do_force_shutdown(struct xfs_mount *mp, uint32_t flags, char *fname,
void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname,
int lnnum); int lnnum);
#define xfs_force_shutdown(m,f) \ #define xfs_force_shutdown(m,f) \
xfs_do_force_shutdown(m, f, __FILE__, __LINE__) xfs_do_force_shutdown(m, f, __FILE__, __LINE__)
#define SHUTDOWN_META_IO_ERROR 0x0001 /* write attempt to metadata failed */ #define SHUTDOWN_META_IO_ERROR (1u << 0) /* write attempt to metadata failed */
#define SHUTDOWN_LOG_IO_ERROR 0x0002 /* write attempt to the log failed */ #define SHUTDOWN_LOG_IO_ERROR (1u << 1) /* write attempt to the log failed */
#define SHUTDOWN_FORCE_UMOUNT 0x0004 /* shutdown from a forced unmount */ #define SHUTDOWN_FORCE_UMOUNT (1u << 2) /* shutdown from a forced unmount */
#define SHUTDOWN_CORRUPT_INCORE 0x0008 /* corrupt in-memory data structures */ #define SHUTDOWN_CORRUPT_INCORE (1u << 3) /* corrupt in-memory structures */
#define XFS_SHUTDOWN_STRINGS \ #define XFS_SHUTDOWN_STRINGS \
{ SHUTDOWN_META_IO_ERROR, "metadata_io" }, \ { SHUTDOWN_META_IO_ERROR, "metadata_io" }, \

View file

@ -1096,22 +1096,6 @@ DEFINE_DQUOT_EVENT(xfs_dqflush_done);
DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_before); DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_before);
DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_after); DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_after);
#define XFS_QMOPT_FLAGS \
{ XFS_QMOPT_UQUOTA, "UQUOTA" }, \
{ XFS_QMOPT_PQUOTA, "PQUOTA" }, \
{ XFS_QMOPT_FORCE_RES, "FORCE_RES" }, \
{ XFS_QMOPT_SBVERSION, "SBVERSION" }, \
{ XFS_QMOPT_GQUOTA, "GQUOTA" }, \
{ XFS_QMOPT_INHERIT, "INHERIT" }, \
{ XFS_QMOPT_RES_REGBLKS, "RES_REGBLKS" }, \
{ XFS_QMOPT_RES_RTBLKS, "RES_RTBLKS" }, \
{ XFS_QMOPT_BCOUNT, "BCOUNT" }, \
{ XFS_QMOPT_ICOUNT, "ICOUNT" }, \
{ XFS_QMOPT_RTBCOUNT, "RTBCOUNT" }, \
{ XFS_QMOPT_DELBCOUNT, "DELBCOUNT" }, \
{ XFS_QMOPT_DELRTBCOUNT, "DELRTBCOUNT" }, \
{ XFS_QMOPT_RES_INOS, "RES_INOS" }
TRACE_EVENT(xfs_trans_mod_dquot, TRACE_EVENT(xfs_trans_mod_dquot,
TP_PROTO(struct xfs_trans *tp, struct xfs_dquot *dqp, TP_PROTO(struct xfs_trans *tp, struct xfs_dquot *dqp,
unsigned int field, int64_t delta), unsigned int field, int64_t delta),
@ -1924,7 +1908,7 @@ DECLARE_EVENT_CLASS(xfs_da_class,
__field(int, namelen) __field(int, namelen)
__field(xfs_dahash_t, hashval) __field(xfs_dahash_t, hashval)
__field(xfs_ino_t, inumber) __field(xfs_ino_t, inumber)
__field(int, op_flags) __field(uint32_t, op_flags)
), ),
TP_fast_assign( TP_fast_assign(
__entry->dev = VFS_I(args->dp)->i_sb->s_dev; __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
@ -1990,7 +1974,7 @@ DECLARE_EVENT_CLASS(xfs_attr_class,
__field(xfs_dahash_t, hashval) __field(xfs_dahash_t, hashval)
__field(unsigned int, attr_filter) __field(unsigned int, attr_filter)
__field(unsigned int, attr_flags) __field(unsigned int, attr_flags)
__field(int, op_flags) __field(uint32_t, op_flags)
), ),
TP_fast_assign( TP_fast_assign(
__entry->dev = VFS_I(args->dp)->i_sb->s_dev; __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
@ -2097,7 +2081,7 @@ DECLARE_EVENT_CLASS(xfs_dir2_space_class,
TP_STRUCT__entry( TP_STRUCT__entry(
__field(dev_t, dev) __field(dev_t, dev)
__field(xfs_ino_t, ino) __field(xfs_ino_t, ino)
__field(int, op_flags) __field(uint32_t, op_flags)
__field(int, idx) __field(int, idx)
), ),
TP_fast_assign( TP_fast_assign(
@ -2128,7 +2112,7 @@ TRACE_EVENT(xfs_dir2_leafn_moveents,
TP_STRUCT__entry( TP_STRUCT__entry(
__field(dev_t, dev) __field(dev_t, dev)
__field(xfs_ino_t, ino) __field(xfs_ino_t, ino)
__field(int, op_flags) __field(uint32_t, op_flags)
__field(int, src_idx) __field(int, src_idx)
__field(int, dst_idx) __field(int, dst_idx)
__field(int, count) __field(int, count)

View file

@ -58,10 +58,10 @@ struct xfs_log_item {
#define XFS_LI_DIRTY 3 /* log item dirty in transaction */ #define XFS_LI_DIRTY 3 /* log item dirty in transaction */
#define XFS_LI_FLAGS \ #define XFS_LI_FLAGS \
{ (1 << XFS_LI_IN_AIL), "IN_AIL" }, \ { (1u << XFS_LI_IN_AIL), "IN_AIL" }, \
{ (1 << XFS_LI_ABORTED), "ABORTED" }, \ { (1u << XFS_LI_ABORTED), "ABORTED" }, \
{ (1 << XFS_LI_FAILED), "FAILED" }, \ { (1u << XFS_LI_FAILED), "FAILED" }, \
{ (1 << XFS_LI_DIRTY), "DIRTY" } { (1u << XFS_LI_DIRTY), "DIRTY" }
struct xfs_item_ops { struct xfs_item_ops {
unsigned flags; unsigned flags;