aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_da_btree.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2011-07-13 07:43:50 -0400
committerChristoph Hellwig <hch@lst.de>2011-07-13 07:43:50 -0400
commitd0f9e8fb4cc6dd5d07c72eeecc2f332b6e85e221 (patch)
treeb0d0102e47cf961b75bc9a918c64bee6f9bad399 /fs/xfs/xfs_da_btree.c
parentc84470dda7a1165d90f55c2025c4c8ca403d485e (diff)
xfs: remove the dead XFS_DABUF_DEBUG code
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_da_btree.c')
-rw-r--r--fs/xfs/xfs_da_btree.c68
1 files changed, 12 insertions, 56 deletions
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c
index 73b048f7eb71..2925726529f8 100644
--- a/fs/xfs/xfs_da_btree.c
+++ b/fs/xfs/xfs_da_btree.c
@@ -86,7 +86,7 @@ STATIC void xfs_da_node_unbalance(xfs_da_state_t *state,
86 */ 86 */
87STATIC uint xfs_da_node_lasthash(xfs_dabuf_t *bp, int *count); 87STATIC uint xfs_da_node_lasthash(xfs_dabuf_t *bp, int *count);
88STATIC int xfs_da_node_order(xfs_dabuf_t *node1_bp, xfs_dabuf_t *node2_bp); 88STATIC int xfs_da_node_order(xfs_dabuf_t *node1_bp, xfs_dabuf_t *node2_bp);
89STATIC xfs_dabuf_t *xfs_da_buf_make(int nbuf, xfs_buf_t **bps, inst_t *ra); 89STATIC xfs_dabuf_t *xfs_da_buf_make(int nbuf, xfs_buf_t **bps);
90STATIC int xfs_da_blk_unlink(xfs_da_state_t *state, 90STATIC int xfs_da_blk_unlink(xfs_da_state_t *state,
91 xfs_da_state_blk_t *drop_blk, 91 xfs_da_state_blk_t *drop_blk,
92 xfs_da_state_blk_t *save_blk); 92 xfs_da_state_blk_t *save_blk);
@@ -1939,8 +1939,7 @@ xfs_da_do_buf(
1939 xfs_daddr_t *mappedbnop, 1939 xfs_daddr_t *mappedbnop,
1940 xfs_dabuf_t **bpp, 1940 xfs_dabuf_t **bpp,
1941 int whichfork, 1941 int whichfork,
1942 int caller, 1942 int caller)
1943 inst_t *ra)
1944{ 1943{
1945 xfs_buf_t *bp = NULL; 1944 xfs_buf_t *bp = NULL;
1946 xfs_buf_t **bplist; 1945 xfs_buf_t **bplist;
@@ -2079,9 +2078,9 @@ xfs_da_do_buf(
2079 * Build a dabuf structure. 2078 * Build a dabuf structure.
2080 */ 2079 */
2081 if (bplist) { 2080 if (bplist) {
2082 rbp = xfs_da_buf_make(nbplist, bplist, ra); 2081 rbp = xfs_da_buf_make(nbplist, bplist);
2083 } else if (bp) 2082 } else if (bp)
2084 rbp = xfs_da_buf_make(1, &bp, ra); 2083 rbp = xfs_da_buf_make(1, &bp);
2085 else 2084 else
2086 rbp = NULL; 2085 rbp = NULL;
2087 /* 2086 /*
@@ -2149,8 +2148,7 @@ xfs_da_get_buf(
2149 xfs_dabuf_t **bpp, 2148 xfs_dabuf_t **bpp,
2150 int whichfork) 2149 int whichfork)
2151{ 2150{
2152 return xfs_da_do_buf(trans, dp, bno, &mappedbno, bpp, whichfork, 0, 2151 return xfs_da_do_buf(trans, dp, bno, &mappedbno, bpp, whichfork, 0);
2153 (inst_t *)__return_address);
2154} 2152}
2155 2153
2156/* 2154/*
@@ -2165,8 +2163,7 @@ xfs_da_read_buf(
2165 xfs_dabuf_t **bpp, 2163 xfs_dabuf_t **bpp,
2166 int whichfork) 2164 int whichfork)
2167{ 2165{
2168 return xfs_da_do_buf(trans, dp, bno, &mappedbno, bpp, whichfork, 1, 2166 return xfs_da_do_buf(trans, dp, bno, &mappedbno, bpp, whichfork, 1);
2169 (inst_t *)__return_address);
2170} 2167}
2171 2168
2172/* 2169/*
@@ -2182,8 +2179,7 @@ xfs_da_reada_buf(
2182 xfs_daddr_t rval; 2179 xfs_daddr_t rval;
2183 2180
2184 rval = -1; 2181 rval = -1;
2185 if (xfs_da_do_buf(trans, dp, bno, &rval, NULL, whichfork, 3, 2182 if (xfs_da_do_buf(trans, dp, bno, &rval, NULL, whichfork, 3))
2186 (inst_t *)__return_address))
2187 return -1; 2183 return -1;
2188 else 2184 else
2189 return rval; 2185 return rval;
@@ -2241,17 +2237,12 @@ xfs_da_state_free(xfs_da_state_t *state)
2241 kmem_zone_free(xfs_da_state_zone, state); 2237 kmem_zone_free(xfs_da_state_zone, state);
2242} 2238}
2243 2239
2244#ifdef XFS_DABUF_DEBUG
2245xfs_dabuf_t *xfs_dabuf_global_list;
2246static DEFINE_SPINLOCK(xfs_dabuf_global_lock);
2247#endif
2248
2249/* 2240/*
2250 * Create a dabuf. 2241 * Create a dabuf.
2251 */ 2242 */
2252/* ARGSUSED */ 2243/* ARGSUSED */
2253STATIC xfs_dabuf_t * 2244STATIC xfs_dabuf_t *
2254xfs_da_buf_make(int nbuf, xfs_buf_t **bps, inst_t *ra) 2245xfs_da_buf_make(int nbuf, xfs_buf_t **bps)
2255{ 2246{
2256 xfs_buf_t *bp; 2247 xfs_buf_t *bp;
2257 xfs_dabuf_t *dabuf; 2248 xfs_dabuf_t *dabuf;
@@ -2263,11 +2254,6 @@ xfs_da_buf_make(int nbuf, xfs_buf_t **bps, inst_t *ra)
2263 else 2254 else
2264 dabuf = kmem_alloc(XFS_DA_BUF_SIZE(nbuf), KM_NOFS); 2255 dabuf = kmem_alloc(XFS_DA_BUF_SIZE(nbuf), KM_NOFS);
2265 dabuf->dirty = 0; 2256 dabuf->dirty = 0;
2266#ifdef XFS_DABUF_DEBUG
2267 dabuf->ra = ra;
2268 dabuf->target = XFS_BUF_TARGET(bps[0]);
2269 dabuf->blkno = XFS_BUF_ADDR(bps[0]);
2270#endif
2271 if (nbuf == 1) { 2257 if (nbuf == 1) {
2272 dabuf->nbuf = 1; 2258 dabuf->nbuf = 1;
2273 bp = bps[0]; 2259 bp = bps[0];
@@ -2287,23 +2273,6 @@ xfs_da_buf_make(int nbuf, xfs_buf_t **bps, inst_t *ra)
2287 XFS_BUF_COUNT(bp)); 2273 XFS_BUF_COUNT(bp));
2288 } 2274 }
2289 } 2275 }
2290#ifdef XFS_DABUF_DEBUG
2291 {
2292 xfs_dabuf_t *p;
2293
2294 spin_lock(&xfs_dabuf_global_lock);
2295 for (p = xfs_dabuf_global_list; p; p = p->next) {
2296 ASSERT(p->blkno != dabuf->blkno ||
2297 p->target != dabuf->target);
2298 }
2299 dabuf->prev = NULL;
2300 if (xfs_dabuf_global_list)
2301 xfs_dabuf_global_list->prev = dabuf;
2302 dabuf->next = xfs_dabuf_global_list;
2303 xfs_dabuf_global_list = dabuf;
2304 spin_unlock(&xfs_dabuf_global_lock);
2305 }
2306#endif
2307 return dabuf; 2276 return dabuf;
2308} 2277}
2309 2278
@@ -2339,25 +2308,12 @@ xfs_da_buf_done(xfs_dabuf_t *dabuf)
2339 ASSERT(dabuf->nbuf && dabuf->data && dabuf->bbcount && dabuf->bps[0]); 2308 ASSERT(dabuf->nbuf && dabuf->data && dabuf->bbcount && dabuf->bps[0]);
2340 if (dabuf->dirty) 2309 if (dabuf->dirty)
2341 xfs_da_buf_clean(dabuf); 2310 xfs_da_buf_clean(dabuf);
2342 if (dabuf->nbuf > 1) 2311 if (dabuf->nbuf > 1) {
2343 kmem_free(dabuf->data); 2312 kmem_free(dabuf->data);
2344#ifdef XFS_DABUF_DEBUG
2345 {
2346 spin_lock(&xfs_dabuf_global_lock);
2347 if (dabuf->prev)
2348 dabuf->prev->next = dabuf->next;
2349 else
2350 xfs_dabuf_global_list = dabuf->next;
2351 if (dabuf->next)
2352 dabuf->next->prev = dabuf->prev;
2353 spin_unlock(&xfs_dabuf_global_lock);
2354 }
2355 memset(dabuf, 0, XFS_DA_BUF_SIZE(dabuf->nbuf));
2356#endif
2357 if (dabuf->nbuf == 1)
2358 kmem_zone_free(xfs_dabuf_zone, dabuf);
2359 else
2360 kmem_free(dabuf); 2313 kmem_free(dabuf);
2314 } else {
2315 kmem_zone_free(xfs_dabuf_zone, dabuf);
2316 }
2361} 2317}
2362 2318
2363/* 2319/*