aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/xfs_alloc.c4
-rw-r--r--fs/xfs/xfs_attr_leaf.c6
-rw-r--r--fs/xfs/xfs_bmap.c2
-rw-r--r--fs/xfs/xfs_btree.c8
-rw-r--r--fs/xfs/xfs_buf_item.h92
-rw-r--r--fs/xfs/xfs_da_btree.c12
-rw-r--r--fs/xfs/xfs_dir2_block.c4
-rw-r--r--fs/xfs/xfs_dir2_data.c4
-rw-r--r--fs/xfs/xfs_dir2_leaf.c12
-rw-r--r--fs/xfs/xfs_dir2_node.c10
-rw-r--r--fs/xfs/xfs_ialloc.c2
-rw-r--r--fs/xfs/xfs_log_recover.c38
-rw-r--r--fs/xfs/xfs_trans.h4
-rw-r--r--fs/xfs/xfs_trans_buf.c42
14 files changed, 134 insertions, 106 deletions
diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c
index 40d3d576f473..5673bcfda2f0 100644
--- a/fs/xfs/xfs_alloc.c
+++ b/fs/xfs/xfs_alloc.c
@@ -2099,7 +2099,7 @@ xfs_alloc_log_agf(
2099 2099
2100 trace_xfs_agf(tp->t_mountp, XFS_BUF_TO_AGF(bp), fields, _RET_IP_); 2100 trace_xfs_agf(tp->t_mountp, XFS_BUF_TO_AGF(bp), fields, _RET_IP_);
2101 2101
2102 xfs_trans_buf_set_type(tp, bp, XFS_BLF_AGF_BUF); 2102 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_AGF_BUF);
2103 2103
2104 xfs_btree_offsets(fields, offsets, XFS_AGF_NUM_BITS, &first, &last); 2104 xfs_btree_offsets(fields, offsets, XFS_AGF_NUM_BITS, &first, &last);
2105 xfs_trans_log_buf(tp, bp, (uint)first, (uint)last); 2105 xfs_trans_log_buf(tp, bp, (uint)first, (uint)last);
@@ -2179,7 +2179,7 @@ xfs_alloc_put_freelist(
2179 2179
2180 xfs_alloc_log_agf(tp, agbp, logflags); 2180 xfs_alloc_log_agf(tp, agbp, logflags);
2181 2181
2182 xfs_trans_buf_set_type(tp, agflbp, XFS_BLF_AGFL_BUF); 2182 xfs_trans_buf_set_type(tp, agflbp, XFS_BLFT_AGFL_BUF);
2183 xfs_trans_log_buf(tp, agflbp, startoff, 2183 xfs_trans_log_buf(tp, agflbp, startoff,
2184 startoff + sizeof(xfs_agblock_t) - 1); 2184 startoff + sizeof(xfs_agblock_t) - 1);
2185 return 0; 2185 return 0;
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c
index 92cda03d1c01..08d5457c948e 100644
--- a/fs/xfs/xfs_attr_leaf.c
+++ b/fs/xfs/xfs_attr_leaf.c
@@ -276,7 +276,7 @@ xfs_attr3_leaf_read(
276 err = xfs_da_read_buf(tp, dp, bno, mappedbno, bpp, 276 err = xfs_da_read_buf(tp, dp, bno, mappedbno, bpp,
277 XFS_ATTR_FORK, &xfs_attr3_leaf_buf_ops); 277 XFS_ATTR_FORK, &xfs_attr3_leaf_buf_ops);
278 if (!err && tp) 278 if (!err && tp)
279 xfs_trans_buf_set_type(tp, *bpp, XFS_BLF_ATTR_LEAF_BUF); 279 xfs_trans_buf_set_type(tp, *bpp, XFS_BLFT_ATTR_LEAF_BUF);
280 return err; 280 return err;
281} 281}
282 282
@@ -1083,7 +1083,7 @@ xfs_attr3_leaf_to_node(
1083 goto out; 1083 goto out;
1084 1084
1085 /* copy leaf to new buffer, update identifiers */ 1085 /* copy leaf to new buffer, update identifiers */
1086 xfs_trans_buf_set_type(args->trans, bp2, XFS_BLF_ATTR_LEAF_BUF); 1086 xfs_trans_buf_set_type(args->trans, bp2, XFS_BLFT_ATTR_LEAF_BUF);
1087 bp2->b_ops = bp1->b_ops; 1087 bp2->b_ops = bp1->b_ops;
1088 memcpy(bp2->b_addr, bp1->b_addr, XFS_LBSIZE(mp)); 1088 memcpy(bp2->b_addr, bp1->b_addr, XFS_LBSIZE(mp));
1089 if (xfs_sb_version_hascrc(&mp->m_sb)) { 1089 if (xfs_sb_version_hascrc(&mp->m_sb)) {
@@ -1146,7 +1146,7 @@ xfs_attr3_leaf_create(
1146 if (error) 1146 if (error)
1147 return error; 1147 return error;
1148 bp->b_ops = &xfs_attr3_leaf_buf_ops; 1148 bp->b_ops = &xfs_attr3_leaf_buf_ops;
1149 xfs_trans_buf_set_type(args->trans, bp, XFS_BLF_ATTR_LEAF_BUF); 1149 xfs_trans_buf_set_type(args->trans, bp, XFS_BLFT_ATTR_LEAF_BUF);
1150 leaf = bp->b_addr; 1150 leaf = bp->b_addr;
1151 memset(leaf, 0, XFS_LBSIZE(mp)); 1151 memset(leaf, 0, XFS_LBSIZE(mp));
1152 1152
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 2844724f507e..89042848f9ec 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -1338,7 +1338,7 @@ xfs_bmap_local_to_extents_init_fn(
1338 ASSERT(0); 1338 ASSERT(0);
1339 bp->b_ops = &xfs_bmbt_buf_ops; 1339 bp->b_ops = &xfs_bmbt_buf_ops;
1340 memcpy(bp->b_addr, ifp->if_u1.if_data, ifp->if_bytes); 1340 memcpy(bp->b_addr, ifp->if_u1.if_data, ifp->if_bytes);
1341 xfs_trans_buf_set_type(tp, bp, XFS_BLF_BTREE_BUF); 1341 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_BTREE_BUF);
1342} 1342}
1343 1343
1344/* 1344/*
diff --git a/fs/xfs/xfs_btree.c b/fs/xfs/xfs_btree.c
index ec77036f13b5..8804b8a3c310 100644
--- a/fs/xfs/xfs_btree.c
+++ b/fs/xfs/xfs_btree.c
@@ -1282,7 +1282,7 @@ xfs_btree_log_keys(
1282 XFS_BTREE_TRACE_ARGBII(cur, bp, first, last); 1282 XFS_BTREE_TRACE_ARGBII(cur, bp, first, last);
1283 1283
1284 if (bp) { 1284 if (bp) {
1285 xfs_trans_buf_set_type(cur->bc_tp, bp, XFS_BLF_BTREE_BUF); 1285 xfs_trans_buf_set_type(cur->bc_tp, bp, XFS_BLFT_BTREE_BUF);
1286 xfs_trans_log_buf(cur->bc_tp, bp, 1286 xfs_trans_log_buf(cur->bc_tp, bp,
1287 xfs_btree_key_offset(cur, first), 1287 xfs_btree_key_offset(cur, first),
1288 xfs_btree_key_offset(cur, last + 1) - 1); 1288 xfs_btree_key_offset(cur, last + 1) - 1);
@@ -1307,7 +1307,7 @@ xfs_btree_log_recs(
1307 XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); 1307 XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY);
1308 XFS_BTREE_TRACE_ARGBII(cur, bp, first, last); 1308 XFS_BTREE_TRACE_ARGBII(cur, bp, first, last);
1309 1309
1310 xfs_trans_buf_set_type(cur->bc_tp, bp, XFS_BLF_BTREE_BUF); 1310 xfs_trans_buf_set_type(cur->bc_tp, bp, XFS_BLFT_BTREE_BUF);
1311 xfs_trans_log_buf(cur->bc_tp, bp, 1311 xfs_trans_log_buf(cur->bc_tp, bp,
1312 xfs_btree_rec_offset(cur, first), 1312 xfs_btree_rec_offset(cur, first),
1313 xfs_btree_rec_offset(cur, last + 1) - 1); 1313 xfs_btree_rec_offset(cur, last + 1) - 1);
@@ -1332,7 +1332,7 @@ xfs_btree_log_ptrs(
1332 struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp); 1332 struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp);
1333 int level = xfs_btree_get_level(block); 1333 int level = xfs_btree_get_level(block);
1334 1334
1335 xfs_trans_buf_set_type(cur->bc_tp, bp, XFS_BLF_BTREE_BUF); 1335 xfs_trans_buf_set_type(cur->bc_tp, bp, XFS_BLFT_BTREE_BUF);
1336 xfs_trans_log_buf(cur->bc_tp, bp, 1336 xfs_trans_log_buf(cur->bc_tp, bp,
1337 xfs_btree_ptr_offset(cur, first, level), 1337 xfs_btree_ptr_offset(cur, first, level),
1338 xfs_btree_ptr_offset(cur, last + 1, level) - 1); 1338 xfs_btree_ptr_offset(cur, last + 1, level) - 1);
@@ -1407,7 +1407,7 @@ xfs_btree_log_block(
1407 (cur->bc_flags & XFS_BTREE_LONG_PTRS) ? 1407 (cur->bc_flags & XFS_BTREE_LONG_PTRS) ?
1408 loffsets : soffsets, 1408 loffsets : soffsets,
1409 nbits, &first, &last); 1409 nbits, &first, &last);
1410 xfs_trans_buf_set_type(cur->bc_tp, bp, XFS_BLF_BTREE_BUF); 1410 xfs_trans_buf_set_type(cur->bc_tp, bp, XFS_BLFT_BTREE_BUF);
1411 xfs_trans_log_buf(cur->bc_tp, bp, first, last); 1411 xfs_trans_log_buf(cur->bc_tp, bp, first, last);
1412 } else { 1412 } else {
1413 xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, 1413 xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip,
diff --git a/fs/xfs/xfs_buf_item.h b/fs/xfs/xfs_buf_item.h
index 640adcfa4143..2573d2a75fc8 100644
--- a/fs/xfs/xfs_buf_item.h
+++ b/fs/xfs/xfs_buf_item.h
@@ -39,45 +39,6 @@ extern kmem_zone_t *xfs_buf_item_zone;
39#define XFS_BLF_PDQUOT_BUF (1<<3) 39#define XFS_BLF_PDQUOT_BUF (1<<3)
40#define XFS_BLF_GDQUOT_BUF (1<<4) 40#define XFS_BLF_GDQUOT_BUF (1<<4)
41 41
42/*
43 * all buffers now need flags to tell recovery where the magic number
44 * is so that it can verify and calculate the CRCs on the buffer correctly
45 * once the changes have been replayed into the buffer.
46 */
47#define XFS_BLF_BTREE_BUF (1<<5)
48#define XFS_BLF_AGF_BUF (1<<6)
49#define XFS_BLF_AGFL_BUF (1<<7)
50#define XFS_BLF_AGI_BUF (1<<8)
51#define XFS_BLF_DINO_BUF (1<<9)
52#define XFS_BLF_SYMLINK_BUF (1<<10)
53#define XFS_BLF_DIR_BLOCK_BUF (1<<11)
54#define XFS_BLF_DIR_DATA_BUF (1<<12)
55#define XFS_BLF_DIR_FREE_BUF (1<<13)
56#define XFS_BLF_DIR_LEAF1_BUF (1<<14)
57#define XFS_BLF_DIR_LEAFN_BUF (1<<15)
58#define XFS_BLF_DA_NODE_BUF (1<<16)
59#define XFS_BLF_ATTR_LEAF_BUF (1<<17)
60#define XFS_BLF_ATTR_RMT_BUF (1<<18)
61
62#define XFS_BLF_TYPE_MASK \
63 (XFS_BLF_UDQUOT_BUF | \
64 XFS_BLF_PDQUOT_BUF | \
65 XFS_BLF_GDQUOT_BUF | \
66 XFS_BLF_BTREE_BUF | \
67 XFS_BLF_AGF_BUF | \
68 XFS_BLF_AGFL_BUF | \
69 XFS_BLF_AGI_BUF | \
70 XFS_BLF_DINO_BUF | \
71 XFS_BLF_SYMLINK_BUF | \
72 XFS_BLF_DIR_BLOCK_BUF | \
73 XFS_BLF_DIR_DATA_BUF | \
74 XFS_BLF_DIR_FREE_BUF | \
75 XFS_BLF_DIR_LEAF1_BUF | \
76 XFS_BLF_DIR_LEAFN_BUF | \
77 XFS_BLF_DA_NODE_BUF | \
78 XFS_BLF_ATTR_LEAF_BUF | \
79 XFS_BLF_ATTR_RMT_BUF)
80
81#define XFS_BLF_CHUNK 128 42#define XFS_BLF_CHUNK 128
82#define XFS_BLF_SHIFT 7 43#define XFS_BLF_SHIFT 7
83#define BIT_TO_WORD_SHIFT 5 44#define BIT_TO_WORD_SHIFT 5
@@ -101,6 +62,55 @@ typedef struct xfs_buf_log_format {
101} xfs_buf_log_format_t; 62} xfs_buf_log_format_t;
102 63
103/* 64/*
65 * All buffers now need to tell recovery where the magic number
66 * is so that it can verify and calculate the CRCs on the buffer correctly
67 * once the changes have been replayed into the buffer.
68 *
69 * The type value is held in the upper 5 bits of the blf_flags field, which is
70 * an unsigned 16 bit field. Hence we need to shift it 11 bits up and down.
71 */
72#define XFS_BLFT_BITS 5
73#define XFS_BLFT_SHIFT 11
74#define XFS_BLFT_MASK (((1 << XFS_BLFT_BITS) - 1) << XFS_BLFT_SHIFT)
75
76enum xfs_blft {
77 XFS_BLFT_UNKNOWN_BUF = 0,
78 XFS_BLFT_UDQUOT_BUF,
79 XFS_BLFT_PDQUOT_BUF,
80 XFS_BLFT_GDQUOT_BUF,
81 XFS_BLFT_BTREE_BUF,
82 XFS_BLFT_AGF_BUF,
83 XFS_BLFT_AGFL_BUF,
84 XFS_BLFT_AGI_BUF,
85 XFS_BLFT_DINO_BUF,
86 XFS_BLFT_SYMLINK_BUF,
87 XFS_BLFT_DIR_BLOCK_BUF,
88 XFS_BLFT_DIR_DATA_BUF,
89 XFS_BLFT_DIR_FREE_BUF,
90 XFS_BLFT_DIR_LEAF1_BUF,
91 XFS_BLFT_DIR_LEAFN_BUF,
92 XFS_BLFT_DA_NODE_BUF,
93 XFS_BLFT_ATTR_LEAF_BUF,
94 XFS_BLFT_ATTR_RMT_BUF,
95 XFS_BLFT_SB_BUF,
96 XFS_BLFT_MAX_BUF = (1 << XFS_BLFT_BITS),
97};
98
99static inline void
100xfs_blft_to_flags(struct xfs_buf_log_format *blf, enum xfs_blft type)
101{
102 ASSERT(type > XFS_BLFT_UNKNOWN_BUF && type < XFS_BLFT_MAX_BUF);
103 blf->blf_flags &= ~XFS_BLFT_MASK;
104 blf->blf_flags |= ((type << XFS_BLFT_SHIFT) & XFS_BLFT_MASK);
105}
106
107static inline __uint16_t
108xfs_blft_from_flags(struct xfs_buf_log_format *blf)
109{
110 return (blf->blf_flags & XFS_BLFT_MASK) >> XFS_BLFT_SHIFT;
111}
112
113/*
104 * buf log item flags 114 * buf log item flags
105 */ 115 */
106#define XFS_BLI_HOLD 0x01 116#define XFS_BLI_HOLD 0x01
@@ -153,6 +163,10 @@ void xfs_buf_attach_iodone(struct xfs_buf *,
153void xfs_buf_iodone_callbacks(struct xfs_buf *); 163void xfs_buf_iodone_callbacks(struct xfs_buf *);
154void xfs_buf_iodone(struct xfs_buf *, struct xfs_log_item *); 164void xfs_buf_iodone(struct xfs_buf *, struct xfs_log_item *);
155 165
166void xfs_trans_buf_set_type(struct xfs_trans *, struct xfs_buf *,
167 enum xfs_blft);
168void xfs_trans_buf_copy_type(struct xfs_buf *dst_bp, struct xfs_buf *src_bp);
169
156#endif /* __KERNEL__ */ 170#endif /* __KERNEL__ */
157 171
158#endif /* __XFS_BUF_ITEM_H__ */ 172#endif /* __XFS_BUF_ITEM_H__ */
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c
index 5aebd9bd44d1..56814e305dea 100644
--- a/fs/xfs/xfs_da_btree.c
+++ b/fs/xfs/xfs_da_btree.c
@@ -312,15 +312,15 @@ xfs_da3_node_read(
312 switch (be16_to_cpu(info->magic)) { 312 switch (be16_to_cpu(info->magic)) {
313 case XFS_DA3_NODE_MAGIC: 313 case XFS_DA3_NODE_MAGIC:
314 case XFS_DA_NODE_MAGIC: 314 case XFS_DA_NODE_MAGIC:
315 type = XFS_BLF_DA_NODE_BUF; 315 type = XFS_BLFT_DA_NODE_BUF;
316 break; 316 break;
317 case XFS_ATTR_LEAF_MAGIC: 317 case XFS_ATTR_LEAF_MAGIC:
318 case XFS_ATTR3_LEAF_MAGIC: 318 case XFS_ATTR3_LEAF_MAGIC:
319 type = XFS_BLF_ATTR_LEAF_BUF; 319 type = XFS_BLFT_ATTR_LEAF_BUF;
320 break; 320 break;
321 case XFS_DIR2_LEAFN_MAGIC: 321 case XFS_DIR2_LEAFN_MAGIC:
322 case XFS_DIR3_LEAFN_MAGIC: 322 case XFS_DIR3_LEAFN_MAGIC:
323 type = XFS_BLF_DIR_LEAFN_BUF; 323 type = XFS_BLFT_DIR_LEAFN_BUF;
324 break; 324 break;
325 default: 325 default:
326 type = 0; 326 type = 0;
@@ -361,7 +361,7 @@ xfs_da3_node_create(
361 if (error) 361 if (error)
362 return(error); 362 return(error);
363 bp->b_ops = &xfs_da3_node_buf_ops; 363 bp->b_ops = &xfs_da3_node_buf_ops;
364 xfs_trans_buf_set_type(tp, bp, XFS_BLF_DA_NODE_BUF); 364 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DA_NODE_BUF);
365 node = bp->b_addr; 365 node = bp->b_addr;
366 366
367 if (xfs_sb_version_hascrc(&mp->m_sb)) { 367 if (xfs_sb_version_hascrc(&mp->m_sb)) {
@@ -597,7 +597,7 @@ xfs_da3_root_split(
597 * we are about to copy oldroot to bp, so set up the type 597 * we are about to copy oldroot to bp, so set up the type
598 * of bp while we know exactly what it will be. 598 * of bp while we know exactly what it will be.
599 */ 599 */
600 xfs_trans_buf_set_type(tp, bp, XFS_BLF_DA_NODE_BUF); 600 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DA_NODE_BUF);
601 } else { 601 } else {
602 struct xfs_dir3_icleaf_hdr leafhdr; 602 struct xfs_dir3_icleaf_hdr leafhdr;
603 struct xfs_dir2_leaf_entry *ents; 603 struct xfs_dir2_leaf_entry *ents;
@@ -615,7 +615,7 @@ xfs_da3_root_split(
615 * we are about to copy oldroot to bp, so set up the type 615 * we are about to copy oldroot to bp, so set up the type
616 * of bp while we know exactly what it will be. 616 * of bp while we know exactly what it will be.
617 */ 617 */
618 xfs_trans_buf_set_type(tp, bp, XFS_BLF_DIR_LEAFN_BUF); 618 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DIR_LEAFN_BUF);
619 } 619 }
620 620
621 /* 621 /*
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c
index 58816ecdbba5..e59f5fc816fe 100644
--- a/fs/xfs/xfs_dir2_block.c
+++ b/fs/xfs/xfs_dir2_block.c
@@ -137,7 +137,7 @@ xfs_dir3_block_read(
137 err = xfs_da_read_buf(tp, dp, mp->m_dirdatablk, -1, bpp, 137 err = xfs_da_read_buf(tp, dp, mp->m_dirdatablk, -1, bpp,
138 XFS_DATA_FORK, &xfs_dir3_block_buf_ops); 138 XFS_DATA_FORK, &xfs_dir3_block_buf_ops);
139 if (!err && tp) 139 if (!err && tp)
140 xfs_trans_buf_set_type(tp, *bpp, XFS_BLF_DIR_BLOCK_BUF); 140 xfs_trans_buf_set_type(tp, *bpp, XFS_BLFT_DIR_BLOCK_BUF);
141 return err; 141 return err;
142} 142}
143 143
@@ -151,7 +151,7 @@ xfs_dir3_block_init(
151 struct xfs_dir3_blk_hdr *hdr3 = bp->b_addr; 151 struct xfs_dir3_blk_hdr *hdr3 = bp->b_addr;
152 152
153 bp->b_ops = &xfs_dir3_block_buf_ops; 153 bp->b_ops = &xfs_dir3_block_buf_ops;
154 xfs_trans_buf_set_type(tp, bp, XFS_BLF_DIR_BLOCK_BUF); 154 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DIR_BLOCK_BUF);
155 155
156 if (xfs_sb_version_hascrc(&mp->m_sb)) { 156 if (xfs_sb_version_hascrc(&mp->m_sb)) {
157 memset(hdr3, 0, sizeof(*hdr3)); 157 memset(hdr3, 0, sizeof(*hdr3));
diff --git a/fs/xfs/xfs_dir2_data.c b/fs/xfs/xfs_dir2_data.c
index 5e0c711f9af3..c2930238005c 100644
--- a/fs/xfs/xfs_dir2_data.c
+++ b/fs/xfs/xfs_dir2_data.c
@@ -306,7 +306,7 @@ xfs_dir3_data_read(
306 err = xfs_da_read_buf(tp, dp, bno, mapped_bno, bpp, 306 err = xfs_da_read_buf(tp, dp, bno, mapped_bno, bpp,
307 XFS_DATA_FORK, &xfs_dir3_data_buf_ops); 307 XFS_DATA_FORK, &xfs_dir3_data_buf_ops);
308 if (!err && tp) 308 if (!err && tp)
309 xfs_trans_buf_set_type(tp, *bpp, XFS_BLF_DIR_DATA_BUF); 309 xfs_trans_buf_set_type(tp, *bpp, XFS_BLFT_DIR_DATA_BUF);
310 return err; 310 return err;
311} 311}
312 312
@@ -576,7 +576,7 @@ xfs_dir3_data_init(
576 if (error) 576 if (error)
577 return error; 577 return error;
578 bp->b_ops = &xfs_dir3_data_buf_ops; 578 bp->b_ops = &xfs_dir3_data_buf_ops;
579 xfs_trans_buf_set_type(tp, bp, XFS_BLF_DIR_DATA_BUF); 579 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DIR_DATA_BUF);
580 580
581 /* 581 /*
582 * Initialize the header. 582 * Initialize the header.
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c
index 84f4c9cfe95a..721ba2fe8e54 100644
--- a/fs/xfs/xfs_dir2_leaf.c
+++ b/fs/xfs/xfs_dir2_leaf.c
@@ -302,7 +302,7 @@ xfs_dir3_leaf_read(
302 err = xfs_da_read_buf(tp, dp, fbno, mappedbno, bpp, 302 err = xfs_da_read_buf(tp, dp, fbno, mappedbno, bpp,
303 XFS_DATA_FORK, &xfs_dir3_leaf1_buf_ops); 303 XFS_DATA_FORK, &xfs_dir3_leaf1_buf_ops);
304 if (!err && tp) 304 if (!err && tp)
305 xfs_trans_buf_set_type(tp, *bpp, XFS_BLF_DIR_LEAF1_BUF); 305 xfs_trans_buf_set_type(tp, *bpp, XFS_BLFT_DIR_LEAF1_BUF);
306 return err; 306 return err;
307} 307}
308 308
@@ -319,7 +319,7 @@ xfs_dir3_leafn_read(
319 err = xfs_da_read_buf(tp, dp, fbno, mappedbno, bpp, 319 err = xfs_da_read_buf(tp, dp, fbno, mappedbno, bpp,
320 XFS_DATA_FORK, &xfs_dir3_leafn_buf_ops); 320 XFS_DATA_FORK, &xfs_dir3_leafn_buf_ops);
321 if (!err && tp) 321 if (!err && tp)
322 xfs_trans_buf_set_type(tp, *bpp, XFS_BLF_DIR_LEAFN_BUF); 322 xfs_trans_buf_set_type(tp, *bpp, XFS_BLFT_DIR_LEAFN_BUF);
323 return err; 323 return err;
324} 324}
325 325
@@ -364,10 +364,10 @@ xfs_dir3_leaf_init(
364 ltp = xfs_dir2_leaf_tail_p(mp, leaf); 364 ltp = xfs_dir2_leaf_tail_p(mp, leaf);
365 ltp->bestcount = 0; 365 ltp->bestcount = 0;
366 bp->b_ops = &xfs_dir3_leaf1_buf_ops; 366 bp->b_ops = &xfs_dir3_leaf1_buf_ops;
367 xfs_trans_buf_set_type(tp, bp, XFS_BLF_DIR_LEAF1_BUF); 367 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DIR_LEAF1_BUF);
368 } else { 368 } else {
369 bp->b_ops = &xfs_dir3_leafn_buf_ops; 369 bp->b_ops = &xfs_dir3_leafn_buf_ops;
370 xfs_trans_buf_set_type(tp, bp, XFS_BLF_DIR_LEAFN_BUF); 370 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DIR_LEAFN_BUF);
371 } 371 }
372} 372}
373 373
@@ -488,7 +488,7 @@ xfs_dir2_block_to_leaf(
488 * Fix up the block header, make it a data block. 488 * Fix up the block header, make it a data block.
489 */ 489 */
490 dbp->b_ops = &xfs_dir3_data_buf_ops; 490 dbp->b_ops = &xfs_dir3_data_buf_ops;
491 xfs_trans_buf_set_type(tp, dbp, XFS_BLF_DIR_DATA_BUF); 491 xfs_trans_buf_set_type(tp, dbp, XFS_BLFT_DIR_DATA_BUF);
492 if (hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC)) 492 if (hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC))
493 hdr->magic = cpu_to_be32(XFS_DIR2_DATA_MAGIC); 493 hdr->magic = cpu_to_be32(XFS_DIR2_DATA_MAGIC);
494 else 494 else
@@ -2197,7 +2197,7 @@ xfs_dir2_node_to_leaf(
2197 xfs_dir3_leaf_compact(args, &leafhdr, lbp); 2197 xfs_dir3_leaf_compact(args, &leafhdr, lbp);
2198 2198
2199 lbp->b_ops = &xfs_dir3_leaf1_buf_ops; 2199 lbp->b_ops = &xfs_dir3_leaf1_buf_ops;
2200 xfs_trans_buf_set_type(tp, lbp, XFS_BLF_DIR_LEAF1_BUF); 2200 xfs_trans_buf_set_type(tp, lbp, XFS_BLFT_DIR_LEAF1_BUF);
2201 leafhdr.magic = (leafhdr.magic == XFS_DIR2_LEAFN_MAGIC) 2201 leafhdr.magic = (leafhdr.magic == XFS_DIR2_LEAFN_MAGIC)
2202 ? XFS_DIR2_LEAF1_MAGIC 2202 ? XFS_DIR2_LEAF1_MAGIC
2203 : XFS_DIR3_LEAF1_MAGIC; 2203 : XFS_DIR3_LEAF1_MAGIC;
diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c
index 1806a22d5593..ecc6c661064c 100644
--- a/fs/xfs/xfs_dir2_node.c
+++ b/fs/xfs/xfs_dir2_node.c
@@ -168,7 +168,7 @@ __xfs_dir3_free_read(
168 168
169 /* try read returns without an error or *bpp if it lands in a hole */ 169 /* try read returns without an error or *bpp if it lands in a hole */
170 if (!err && tp && *bpp) 170 if (!err && tp && *bpp)
171 xfs_trans_buf_set_type(tp, *bpp, XFS_BLF_DIR_FREE_BUF); 171 xfs_trans_buf_set_type(tp, *bpp, XFS_BLFT_DIR_FREE_BUF);
172 return err; 172 return err;
173} 173}
174 174
@@ -256,7 +256,7 @@ xfs_dir3_free_get_buf(
256 if (error) 256 if (error)
257 return error; 257 return error;
258 258
259 xfs_trans_buf_set_type(tp, bp, XFS_BLF_DIR_FREE_BUF); 259 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DIR_FREE_BUF);
260 bp->b_ops = &xfs_dir3_free_buf_ops; 260 bp->b_ops = &xfs_dir3_free_buf_ops;
261 261
262 /* 262 /*
@@ -404,7 +404,7 @@ xfs_dir2_leaf_to_node(
404 else 404 else
405 leaf->hdr.info.magic = cpu_to_be16(XFS_DIR3_LEAFN_MAGIC); 405 leaf->hdr.info.magic = cpu_to_be16(XFS_DIR3_LEAFN_MAGIC);
406 lbp->b_ops = &xfs_dir3_leafn_buf_ops; 406 lbp->b_ops = &xfs_dir3_leafn_buf_ops;
407 xfs_trans_buf_set_type(tp, lbp, XFS_BLF_DIR_LEAFN_BUF); 407 xfs_trans_buf_set_type(tp, lbp, XFS_BLFT_DIR_LEAFN_BUF);
408 xfs_dir3_leaf_log_header(tp, lbp); 408 xfs_dir3_leaf_log_header(tp, lbp);
409 xfs_dir3_leaf_check(mp, lbp); 409 xfs_dir3_leaf_check(mp, lbp);
410 return 0; 410 return 0;
@@ -820,7 +820,7 @@ xfs_dir2_leafn_lookup_for_entry(
820 (char *)curbp->b_addr); 820 (char *)curbp->b_addr);
821 state->extrablk.magic = XFS_DIR2_DATA_MAGIC; 821 state->extrablk.magic = XFS_DIR2_DATA_MAGIC;
822 curbp->b_ops = &xfs_dir3_data_buf_ops; 822 curbp->b_ops = &xfs_dir3_data_buf_ops;
823 xfs_trans_buf_set_type(tp, curbp, XFS_BLF_DIR_DATA_BUF); 823 xfs_trans_buf_set_type(tp, curbp, XFS_BLFT_DIR_DATA_BUF);
824 if (cmp == XFS_CMP_EXACT) 824 if (cmp == XFS_CMP_EXACT)
825 return XFS_ERROR(EEXIST); 825 return XFS_ERROR(EEXIST);
826 } 826 }
@@ -835,7 +835,7 @@ xfs_dir2_leafn_lookup_for_entry(
835 state->extrablk.blkno = curdb; 835 state->extrablk.blkno = curdb;
836 state->extrablk.magic = XFS_DIR2_DATA_MAGIC; 836 state->extrablk.magic = XFS_DIR2_DATA_MAGIC;
837 curbp->b_ops = &xfs_dir3_data_buf_ops; 837 curbp->b_ops = &xfs_dir3_data_buf_ops;
838 xfs_trans_buf_set_type(tp, curbp, XFS_BLF_DIR_DATA_BUF); 838 xfs_trans_buf_set_type(tp, curbp, XFS_BLFT_DIR_DATA_BUF);
839 } else { 839 } else {
840 /* If the curbp is not the CI match block, drop it */ 840 /* If the curbp is not the CI match block, drop it */
841 if (state->extrablk.bp != curbp) 841 if (state->extrablk.bp != curbp)
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c
index 3039f829c96a..c8f5ae1debf2 100644
--- a/fs/xfs/xfs_ialloc.c
+++ b/fs/xfs/xfs_ialloc.c
@@ -1487,7 +1487,7 @@ xfs_ialloc_log_agi(
1487 /* 1487 /*
1488 * Log the allocation group inode header buffer. 1488 * Log the allocation group inode header buffer.
1489 */ 1489 */
1490 xfs_trans_buf_set_type(tp, bp, XFS_BLF_AGI_BUF); 1490 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_AGI_BUF);
1491 xfs_trans_log_buf(tp, bp, first, last); 1491 xfs_trans_log_buf(tp, bp, first, last);
1492} 1492}
1493 1493
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 00727bc4a9b0..86285071700b 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -1888,8 +1888,8 @@ xlog_recovery_validate_buf_type(
1888 magic32 = be32_to_cpu(*(__be32 *)bp->b_addr); 1888 magic32 = be32_to_cpu(*(__be32 *)bp->b_addr);
1889 magic16 = be16_to_cpu(*(__be16*)bp->b_addr); 1889 magic16 = be16_to_cpu(*(__be16*)bp->b_addr);
1890 magicda = be16_to_cpu(info->magic); 1890 magicda = be16_to_cpu(info->magic);
1891 switch (buf_f->blf_flags & XFS_BLF_TYPE_MASK) { 1891 switch (xfs_blft_from_flags(buf_f)) {
1892 case XFS_BLF_BTREE_BUF: 1892 case XFS_BLFT_BTREE_BUF:
1893 switch (magic32) { 1893 switch (magic32) {
1894 case XFS_ABTB_CRC_MAGIC: 1894 case XFS_ABTB_CRC_MAGIC:
1895 case XFS_ABTC_CRC_MAGIC: 1895 case XFS_ABTC_CRC_MAGIC:
@@ -1911,7 +1911,7 @@ xlog_recovery_validate_buf_type(
1911 break; 1911 break;
1912 } 1912 }
1913 break; 1913 break;
1914 case XFS_BLF_AGF_BUF: 1914 case XFS_BLFT_AGF_BUF:
1915 if (magic32 != XFS_AGF_MAGIC) { 1915 if (magic32 != XFS_AGF_MAGIC) {
1916 xfs_warn(mp, "Bad AGF block magic!"); 1916 xfs_warn(mp, "Bad AGF block magic!");
1917 ASSERT(0); 1917 ASSERT(0);
@@ -1919,7 +1919,7 @@ xlog_recovery_validate_buf_type(
1919 } 1919 }
1920 bp->b_ops = &xfs_agf_buf_ops; 1920 bp->b_ops = &xfs_agf_buf_ops;
1921 break; 1921 break;
1922 case XFS_BLF_AGFL_BUF: 1922 case XFS_BLFT_AGFL_BUF:
1923 if (!xfs_sb_version_hascrc(&mp->m_sb)) 1923 if (!xfs_sb_version_hascrc(&mp->m_sb))
1924 break; 1924 break;
1925 if (magic32 != XFS_AGFL_MAGIC) { 1925 if (magic32 != XFS_AGFL_MAGIC) {
@@ -1929,7 +1929,7 @@ xlog_recovery_validate_buf_type(
1929 } 1929 }
1930 bp->b_ops = &xfs_agfl_buf_ops; 1930 bp->b_ops = &xfs_agfl_buf_ops;
1931 break; 1931 break;
1932 case XFS_BLF_AGI_BUF: 1932 case XFS_BLFT_AGI_BUF:
1933 if (magic32 != XFS_AGI_MAGIC) { 1933 if (magic32 != XFS_AGI_MAGIC) {
1934 xfs_warn(mp, "Bad AGI block magic!"); 1934 xfs_warn(mp, "Bad AGI block magic!");
1935 ASSERT(0); 1935 ASSERT(0);
@@ -1937,9 +1937,9 @@ xlog_recovery_validate_buf_type(
1937 } 1937 }
1938 bp->b_ops = &xfs_agi_buf_ops; 1938 bp->b_ops = &xfs_agi_buf_ops;
1939 break; 1939 break;
1940 case XFS_BLF_UDQUOT_BUF: 1940 case XFS_BLFT_UDQUOT_BUF:
1941 case XFS_BLF_PDQUOT_BUF: 1941 case XFS_BLFT_PDQUOT_BUF:
1942 case XFS_BLF_GDQUOT_BUF: 1942 case XFS_BLFT_GDQUOT_BUF:
1943 if (magic16 != XFS_DQUOT_MAGIC) { 1943 if (magic16 != XFS_DQUOT_MAGIC) {
1944 xfs_warn(mp, "Bad DQUOT block magic!"); 1944 xfs_warn(mp, "Bad DQUOT block magic!");
1945 ASSERT(0); 1945 ASSERT(0);
@@ -1947,7 +1947,7 @@ xlog_recovery_validate_buf_type(
1947 } 1947 }
1948 bp->b_ops = &xfs_dquot_buf_ops; 1948 bp->b_ops = &xfs_dquot_buf_ops;
1949 break; 1949 break;
1950 case XFS_BLF_DINO_BUF: 1950 case XFS_BLFT_DINO_BUF:
1951 /* 1951 /*
1952 * we get here with inode allocation buffers, not buffers that 1952 * we get here with inode allocation buffers, not buffers that
1953 * track unlinked list changes. 1953 * track unlinked list changes.
@@ -1959,7 +1959,7 @@ xlog_recovery_validate_buf_type(
1959 } 1959 }
1960 bp->b_ops = &xfs_inode_buf_ops; 1960 bp->b_ops = &xfs_inode_buf_ops;
1961 break; 1961 break;
1962 case XFS_BLF_SYMLINK_BUF: 1962 case XFS_BLFT_SYMLINK_BUF:
1963 if (magic32 != XFS_SYMLINK_MAGIC) { 1963 if (magic32 != XFS_SYMLINK_MAGIC) {
1964 xfs_warn(mp, "Bad symlink block magic!"); 1964 xfs_warn(mp, "Bad symlink block magic!");
1965 ASSERT(0); 1965 ASSERT(0);
@@ -1967,7 +1967,7 @@ xlog_recovery_validate_buf_type(
1967 } 1967 }
1968 bp->b_ops = &xfs_symlink_buf_ops; 1968 bp->b_ops = &xfs_symlink_buf_ops;
1969 break; 1969 break;
1970 case XFS_BLF_DIR_BLOCK_BUF: 1970 case XFS_BLFT_DIR_BLOCK_BUF:
1971 if (magic32 != XFS_DIR2_BLOCK_MAGIC && 1971 if (magic32 != XFS_DIR2_BLOCK_MAGIC &&
1972 magic32 != XFS_DIR3_BLOCK_MAGIC) { 1972 magic32 != XFS_DIR3_BLOCK_MAGIC) {
1973 xfs_warn(mp, "Bad dir block magic!"); 1973 xfs_warn(mp, "Bad dir block magic!");
@@ -1976,7 +1976,7 @@ xlog_recovery_validate_buf_type(
1976 } 1976 }
1977 bp->b_ops = &xfs_dir3_block_buf_ops; 1977 bp->b_ops = &xfs_dir3_block_buf_ops;
1978 break; 1978 break;
1979 case XFS_BLF_DIR_DATA_BUF: 1979 case XFS_BLFT_DIR_DATA_BUF:
1980 if (magic32 != XFS_DIR2_DATA_MAGIC && 1980 if (magic32 != XFS_DIR2_DATA_MAGIC &&
1981 magic32 != XFS_DIR3_DATA_MAGIC) { 1981 magic32 != XFS_DIR3_DATA_MAGIC) {
1982 xfs_warn(mp, "Bad dir data magic!"); 1982 xfs_warn(mp, "Bad dir data magic!");
@@ -1985,7 +1985,7 @@ xlog_recovery_validate_buf_type(
1985 } 1985 }
1986 bp->b_ops = &xfs_dir3_data_buf_ops; 1986 bp->b_ops = &xfs_dir3_data_buf_ops;
1987 break; 1987 break;
1988 case XFS_BLF_DIR_FREE_BUF: 1988 case XFS_BLFT_DIR_FREE_BUF:
1989 if (magic32 != XFS_DIR2_FREE_MAGIC && 1989 if (magic32 != XFS_DIR2_FREE_MAGIC &&
1990 magic32 != XFS_DIR3_FREE_MAGIC) { 1990 magic32 != XFS_DIR3_FREE_MAGIC) {
1991 xfs_warn(mp, "Bad dir3 free magic!"); 1991 xfs_warn(mp, "Bad dir3 free magic!");
@@ -1994,7 +1994,7 @@ xlog_recovery_validate_buf_type(
1994 } 1994 }
1995 bp->b_ops = &xfs_dir3_free_buf_ops; 1995 bp->b_ops = &xfs_dir3_free_buf_ops;
1996 break; 1996 break;
1997 case XFS_BLF_DIR_LEAF1_BUF: 1997 case XFS_BLFT_DIR_LEAF1_BUF:
1998 if (magicda != XFS_DIR2_LEAF1_MAGIC && 1998 if (magicda != XFS_DIR2_LEAF1_MAGIC &&
1999 magicda != XFS_DIR3_LEAF1_MAGIC) { 1999 magicda != XFS_DIR3_LEAF1_MAGIC) {
2000 xfs_warn(mp, "Bad dir leaf1 magic!"); 2000 xfs_warn(mp, "Bad dir leaf1 magic!");
@@ -2003,7 +2003,7 @@ xlog_recovery_validate_buf_type(
2003 } 2003 }
2004 bp->b_ops = &xfs_dir3_leaf1_buf_ops; 2004 bp->b_ops = &xfs_dir3_leaf1_buf_ops;
2005 break; 2005 break;
2006 case XFS_BLF_DIR_LEAFN_BUF: 2006 case XFS_BLFT_DIR_LEAFN_BUF:
2007 if (magicda != XFS_DIR2_LEAFN_MAGIC && 2007 if (magicda != XFS_DIR2_LEAFN_MAGIC &&
2008 magicda != XFS_DIR3_LEAFN_MAGIC) { 2008 magicda != XFS_DIR3_LEAFN_MAGIC) {
2009 xfs_warn(mp, "Bad dir leafn magic!"); 2009 xfs_warn(mp, "Bad dir leafn magic!");
@@ -2012,7 +2012,7 @@ xlog_recovery_validate_buf_type(
2012 } 2012 }
2013 bp->b_ops = &xfs_dir3_leafn_buf_ops; 2013 bp->b_ops = &xfs_dir3_leafn_buf_ops;
2014 break; 2014 break;
2015 case XFS_BLF_DA_NODE_BUF: 2015 case XFS_BLFT_DA_NODE_BUF:
2016 if (magicda != XFS_DA_NODE_MAGIC && 2016 if (magicda != XFS_DA_NODE_MAGIC &&
2017 magicda != XFS_DA3_NODE_MAGIC) { 2017 magicda != XFS_DA3_NODE_MAGIC) {
2018 xfs_warn(mp, "Bad da node magic!"); 2018 xfs_warn(mp, "Bad da node magic!");
@@ -2021,7 +2021,7 @@ xlog_recovery_validate_buf_type(
2021 } 2021 }
2022 bp->b_ops = &xfs_da3_node_buf_ops; 2022 bp->b_ops = &xfs_da3_node_buf_ops;
2023 break; 2023 break;
2024 case XFS_BLF_ATTR_LEAF_BUF: 2024 case XFS_BLFT_ATTR_LEAF_BUF:
2025 if (magicda != XFS_ATTR_LEAF_MAGIC && 2025 if (magicda != XFS_ATTR_LEAF_MAGIC &&
2026 magicda != XFS_ATTR3_LEAF_MAGIC) { 2026 magicda != XFS_ATTR3_LEAF_MAGIC) {
2027 xfs_warn(mp, "Bad attr leaf magic!"); 2027 xfs_warn(mp, "Bad attr leaf magic!");
@@ -2030,7 +2030,7 @@ xlog_recovery_validate_buf_type(
2030 } 2030 }
2031 bp->b_ops = &xfs_attr3_leaf_buf_ops; 2031 bp->b_ops = &xfs_attr3_leaf_buf_ops;
2032 break; 2032 break;
2033 case XFS_BLF_ATTR_RMT_BUF: 2033 case XFS_BLFT_ATTR_RMT_BUF:
2034 if (!xfs_sb_version_hascrc(&mp->m_sb)) 2034 if (!xfs_sb_version_hascrc(&mp->m_sb))
2035 break; 2035 break;
2036 if (magicda != XFS_ATTR3_RMT_MAGIC) { 2036 if (magicda != XFS_ATTR3_RMT_MAGIC) {
@@ -2041,6 +2041,8 @@ xlog_recovery_validate_buf_type(
2041 bp->b_ops = &xfs_attr3_rmt_buf_ops; 2041 bp->b_ops = &xfs_attr3_rmt_buf_ops;
2042 break; 2042 break;
2043 default: 2043 default:
2044 xfs_warn(mp, "Unknown buffer type %d!",
2045 xfs_blft_from_flags(buf_f));
2044 break; 2046 break;
2045 } 2047 }
2046} 2048}
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h
index fa78a3f87c6e..cd29f6171021 100644
--- a/fs/xfs/xfs_trans.h
+++ b/fs/xfs/xfs_trans.h
@@ -505,10 +505,6 @@ void xfs_trans_inode_buf(xfs_trans_t *, struct xfs_buf *);
505void xfs_trans_stale_inode_buf(xfs_trans_t *, struct xfs_buf *); 505void xfs_trans_stale_inode_buf(xfs_trans_t *, struct xfs_buf *);
506void xfs_trans_dquot_buf(xfs_trans_t *, struct xfs_buf *, uint); 506void xfs_trans_dquot_buf(xfs_trans_t *, struct xfs_buf *, uint);
507void xfs_trans_inode_alloc_buf(xfs_trans_t *, struct xfs_buf *); 507void xfs_trans_inode_alloc_buf(xfs_trans_t *, struct xfs_buf *);
508void xfs_trans_buf_set_type(struct xfs_trans *, struct xfs_buf *,
509 uint);
510void xfs_trans_buf_copy_type(struct xfs_buf *dst_bp,
511 struct xfs_buf *src_bp);
512void xfs_trans_ichgtime(struct xfs_trans *, struct xfs_inode *, int); 508void xfs_trans_ichgtime(struct xfs_trans *, struct xfs_inode *, int);
513void xfs_trans_ijoin(struct xfs_trans *, struct xfs_inode *, uint); 509void xfs_trans_ijoin(struct xfs_trans *, struct xfs_inode *, uint);
514void xfs_trans_log_buf(xfs_trans_t *, struct xfs_buf *, uint, uint); 510void xfs_trans_log_buf(xfs_trans_t *, struct xfs_buf *, uint, uint);
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c
index 40871bf607f0..73a5fa457e16 100644
--- a/fs/xfs/xfs_trans_buf.c
+++ b/fs/xfs/xfs_trans_buf.c
@@ -659,7 +659,7 @@ xfs_trans_binval(
659 ASSERT(XFS_BUF_ISSTALE(bp)); 659 ASSERT(XFS_BUF_ISSTALE(bp));
660 ASSERT(!(bip->bli_flags & (XFS_BLI_LOGGED | XFS_BLI_DIRTY))); 660 ASSERT(!(bip->bli_flags & (XFS_BLI_LOGGED | XFS_BLI_DIRTY)));
661 ASSERT(!(bip->__bli_format.blf_flags & XFS_BLF_INODE_BUF)); 661 ASSERT(!(bip->__bli_format.blf_flags & XFS_BLF_INODE_BUF));
662 ASSERT(!(bip->__bli_format.blf_flags & XFS_BLF_TYPE_MASK)); 662 ASSERT(!(bip->__bli_format.blf_flags & XFS_BLFT_MASK));
663 ASSERT(bip->__bli_format.blf_flags & XFS_BLF_CANCEL); 663 ASSERT(bip->__bli_format.blf_flags & XFS_BLF_CANCEL);
664 ASSERT(bip->bli_item.li_desc->lid_flags & XFS_LID_DIRTY); 664 ASSERT(bip->bli_item.li_desc->lid_flags & XFS_LID_DIRTY);
665 ASSERT(tp->t_flags & XFS_TRANS_DIRTY); 665 ASSERT(tp->t_flags & XFS_TRANS_DIRTY);
@@ -672,7 +672,7 @@ xfs_trans_binval(
672 bip->bli_flags &= ~(XFS_BLI_INODE_BUF | XFS_BLI_LOGGED | XFS_BLI_DIRTY); 672 bip->bli_flags &= ~(XFS_BLI_INODE_BUF | XFS_BLI_LOGGED | XFS_BLI_DIRTY);
673 bip->__bli_format.blf_flags &= ~XFS_BLF_INODE_BUF; 673 bip->__bli_format.blf_flags &= ~XFS_BLF_INODE_BUF;
674 bip->__bli_format.blf_flags |= XFS_BLF_CANCEL; 674 bip->__bli_format.blf_flags |= XFS_BLF_CANCEL;
675 bip->__bli_format.blf_flags &= ~XFS_BLF_TYPE_MASK; 675 bip->__bli_format.blf_flags &= ~XFS_BLFT_MASK;
676 for (i = 0; i < bip->bli_format_count; i++) { 676 for (i = 0; i < bip->bli_format_count; i++) {
677 memset(bip->bli_formats[i].blf_data_map, 0, 677 memset(bip->bli_formats[i].blf_data_map, 0,
678 (bip->bli_formats[i].blf_map_size * sizeof(uint))); 678 (bip->bli_formats[i].blf_map_size * sizeof(uint)));
@@ -704,7 +704,7 @@ xfs_trans_inode_buf(
704 ASSERT(atomic_read(&bip->bli_refcount) > 0); 704 ASSERT(atomic_read(&bip->bli_refcount) > 0);
705 705
706 bip->bli_flags |= XFS_BLI_INODE_BUF; 706 bip->bli_flags |= XFS_BLI_INODE_BUF;
707 xfs_trans_buf_set_type(tp, bp, XFS_BLF_DINO_BUF); 707 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DINO_BUF);
708} 708}
709 709
710/* 710/*
@@ -729,7 +729,7 @@ xfs_trans_stale_inode_buf(
729 729
730 bip->bli_flags |= XFS_BLI_STALE_INODE; 730 bip->bli_flags |= XFS_BLI_STALE_INODE;
731 bip->bli_item.li_cb = xfs_buf_iodone; 731 bip->bli_item.li_cb = xfs_buf_iodone;
732 xfs_trans_buf_set_type(tp, bp, XFS_BLF_DINO_BUF); 732 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DINO_BUF);
733} 733}
734 734
735/* 735/*
@@ -753,7 +753,7 @@ xfs_trans_inode_alloc_buf(
753 ASSERT(atomic_read(&bip->bli_refcount) > 0); 753 ASSERT(atomic_read(&bip->bli_refcount) > 0);
754 754
755 bip->bli_flags |= XFS_BLI_INODE_ALLOC_BUF; 755 bip->bli_flags |= XFS_BLI_INODE_ALLOC_BUF;
756 xfs_trans_buf_set_type(tp, bp, XFS_BLF_DINO_BUF); 756 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DINO_BUF);
757} 757}
758 758
759/* 759/*
@@ -764,7 +764,7 @@ void
764xfs_trans_buf_set_type( 764xfs_trans_buf_set_type(
765 struct xfs_trans *tp, 765 struct xfs_trans *tp,
766 struct xfs_buf *bp, 766 struct xfs_buf *bp,
767 uint type) 767 enum xfs_blft type)
768{ 768{
769 struct xfs_buf_log_item *bip = bp->b_fspriv; 769 struct xfs_buf_log_item *bip = bp->b_fspriv;
770 770
@@ -774,10 +774,8 @@ xfs_trans_buf_set_type(
774 ASSERT(bp->b_transp == tp); 774 ASSERT(bp->b_transp == tp);
775 ASSERT(bip != NULL); 775 ASSERT(bip != NULL);
776 ASSERT(atomic_read(&bip->bli_refcount) > 0); 776 ASSERT(atomic_read(&bip->bli_refcount) > 0);
777 ASSERT((type & XFS_BLF_TYPE_MASK) != 0);
778 777
779 bip->__bli_format.blf_flags &= ~XFS_BLF_TYPE_MASK; 778 xfs_blft_to_flags(&bip->__bli_format, type);
780 bip->__bli_format.blf_flags |= type;
781} 779}
782 780
783void 781void
@@ -787,11 +785,10 @@ xfs_trans_buf_copy_type(
787{ 785{
788 struct xfs_buf_log_item *sbip = src_bp->b_fspriv; 786 struct xfs_buf_log_item *sbip = src_bp->b_fspriv;
789 struct xfs_buf_log_item *dbip = dst_bp->b_fspriv; 787 struct xfs_buf_log_item *dbip = dst_bp->b_fspriv;
790 uint type; 788 enum xfs_blft type;
791 789
792 type = sbip->__bli_format.blf_flags & XFS_BLF_TYPE_MASK; 790 type = xfs_blft_from_flags(&sbip->__bli_format);
793 dbip->__bli_format.blf_flags &= ~XFS_BLF_TYPE_MASK; 791 xfs_blft_to_flags(&dbip->__bli_format, type);
794 dbip->__bli_format.blf_flags |= type;
795} 792}
796 793
797/* 794/*
@@ -811,9 +808,28 @@ xfs_trans_dquot_buf(
811 xfs_buf_t *bp, 808 xfs_buf_t *bp,
812 uint type) 809 uint type)
813{ 810{
811 struct xfs_buf_log_item *bip = bp->b_fspriv;
812
814 ASSERT(type == XFS_BLF_UDQUOT_BUF || 813 ASSERT(type == XFS_BLF_UDQUOT_BUF ||
815 type == XFS_BLF_PDQUOT_BUF || 814 type == XFS_BLF_PDQUOT_BUF ||
816 type == XFS_BLF_GDQUOT_BUF); 815 type == XFS_BLF_GDQUOT_BUF);
817 816
817 bip->__bli_format.blf_flags |= type;
818
819 switch (type) {
820 case XFS_BLF_UDQUOT_BUF:
821 type = XFS_BLFT_UDQUOT_BUF;
822 break;
823 case XFS_BLF_PDQUOT_BUF:
824 type = XFS_BLFT_PDQUOT_BUF;
825 break;
826 case XFS_BLF_GDQUOT_BUF:
827 type = XFS_BLFT_GDQUOT_BUF;
828 break;
829 default:
830 type = XFS_BLFT_UNKNOWN_BUF;
831 break;
832 }
833
818 xfs_trans_buf_set_type(tp, bp, type); 834 xfs_trans_buf_set_type(tp, bp, type);
819} 835}