diff options
author | Daniel Phillips <daniel@tux3.org> | 2014-05-01 17:47:38 +0900 |
---|---|---|
committer | Daniel Phillips <daniel@tux3.org> | 2014-05-01 17:47:38 +0900 |
commit | f4f78e6788f874a3c6f7d3a038f53fd5182e08ef (patch) | |
tree | ee92c24ae5cf0b4c91be23841f213aace2d1a638 | |
parent | 2bd28285aa6cd34beaedc07003846b9cbcca3d73 (diff) | |
download | linux-tux3-f4f78e6788f874a3c6f7d3a038f53fd5182e08ef.tar.gz |
tux3: Remove btree dump method
We now use the walk.c framework to dump
If there is ever a use for this we could possibly add it back
Some other dumpers like bitmap dump are genuinely useful
Signed-off-by: Daniel Phillips <d.phillips@partner.samsung.com>
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
-rw-r--r-- | fs/tux3/btree.c | 33 | ||||
-rw-r--r-- | fs/tux3/dleaf.c | 24 | ||||
-rw-r--r-- | fs/tux3/ileaf.c | 39 | ||||
-rw-r--r-- | fs/tux3/tux3.h | 3 |
4 files changed, 0 insertions, 99 deletions
diff --git a/fs/tux3/btree.c b/fs/tux3/btree.c index 6c618291d499d5..9bcef8d688af7c 100644 --- a/fs/tux3/btree.c +++ b/fs/tux3/btree.c @@ -522,39 +522,6 @@ out: return ret; } -void show_tree_range(struct btree *btree, tuxkey_t start, unsigned count) -{ - __tux3_dbg("%i level btree at %Li:\n", - btree->root.depth, btree->root.block); - if (!has_root(btree)) - return; - - struct cursor *cursor = alloc_cursor(btree, 0); - if (!cursor) { - tux3_err(btree->sb, "out of memory"); - return; - } - if (btree_probe(cursor, start)) { - tux3_fs_error(btree->sb, "tell me why!!!"); - goto out; - } - - struct buffer_head *buffer; - do { - buffer = cursor_leafbuf(cursor); - assert(!btree->ops->leaf_sniff(btree, bufdata(buffer))); - (btree->ops->leaf_dump)(btree, bufdata(buffer)); - } while (--count && cursor_advance(cursor)); - -out: - free_cursor(cursor); -} - -void show_tree(struct btree *btree) -{ - show_tree_range(btree, 0, -1); -} - static void level_redirect_blockput(struct cursor *cursor, int level, struct buffer_head *clone) { struct buffer_head *buffer = cursor->path[level].buffer; diff --git a/fs/tux3/dleaf.c b/fs/tux3/dleaf.c index bb7756aa39ede2..fa41e18469b164 100644 --- a/fs/tux3/dleaf.c +++ b/fs/tux3/dleaf.c @@ -149,29 +149,6 @@ static int dleaf_can_free(struct btree *btree, void *leaf) return 1; } -static void __dleaf_dump(struct btree *btree, struct dleaf *dleaf, - const char *prefix) -{ - if (!tux3_trace) - return; - - unsigned i; - __tux3_dbg("%sdleaf %p, magic %x, count %u\n", prefix, - dleaf, be16_to_cpu(dleaf->magic), be16_to_cpu(dleaf->count)); - for (i = 0; i < be16_to_cpu(dleaf->count); i++) { - struct extent ex; - get_extent(dleaf->table + i, &ex); - __tux3_dbg(" logical %Lu, physical %Lu, version %u\n", - ex.logical, ex.physical, ex.version); - } -} - -static void dleaf_dump(struct btree *btree, void *leaf) -{ - struct dleaf *dleaf = leaf; - __dleaf_dump(btree, dleaf, ""); -} - /* Lookup logical address in diskextent2 <= index */ static struct diskextent2 * __dleaf_lookup_index(struct btree *btree, struct dleaf *dleaf, @@ -853,5 +830,4 @@ struct btree_ops dtree_ops = { .leaf_sniff = dleaf_sniff, .leaf_can_free = dleaf_can_free, - .leaf_dump = dleaf_dump, }; diff --git a/fs/tux3/ileaf.c b/fs/tux3/ileaf.c index bb41948a3e6da1..1d80565fabb77e 100644 --- a/fs/tux3/ileaf.c +++ b/fs/tux3/ileaf.c @@ -105,43 +105,6 @@ static int ileaf_can_free(struct btree *btree, void *leaf) return icount(ileaf) == 0; } -static void ileaf_dump(struct btree *btree, void *vleaf) -{ - if (!tux3_trace) - return; - - struct ileaf_attr_ops *attr_ops = btree->ops->private_ops; - struct ileaf *leaf = vleaf; - inum_t inum = ibase(leaf); - __be16 *dict = ileaf_dict(btree, leaf); - unsigned offset = 0; - - __tux3_dbg("ileaf 0x%Lx/%i (%x bytes free)", - ibase(leaf), icount(leaf), ileaf_free(btree, leaf)); - - for (int i = 0; i < icount(leaf); i++, inum++) { - int limit = __atdict(dict, i + 1), size = limit - offset; - if (!size) - continue; - if (size < 0) - __tux3_dbg(" 0x%Lx: <corrupt>\n", inum); - else if (!size) - __tux3_dbg(" 0x%Lx: <empty>\n", inum); - else if (attr_ops == &iattr_ops) { - /* FIXME: this doesn't work in kernel */ - struct tux3_inode tuxnode = {}; - struct inode *inode = &tuxnode.vfs_inode; - void *attrs = leaf->table + offset; - - inode->i_sb = vfs_sb(btree->sb), - attr_ops->decode(btree, inode, attrs, size); - - free_xcache(inode); - } - offset = limit; - } -} - void *ileaf_lookup(struct btree *btree, inum_t inum, struct ileaf *leaf, unsigned *result) { assert(inum >= ibase(leaf)); @@ -484,7 +447,6 @@ struct btree_ops itree_ops = { .leaf_sniff = ileaf_sniff, .leaf_can_free = ileaf_can_free, - .leaf_dump = ileaf_dump, }; struct btree_ops otree_ops = { @@ -500,7 +462,6 @@ struct btree_ops otree_ops = { .leaf_sniff = ileaf_sniff, .leaf_can_free = ileaf_can_free, - .leaf_dump = ileaf_dump, }; /* diff --git a/fs/tux3/tux3.h b/fs/tux3/tux3.h index c2e9363c3fb8dd..a388e8298bf057 100644 --- a/fs/tux3/tux3.h +++ b/fs/tux3/tux3.h @@ -596,7 +596,6 @@ struct btree_ops { int (*leaf_sniff)(struct btree *btree, void *leaf); /* return value: 1 - can free, 0 - can't free */ int (*leaf_can_free)(struct btree *btree, void *leaf); - void (*leaf_dump)(struct btree *btree, void *leaf); }; /* Information for replay */ @@ -762,8 +761,6 @@ int noop_pre_write(struct btree *btree, tuxkey_t key_bottom, tuxkey_t key_limit, void *leaf, struct btree_key_range *key); int btree_write(struct cursor *cursor, struct btree_key_range *key); int btree_read(struct cursor *cursor, struct btree_key_range *key); -void show_tree_range(struct btree *btree, tuxkey_t start, unsigned count); -void show_tree(struct btree *btree); int cursor_redirect(struct cursor *cursor); int replay_bnode_redirect(struct replay *rp, block_t oldblock, block_t newblock); int replay_bnode_root(struct replay *rp, block_t root, unsigned count, |