From: Eric Sandeen Date: Wed, 24 Jul 2019 21:28:26 +0000 (-0400) Subject: libxfs: don't use enum for buffer flags X-Git-Tag: v5.2.0~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3a3f5b14a49182d345a061eaff198aa22e7444c7;p=thirdparty%2Fxfsprogs-dev.git libxfs: don't use enum for buffer flags This roughly mirrors 807cbbdb xfs: do not use emums for flags used in tracing and lets us use the xfs_buf_flags_t type in function calls as is done in the kernel. Signed-off-by: Eric Sandeen Reviewed-by: Carlos Maiolino Signed-off-by: Eric Sandeen --- diff --git a/include/xfs_trans.h b/include/xfs_trans.h index e0046b51a..bcf931b77 100644 --- a/include/xfs_trans.h +++ b/include/xfs_trans.h @@ -108,12 +108,12 @@ bool libxfs_trans_ordered_buf(xfs_trans_t *, struct xfs_buf *); struct xfs_buf *libxfs_trans_get_buf_map(struct xfs_trans *tp, struct xfs_buftarg *btp, struct xfs_buf_map *map, int nmaps, - uint flags); + xfs_buf_flags_t flags); int libxfs_trans_read_buf_map(struct xfs_mount *mp, struct xfs_trans *tp, struct xfs_buftarg *btp, struct xfs_buf_map *map, int nmaps, - uint flags, struct xfs_buf **bpp, + xfs_buf_flags_t flags, struct xfs_buf **bpp, const struct xfs_buf_ops *ops); static inline struct xfs_buf * libxfs_trans_get_buf( @@ -134,7 +134,7 @@ libxfs_trans_read_buf( struct xfs_buftarg *btp, xfs_daddr_t blkno, int numblks, - uint flags, + xfs_buf_flags_t flags, struct xfs_buf **bpp, const struct xfs_buf_ops *ops) { diff --git a/libxfs/libxfs_io.h b/libxfs/libxfs_io.h index 79ffd4703..173d496d4 100644 --- a/libxfs/libxfs_io.h +++ b/libxfs/libxfs_io.h @@ -81,14 +81,15 @@ typedef struct xfs_buf { bool xfs_verify_magic(struct xfs_buf *bp, __be32 dmagic); bool xfs_verify_magic16(struct xfs_buf *bp, __be16 dmagic); -enum xfs_buf_flags_t { /* b_flags bits */ - LIBXFS_B_EXIT = 0x0001, /* ==LIBXFS_EXIT_ON_FAILURE */ - LIBXFS_B_DIRTY = 0x0002, /* buffer has been modified */ - LIBXFS_B_STALE = 0x0004, /* buffer marked as invalid */ - LIBXFS_B_UPTODATE = 0x0008, /* buffer is sync'd to disk */ - LIBXFS_B_DISCONTIG = 0x0010, /* discontiguous buffer */ - LIBXFS_B_UNCHECKED = 0x0020, /* needs verification */ -}; +/* b_flags bits */ +#define LIBXFS_B_EXIT 0x0001 /* ==LIBXFS_EXIT_ON_FAILURE */ +#define LIBXFS_B_DIRTY 0x0002 /* buffer has been modified */ +#define LIBXFS_B_STALE 0x0004 /* buffer marked as invalid */ +#define LIBXFS_B_UPTODATE 0x0008 /* buffer is sync'd to disk */ +#define LIBXFS_B_DISCONTIG 0x0010 /* discontiguous buffer */ +#define LIBXFS_B_UNCHECKED 0x0020 /* needs verification */ + +typedef unsigned int xfs_buf_flags_t; #define XFS_BUF_DADDR_NULL ((xfs_daddr_t) (-1LL)) diff --git a/libxfs/trans.c b/libxfs/trans.c index f6f7d89ff..caeb9103c 100644 --- a/libxfs/trans.c +++ b/libxfs/trans.c @@ -422,7 +422,7 @@ libxfs_trans_get_buf_map( struct xfs_buftarg *target, struct xfs_buf_map *map, int nmaps, - uint flags) + xfs_buf_flags_t flags) { xfs_buf_t *bp; struct xfs_buf_log_item *bip; @@ -498,7 +498,7 @@ libxfs_trans_read_buf_map( struct xfs_buftarg *target, struct xfs_buf_map *map, int nmaps, - uint flags, + xfs_buf_flags_t flags, struct xfs_buf **bpp, const struct xfs_buf_ops *ops) {