@@ -6062,7 +6062,7 @@ xfs_bmap_finish_one(
xfs_fileoff_t startoff,
xfs_fsblock_t startblock,
xfs_filblks_t *blockcount,
- xfs_exntst_t state)
+ unsigned state)
{
int error = 0;
@@ -255,7 +255,7 @@ struct xfs_bmap_intent {
int xfs_bmap_finish_one(struct xfs_trans *tp, struct xfs_inode *ip,
enum xfs_bmap_intent_type type, int whichfork,
xfs_fileoff_t startoff, xfs_fsblock_t startblock,
- xfs_filblks_t *blockcount, xfs_exntst_t state);
+ xfs_filblks_t *blockcount, unsigned state);
int xfs_bmap_map_extent(struct xfs_trans *tp, struct xfs_inode *ip,
struct xfs_bmbt_irec *imap);
int xfs_bmap_unmap_extent(struct xfs_trans *tp, struct xfs_inode *ip,
@@ -2165,7 +2165,7 @@ xfs_rmap_finish_one(
xfs_fileoff_t startoff,
xfs_fsblock_t startblock,
xfs_filblks_t blockcount,
- xfs_exntst_t state,
+ unsigned state,
struct xfs_btree_cur **pcur)
{
struct xfs_mount *mp = tp->t_mountp;
@@ -202,7 +202,7 @@ void xfs_rmap_finish_one_cleanup(struct xfs_trans *tp,
int xfs_rmap_finish_one(struct xfs_trans *tp, enum xfs_rmap_intent_type type,
uint64_t owner, int whichfork, xfs_fileoff_t startoff,
xfs_fsblock_t startblock, xfs_filblks_t blockcount,
- xfs_exntst_t state, struct xfs_btree_cur **pcur);
+ unsigned state, struct xfs_btree_cur **pcur);
int xfs_rmap_find_left_neighbor(struct xfs_btree_cur *cur, xfs_agblock_t bno,
uint64_t owner, uint64_t offset, unsigned int flags,
@@ -131,16 +131,15 @@ struct xfs_iext_cursor {
int pos;
};
-typedef enum {
- XFS_EXT_NORM, XFS_EXT_UNWRITTEN,
-} xfs_exntst_t;
+#define XFS_EXT_NORM 0
+#define XFS_EXT_UNWRITTEN 1
typedef struct xfs_bmbt_irec
{
xfs_fileoff_t br_startoff; /* starting file offset */
xfs_fsblock_t br_startblock; /* starting block number */
xfs_filblks_t br_blockcount; /* number of blocks */
- xfs_exntst_t br_state; /* extent state */
+ unsigned br_state; /* extent state */
} xfs_bmbt_irec_t;
/*
@@ -388,7 +388,7 @@ xfs_bui_recover(
struct xfs_bud_log_item *budp;
enum xfs_bmap_intent_type type;
int whichfork;
- xfs_exntst_t state;
+ unsigned state;
struct xfs_trans *tp;
struct xfs_inode *ip = NULL;
struct xfs_bmbt_irec irec;
@@ -412,7 +412,7 @@ xfs_rui_recover(
struct xfs_rud_log_item *rudp;
enum xfs_rmap_intent_type type;
int whichfork;
- xfs_exntst_t state;
+ unsigned state;
struct xfs_trans *tp;
struct xfs_btree_cur *rcur = NULL;
@@ -218,7 +218,7 @@ DECLARE_EVENT_CLASS(xfs_bmap_class,
__field(xfs_fileoff_t, startoff)
__field(xfs_fsblock_t, startblock)
__field(xfs_filblks_t, blockcount)
- __field(xfs_exntst_t, state)
+ __field(unsigned, state)
__field(int, bmap_state)
__field(unsigned long, caller_ip)
),
@@ -240,7 +240,7 @@ DECLARE_EVENT_CLASS(xfs_bmap_class,
__entry->caller_ip = caller_ip;
),
TP_printk("dev %d:%d ino 0x%llx state %s cur %p/%d "
- "offset %lld block %lld count %lld flag %d caller %pS",
+ "offset %lld block %lld count %lld flag %u caller %pS",
MAJOR(__entry->dev), MINOR(__entry->dev),
__entry->ino,
__print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
@@ -2334,7 +2334,7 @@ DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
int whichfork,
xfs_fileoff_t offset,
xfs_filblks_t len,
- xfs_exntst_t state),
+ unsigned state),
TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
TP_STRUCT__entry(
__field(dev_t, dev)
@@ -2344,7 +2344,7 @@ DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
__field(int, whichfork)
__field(xfs_fileoff_t, l_loff)
__field(xfs_filblks_t, l_len)
- __field(xfs_exntst_t, l_state)
+ __field(unsigned, l_state)
__field(int, op)
),
TP_fast_assign(
@@ -2358,7 +2358,7 @@ DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
__entry->l_state = state;
__entry->op = op;
),
- TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d",
+ TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %u",
MAJOR(__entry->dev), MINOR(__entry->dev),
__entry->op,
__entry->agno,
@@ -2378,7 +2378,7 @@ DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
int whichfork, \
xfs_fileoff_t offset, \
xfs_filblks_t len, \
- xfs_exntst_t state), \
+ unsigned state), \
TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
DEFINE_DEFER_EVENT(xfs_defer_cancel);
@@ -255,7 +255,7 @@ int xfs_trans_log_finish_rmap_update(struct xfs_trans *tp,
struct xfs_rud_log_item *rudp, enum xfs_rmap_intent_type type,
uint64_t owner, int whichfork, xfs_fileoff_t startoff,
xfs_fsblock_t startblock, xfs_filblks_t blockcount,
- xfs_exntst_t state, struct xfs_btree_cur **pcur);
+ unsigned state, struct xfs_btree_cur **pcur);
/* refcount updates */
enum xfs_refcount_intent_type;
@@ -279,6 +279,6 @@ int xfs_trans_log_finish_bmap_update(struct xfs_trans *tp,
struct xfs_bud_log_item *rudp, enum xfs_bmap_intent_type type,
struct xfs_inode *ip, int whichfork, xfs_fileoff_t startoff,
xfs_fsblock_t startblock, xfs_filblks_t *blockcount,
- xfs_exntst_t state);
+ unsigned state);
#endif /* __XFS_TRANS_H__ */
@@ -49,7 +49,7 @@ xfs_trans_log_finish_bmap_update(
xfs_fileoff_t startoff,
xfs_fsblock_t startblock,
xfs_filblks_t *blockcount,
- xfs_exntst_t state)
+ unsigned state)
{
int error;
@@ -111,7 +111,7 @@ xfs_trans_set_bmap_flags(
struct xfs_map_extent *bmap,
enum xfs_bmap_intent_type type,
int whichfork,
- xfs_exntst_t state)
+ unsigned state)
{
bmap->me_flags = 0;
switch (type) {
@@ -23,7 +23,7 @@ xfs_trans_set_rmap_flags(
struct xfs_map_extent *rmap,
enum xfs_rmap_intent_type type,
int whichfork,
- xfs_exntst_t state)
+ unsigned state)
{
rmap->me_flags = 0;
if (state == XFS_EXT_UNWRITTEN)
@@ -87,7 +87,7 @@ xfs_trans_log_finish_rmap_update(
xfs_fileoff_t startoff,
xfs_fsblock_t startblock,
xfs_filblks_t blockcount,
- xfs_exntst_t state,
+ unsigned state,
struct xfs_btree_cur **pcur)
{
int error;
__print_symbolic does crazy things and stringifies the tables that are used to map values to strings. Hence if we use enums for the values, it just doesn't work because XFS_UNWRITTEN != 1, it's a string. Convert to macros and remove the xfs_extst_t enum as it's not useful anymore. Signed-off-by: Dave Chinner <dchinner@redhat.com> --- fs/xfs/libxfs/xfs_bmap.c | 2 +- fs/xfs/libxfs/xfs_bmap.h | 2 +- fs/xfs/libxfs/xfs_rmap.c | 2 +- fs/xfs/libxfs/xfs_rmap.h | 2 +- fs/xfs/libxfs/xfs_types.h | 7 +++---- fs/xfs/xfs_bmap_item.c | 2 +- fs/xfs/xfs_rmap_item.c | 2 +- fs/xfs/xfs_trace.h | 12 ++++++------ fs/xfs/xfs_trans.h | 4 ++-- fs/xfs/xfs_trans_bmap.c | 4 ++-- fs/xfs/xfs_trans_rmap.c | 4 ++-- 11 files changed, 21 insertions(+), 22 deletions(-)