aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Tinguely <tinguely@sgi.com>2012-12-04 18:18:06 -0500
committerBen Myers <bpm@sgi.com>2012-12-17 17:29:00 -0500
commitec47eb6b0b450a4e82340b6de674104de3f0dc0a (patch)
treef5669813b271a39ca5a78a55430f0032635d4b9f
parentc883d0c400fc8cdbd5bbe71e179c9e64ace58e86 (diff)
xfs remove the XFS_TRANS_DEBUG routines
Remove the XFS_TRANS_DEBUG routines. They are no longer appropriate and have not been used in years Signed-off-by: Mark Tinguely <tinguely@sgi.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Ben Myers <bpm@sgi.com>
-rw-r--r--fs/xfs/xfs_buf_item.c106
-rw-r--r--fs/xfs/xfs_buf_item.h14
-rw-r--r--fs/xfs/xfs_inode.c6
-rw-r--r--fs/xfs/xfs_inode_item.c16
-rw-r--r--fs/xfs/xfs_inode_item.h4
-rw-r--r--fs/xfs/xfs_trans_ail.c14
-rw-r--r--fs/xfs/xfs_trans_inode.c41
7 files changed, 0 insertions, 201 deletions
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index 77b09750e92c..63c86c48014b 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -37,109 +37,6 @@ static inline struct xfs_buf_log_item *BUF_ITEM(struct xfs_log_item *lip)
37 return container_of(lip, struct xfs_buf_log_item, bli_item); 37 return container_of(lip, struct xfs_buf_log_item, bli_item);
38} 38}
39 39
40
41#ifdef XFS_TRANS_DEBUG
42/*
43 * This function uses an alternate strategy for tracking the bytes
44 * that the user requests to be logged. This can then be used
45 * in conjunction with the bli_orig array in the buf log item to
46 * catch bugs in our callers' code.
47 *
48 * We also double check the bits set in xfs_buf_item_log using a
49 * simple algorithm to check that every byte is accounted for.
50 */
51STATIC void
52xfs_buf_item_log_debug(
53 xfs_buf_log_item_t *bip,
54 uint first,
55 uint last)
56{
57 uint x;
58 uint byte;
59 uint nbytes;
60 uint chunk_num;
61 uint word_num;
62 uint bit_num;
63 uint bit_set;
64 uint *wordp;
65
66 ASSERT(bip->bli_logged != NULL);
67 byte = first;
68 nbytes = last - first + 1;
69 bfset(bip->bli_logged, first, nbytes);
70 for (x = 0; x < nbytes; x++) {
71 chunk_num = byte >> XFS_BLF_SHIFT;
72 word_num = chunk_num >> BIT_TO_WORD_SHIFT;
73 bit_num = chunk_num & (NBWORD - 1);
74 wordp = &(bip->__bli_format.blf_data_map[word_num]);
75 bit_set = *wordp & (1 << bit_num);
76 ASSERT(bit_set);
77 byte++;
78 }
79}
80
81/*
82 * This function is called when we flush something into a buffer without
83 * logging it. This happens for things like inodes which are logged
84 * separately from the buffer.
85 */
86void
87xfs_buf_item_flush_log_debug(
88 xfs_buf_t *bp,
89 uint first,
90 uint last)
91{
92 xfs_buf_log_item_t *bip = bp->b_fspriv;
93 uint nbytes;
94
95 if (bip == NULL || (bip->bli_item.li_type != XFS_LI_BUF))
96 return;
97
98 ASSERT(bip->bli_logged != NULL);
99 nbytes = last - first + 1;
100 bfset(bip->bli_logged, first, nbytes);
101}
102
103/*
104 * This function is called to verify that our callers have logged
105 * all the bytes that they changed.
106 *
107 * It does this by comparing the original copy of the buffer stored in
108 * the buf log item's bli_orig array to the current copy of the buffer
109 * and ensuring that all bytes which mismatch are set in the bli_logged
110 * array of the buf log item.
111 */
112STATIC void
113xfs_buf_item_log_check(
114 xfs_buf_log_item_t *bip)
115{
116 char *orig;
117 char *buffer;
118 int x;
119 xfs_buf_t *bp;
120
121 ASSERT(bip->bli_orig != NULL);
122 ASSERT(bip->bli_logged != NULL);
123
124 bp = bip->bli_buf;
125 ASSERT(bp->b_length > 0);
126 ASSERT(bp->b_addr != NULL);
127 orig = bip->bli_orig;
128 buffer = bp->b_addr;
129 for (x = 0; x < BBTOB(bp->b_length); x++) {
130 if (orig[x] != buffer[x] && !btst(bip->bli_logged, x)) {
131 xfs_emerg(bp->b_mount,
132 "%s: bip %x buffer %x orig %x index %d",
133 __func__, bip, bp, orig, x);
134 ASSERT(0);
135 }
136 }
137}
138#else
139#define xfs_buf_item_log_debug(x,y,z)
140#define xfs_buf_item_log_check(x)
141#endif
142
143STATIC void xfs_buf_do_callbacks(struct xfs_buf *bp); 40STATIC void xfs_buf_do_callbacks(struct xfs_buf *bp);
144 41
145/* 42/*
@@ -429,7 +326,6 @@ xfs_buf_item_format(
429 * Check to make sure everything is consistent. 326 * Check to make sure everything is consistent.
430 */ 327 */
431 trace_xfs_buf_item_format(bip); 328 trace_xfs_buf_item_format(bip);
432 xfs_buf_item_log_check(bip);
433} 329}
434 330
435/* 331/*
@@ -915,8 +811,6 @@ xfs_buf_item_log_segment(
915 mask = (1 << end_bit) - 1; 811 mask = (1 << end_bit) - 1;
916 *wordp |= mask; 812 *wordp |= mask;
917 } 813 }
918
919 xfs_buf_item_log_debug(bip, first, last);
920} 814}
921 815
922/* 816/*
diff --git a/fs/xfs/xfs_buf_item.h b/fs/xfs/xfs_buf_item.h
index 16def435944a..ee36c88ecfde 100644
--- a/fs/xfs/xfs_buf_item.h
+++ b/fs/xfs/xfs_buf_item.h
@@ -98,10 +98,6 @@ typedef struct xfs_buf_log_item {
98 unsigned int bli_flags; /* misc flags */ 98 unsigned int bli_flags; /* misc flags */
99 unsigned int bli_recur; /* lock recursion count */ 99 unsigned int bli_recur; /* lock recursion count */
100 atomic_t bli_refcount; /* cnt of tp refs */ 100 atomic_t bli_refcount; /* cnt of tp refs */
101#ifdef XFS_TRANS_DEBUG
102 char *bli_orig; /* original buffer copy */
103 char *bli_logged; /* bytes logged (bitmap) */
104#endif
105 int bli_format_count; /* count of headers */ 101 int bli_format_count; /* count of headers */
106 struct xfs_buf_log_format *bli_formats; /* array of in-log header ptrs */ 102 struct xfs_buf_log_format *bli_formats; /* array of in-log header ptrs */
107 struct xfs_buf_log_format __bli_format; /* embedded in-log header */ 103 struct xfs_buf_log_format __bli_format; /* embedded in-log header */
@@ -117,16 +113,6 @@ void xfs_buf_attach_iodone(struct xfs_buf *,
117void xfs_buf_iodone_callbacks(struct xfs_buf *); 113void xfs_buf_iodone_callbacks(struct xfs_buf *);
118void xfs_buf_iodone(struct xfs_buf *, struct xfs_log_item *); 114void xfs_buf_iodone(struct xfs_buf *, struct xfs_log_item *);
119 115
120#ifdef XFS_TRANS_DEBUG
121void
122xfs_buf_item_flush_log_debug(
123 struct xfs_buf *bp,
124 uint first,
125 uint last);
126#else
127#define xfs_buf_item_flush_log_debug(bp, first, last)
128#endif
129
130#endif /* __KERNEL__ */ 116#endif /* __KERNEL__ */
131 117
132#endif /* __XFS_BUF_ITEM_H__ */ 118#endif /* __XFS_BUF_ITEM_H__ */
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 66282dcb821b..4f201656d2d9 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -2379,9 +2379,6 @@ xfs_iflush_fork(
2379 char *cp; 2379 char *cp;
2380 xfs_ifork_t *ifp; 2380 xfs_ifork_t *ifp;
2381 xfs_mount_t *mp; 2381 xfs_mount_t *mp;
2382#ifdef XFS_TRANS_DEBUG
2383 int first;
2384#endif
2385 static const short brootflag[2] = 2382 static const short brootflag[2] =
2386 { XFS_ILOG_DBROOT, XFS_ILOG_ABROOT }; 2383 { XFS_ILOG_DBROOT, XFS_ILOG_ABROOT };
2387 static const short dataflag[2] = 2384 static const short dataflag[2] =
@@ -2724,9 +2721,6 @@ xfs_iflush_int(
2724 xfs_inode_log_item_t *iip; 2721 xfs_inode_log_item_t *iip;
2725 xfs_dinode_t *dip; 2722 xfs_dinode_t *dip;
2726 xfs_mount_t *mp; 2723 xfs_mount_t *mp;
2727#ifdef XFS_TRANS_DEBUG
2728 int first;
2729#endif
2730 2724
2731 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_ILOCK_SHARED)); 2725 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_ILOCK_SHARED));
2732 ASSERT(xfs_isiflocked(ip)); 2726 ASSERT(xfs_isiflocked(ip));
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c
index d041d47d9d86..f034bd1652f0 100644
--- a/fs/xfs/xfs_inode_item.c
+++ b/fs/xfs/xfs_inode_item.c
@@ -269,17 +269,6 @@ xfs_inode_item_format(
269 } else { 269 } else {
270 ASSERT(!(iip->ili_fields & 270 ASSERT(!(iip->ili_fields &
271 XFS_ILOG_DBROOT)); 271 XFS_ILOG_DBROOT));
272#ifdef XFS_TRANS_DEBUG
273 if (iip->ili_root_size > 0) {
274 ASSERT(iip->ili_root_size ==
275 ip->i_df.if_broot_bytes);
276 ASSERT(memcmp(iip->ili_orig_root,
277 ip->i_df.if_broot,
278 iip->ili_root_size) == 0);
279 } else {
280 ASSERT(ip->i_df.if_broot_bytes == 0);
281 }
282#endif
283 iip->ili_fields &= ~XFS_ILOG_DBROOT; 272 iip->ili_fields &= ~XFS_ILOG_DBROOT;
284 } 273 }
285 break; 274 break;
@@ -678,11 +667,6 @@ void
678xfs_inode_item_destroy( 667xfs_inode_item_destroy(
679 xfs_inode_t *ip) 668 xfs_inode_t *ip)
680{ 669{
681#ifdef XFS_TRANS_DEBUG
682 if (ip->i_itemp->ili_root_size != 0) {
683 kmem_free(ip->i_itemp->ili_orig_root);
684 }
685#endif
686 kmem_zone_free(xfs_ili_zone, ip->i_itemp); 670 kmem_zone_free(xfs_ili_zone, ip->i_itemp);
687} 671}
688 672
diff --git a/fs/xfs/xfs_inode_item.h b/fs/xfs/xfs_inode_item.h
index 376d4d0b2635..779812fb3d80 100644
--- a/fs/xfs/xfs_inode_item.h
+++ b/fs/xfs/xfs_inode_item.h
@@ -148,10 +148,6 @@ typedef struct xfs_inode_log_item {
148 data exts */ 148 data exts */
149 struct xfs_bmbt_rec *ili_aextents_buf; /* array of logged 149 struct xfs_bmbt_rec *ili_aextents_buf; /* array of logged
150 attr exts */ 150 attr exts */
151#ifdef XFS_TRANS_DEBUG
152 int ili_root_size;
153 char *ili_orig_root;
154#endif
155 xfs_inode_log_format_t ili_format; /* logged structure */ 151 xfs_inode_log_format_t ili_format; /* logged structure */
156} xfs_inode_log_item_t; 152} xfs_inode_log_item_t;
157 153
diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index 6011ee661339..0eda7254305f 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -55,20 +55,6 @@ xfs_ail_check(
55 ASSERT(XFS_LSN_CMP(prev_lip->li_lsn, lip->li_lsn) >= 0); 55 ASSERT(XFS_LSN_CMP(prev_lip->li_lsn, lip->li_lsn) >= 0);
56 56
57 57
58#ifdef XFS_TRANS_DEBUG
59 /*
60 * Walk the list checking lsn ordering, and that every entry has the
61 * XFS_LI_IN_AIL flag set. This is really expensive, so only do it
62 * when specifically debugging the transaction subsystem.
63 */
64 prev_lip = list_entry(&ailp->xa_ail, xfs_log_item_t, li_ail);
65 list_for_each_entry(lip, &ailp->xa_ail, li_ail) {
66 if (&prev_lip->li_ail != &ailp->xa_ail)
67 ASSERT(XFS_LSN_CMP(prev_lip->li_lsn, lip->li_lsn) <= 0);
68 ASSERT((lip->li_flags & XFS_LI_IN_AIL) != 0);
69 prev_lip = lip;
70 }
71#endif /* XFS_TRANS_DEBUG */
72} 58}
73#else /* !DEBUG */ 59#else /* !DEBUG */
74#define xfs_ail_check(a,l) 60#define xfs_ail_check(a,l)
diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c
index d2eee20d5f5b..ac6d567704db 100644
--- a/fs/xfs/xfs_trans_inode.c
+++ b/fs/xfs/xfs_trans_inode.c
@@ -33,14 +33,6 @@
33#include "xfs_inode_item.h" 33#include "xfs_inode_item.h"
34#include "xfs_trace.h" 34#include "xfs_trace.h"
35 35
36#ifdef XFS_TRANS_DEBUG
37STATIC void
38xfs_trans_inode_broot_debug(
39 xfs_inode_t *ip);
40#else
41#define xfs_trans_inode_broot_debug(ip)
42#endif
43
44/* 36/*
45 * Add a locked inode to the transaction. 37 * Add a locked inode to the transaction.
46 * 38 *
@@ -67,8 +59,6 @@ xfs_trans_ijoin(
67 * Get a log_item_desc to point at the new item. 59 * Get a log_item_desc to point at the new item.
68 */ 60 */
69 xfs_trans_add_item(tp, &iip->ili_item); 61 xfs_trans_add_item(tp, &iip->ili_item);
70
71 xfs_trans_inode_broot_debug(ip);
72} 62}
73 63
74/* 64/*
@@ -135,34 +125,3 @@ xfs_trans_log_inode(
135 flags |= ip->i_itemp->ili_last_fields; 125 flags |= ip->i_itemp->ili_last_fields;
136 ip->i_itemp->ili_fields |= flags; 126 ip->i_itemp->ili_fields |= flags;
137} 127}
138
139#ifdef XFS_TRANS_DEBUG
140/*
141 * Keep track of the state of the inode btree root to make sure we
142 * log it properly.
143 */
144STATIC void
145xfs_trans_inode_broot_debug(
146 xfs_inode_t *ip)
147{
148 xfs_inode_log_item_t *iip;
149
150 ASSERT(ip->i_itemp != NULL);
151 iip = ip->i_itemp;
152 if (iip->ili_root_size != 0) {
153 ASSERT(iip->ili_orig_root != NULL);
154 kmem_free(iip->ili_orig_root);
155 iip->ili_root_size = 0;
156 iip->ili_orig_root = NULL;
157 }
158 if (ip->i_d.di_format == XFS_DINODE_FMT_BTREE) {
159 ASSERT((ip->i_df.if_broot != NULL) &&
160 (ip->i_df.if_broot_bytes > 0));
161 iip->ili_root_size = ip->i_df.if_broot_bytes;
162 iip->ili_orig_root =
163 (char*)kmem_alloc(iip->ili_root_size, KM_SLEEP);
164 memcpy(iip->ili_orig_root, (char*)(ip->i_df.if_broot),
165 iip->ili_root_size);
166 }
167}
168#endif