Commit Graph

208 Commits (master)

Author SHA1 Message Date
David Sterba 1f5094bb5c btrfs-progs: add support for raid1c3 and raid1c4
Add support for 3- and 4- copy variants of RAID1. This adds resiliency
against 2 or resp. 3 devices lost or damaged.

$ ./mkfs.btrfs -m raid1c4 -d raid1c3 /dev/sd[abcd]

Label:              (null)
UUID:               f1f988ab-6750-4bc2-957b-98a4ebe98631
Node size:          16384
Sector size:        4096
Filesystem size:    8.00GiB
Block group profiles:
  Data:             RAID1C3         273.06MiB
  Metadata:         RAID1C4         204.75MiB
  System:           RAID1C4           8.00MiB
SSD detected:       no
Incompat features:  extref, skinny-metadata, raid1c34
Number of devices:  4
Devices:
   ID        SIZE  PATH
    1     2.00GiB  /dev/sda
    2     2.00GiB  /dev/sdb
    3     2.00GiB  /dev/sdc
    4     2.00GiB  /dev/sdd

Signed-off-by: David Sterba <dsterba@suse.com>
2019-11-22 19:09:50 +01:00
Rosen Penev 5d72055066 btrfs-progs: Fix printf formats
Discovered with cppcheck. Fix signed/unsigned int mismatches, sizeof and
long formats.

Pull-request: #197
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-10-14 17:31:05 +02:00
Anand Jain 95c49ef7f7 btrfs-progs: print-tree: add BTRFS_DEV_ITEMS_OBJECTID in comment
So when searching for BTRFS_DEV_ITEMS_OBJECTID, it hits, albeit it is
defined same as BTRFS_ROOT_TREE_OBJECTID.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-10-14 17:27:52 +02:00
Anand Jain 9b1a1dacbc btrfs-progs: print-tree add missing DEV_STATS
Add missing BTRFS_DEV_STATS_OBJECTID into the print-tree.

before:
 	item 0 key (0 PERSISTENT_ITEM 1) itemoff 16243 itemsize 40
 		persistent item objectid 0 offset 1
after:
 	item 0 key (DEV_STATS PERSISTENT_ITEM 1) itemoff 16243 itemsize 40
 		persistent item objectid DEV_STATS offset 1

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-09-04 16:08:53 +02:00
David Sterba 94fced6353 btrfs-progs: build: drop kernel-lib from -I and update paths
Include the files by full path to avoid any confusion in case of
potentially duplicate names.

Signed-off-by: David Sterba <dsterba@suse.com>
2019-07-03 20:49:04 +02:00
David Sterba c07960c8be btrfs-progs: move utils.[ch] to common/
Update include paths and remove some duplicates.

Signed-off-by: David Sterba <dsterba@suse.com>
2019-07-03 20:49:04 +02:00
Qu Wenruo 95ae4184ea btrfs-progs: Fix -Waddress-of-packed-member warning in btrfs_dev_stats_values callers
[BUG]
GCC 9.1.0 will report the following error when compiling btrfs-progs:

  In file included from print-tree.c:24:
  ctree.h: In function 'btrfs_dev_stats_values':
  ctree.h:2408:9: warning: taking address of packed member of 'struct btrfs_dev_stats_item' may result in an unaligned pointer value [-Waddress-of-packed-member]
   2408 |  return p->values;
        |         ^

[FIX]
Follow the kernel way of accessing dev stats by using
btrfs_dev_stats_value(eb, ptr, index).
So that we don't need to bother accessing the packed member.

This also unifies the helper function in kernel and btrfs-progs.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-07-03 13:31:14 +02:00
David Sterba 691656abdc btrfs-progs: fix gcc9 warning and potentially unaligned access to dev stats
GCC9 9.1.1 with -Waddress-of-packed-member warns about passing an
unaligned pointer from btrfs_dev_stats_values. It is up to the caller to
access the array properly, which does happen in print_dev_stats.

In file included from print-tree.c:24:
ctree.h: In function ‘btrfs_dev_stats_values’:
ctree.h:2408:9: warning: taking address of packed member of ‘struct btrfs_dev_stats_item’ may result in an unaligned pointer value [-Waddress-of-packed-member]
 2408 |  return p->values;

Drop the helper as print-tree.c is the only user and access the dev stat
values using the unaligned helper.

Signed-off-by: David Sterba <dsterba@suse.com>
2019-06-11 15:32:21 +02:00
Qu Wenruo 085445e793 btrfs-progs: Cleanup BTRFS_COMPAT_EXTENT_TREE_V0
BTRFS_COMPAT_EXTENT_TREE_V0 is introduced for a short time in kernel,
and it's over 10 years ago.

Nowadays there should be no user for that feature, and kernel has remove
this support in Jun, 2018. There is no need for btrfs-progs to support
it.

This patch will remove EXTENT_TREE_V0 related code and replace those
BUG_ON() to a more graceful error message.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-06-05 18:00:07 +02:00
Josh Soref b1d39a42a4 btrfs-progs: fix typos in comments
Generated by https://github.com/jsoref/spelling

Issue: #154
Author: Josh Soref <jsoref@users.noreply.github.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-11-26 18:24:48 +01:00
Qu Wenruo 9f6d9ec10c btrfs-progs: print-tree: Use bool for @follow
Just a minor cleanup to make the parameter easier to read.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-31 18:24:14 +01:00
Qu Wenruo 0bbd407cbb btrfs-progs: print-tree: Introduce --bfs and --dfs options
Originally print-tree uses depth first search to print trees.
This works fine until we reach 3 level trees (root node level is 2).

For tall trees whose root level is 2 or higher, DFS will mix nodes and
leaves like the following example:

Level 2                       A
                             / \
Level 1                     B   C
                          / |   | \
Level 0                  D  E   F  G

DFS will cause the following output sequence:
A   B   D   E   C   F   G
Which in term of node/leave is:
N   N   L   L   N   L   L

Such mixed node/leave result is sometimes hard for human to read.

This patch will introduce 2 new options, --bfs and --dfs.

  --dfs: keeps the original output sequence, and to keep things
         compatible it's the default behavior.

  --bfs: uses breadth-first search, and will cause better output
         sequence like:

	 A   B   C   D   E   F   G
	 Which in term of node/leave is:
	 N   N   N   L   L   L   L

Much better sorted and may become default in the future.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-31 18:24:14 +01:00
Qu Wenruo 61c218756c btrfs-progs: print-tree: Introduce breadth-first search
Introduce a new function, bfs_print_children(), to do breadth-first
search to print a node.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-31 18:24:14 +01:00
Qu Wenruo d980546c71 btrfs-progs: print-tree: skip deprecated blockptr / nodesize output
When printing tree nodes, we output slots like:

  key (EXTENT_TREE ROOT_ITEM 0) block 73625600 (17975) gen 16

The number in the parentheses is blockptr / nodesize.

However this number doesn't really do anything useful.  And in fact for
unaligned metadata block group (block group start bytenr is not aligned
to 16K), the number doesn't even make sense as it's rounded down.

In fact kernel doesn't ever output such divided result in its
print-tree.c

Remove it so later reader won't wonder what the number means.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-10-23 14:48:39 +02:00
Qu Wenruo 3c042605db btrfs-progs: Get rid of the confusing btrfs_file_extent_inline_len()
[BUG]
If one uncompressed inline extent has incorrect ram_bytes, neither btrfs
check nor dump-tree could detect such corruption.

[CAUSE]
Every caller tries to read inline extent ram_bytes is using
btrfs_file_extent_inline_len(), other than directly calling
btrfs_file_extent_ram_bytes().

For compressed extent, it's just calling btrfs_file_extent_ram_bytes().
However for uncompressed extent, it falls back to
btrfs_file_extent_inline_item_len(), makes us unable to detect anything
wrong in ram_bytes.

[FIX]
Just get rid of such confusing btrfs_file_extent_inline_len() function.

Reported-by: Steve Leung <sjleung@shaw.ca>
Tested-by: Steve Leung <sjleung@shaw.ca>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-08-06 15:00:34 +02:00
Lu Fengqi ad6973647e btrfs-progs: print-tree: remove dead code from btrfs_print_tree
Since the out label has been deleted, this free_extent_buffer will never
be executed.

Fixes: f37ae8d275 ("btrfs-progs: print-tree: Enhance warning on tree block level mismatch and error handling")
Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-06-07 16:37:40 +02:00
Misono Tomohiro 42cf0baead btrfs-progs: ins: dump-tree: Print tree name for extent data/tree block backref
Print tree name instead of number to make output more readable.

Example:
[before]
   extent data backref root 5 objectid 257 offset 16384 count 1

   tree block backref root 18446744073709551607

[after]
   extent data backref root FS_TREE objectid 257 offset 16384 count 1

   tree block backref root DATA_RELOC_TREE

Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-06-07 16:37:38 +02:00
Misono Tomohiro b8f9a5e6e2 btrfs-progs: ins: dump-tree: Use %lld for extent data backref offset
Offset of extent data backref in extent item can be negative.
So, let's use %lld insteand of %llu to output readable value.

Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-06-07 16:37:38 +02:00
Qu Wenruo 22bd1d5e35 btrfs-progs: print-tree: Enhance btrfs_print_tree() check to avoid out-of-boundary memory access
For btrfs_print_tree(), if nr_items is corrupted, it can easily go
beyond extent buffer boundary.

Add extra nr_item check, and only print as many valid slots as possible.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-06-07 16:37:38 +02:00
Qu Wenruo 8606fe4bcb btrfs-progs: Allow tree to be printed without an fs_info
For btrfs_print_tree() and btrfs_print_leaf(), the usage of fs_info is
mainly for nodesize and sectorsize.

However for nodesize, we can get it from @eb->len without the need for
fs_info at all.

For nodesize, introduce new helper BTRFS_NODEPTR_PER_EXTENT_BUFFER() to
get nodesize from @eb directly.
And with the help of previous modified btrfs_leaf_free_space(),
btrfs_print_tree() can live without fs_info at all.

For btrfs_print_leaf(), we modify print_extent_csum() to accept NULL
fs_info by skipping csum length calculation.

With all these modification, btrfs_print_tree/leaf() can be called
without accessing @fs_info at all, and make it more flexible to handle
binary tree block dump, or inside gdb.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-06-07 16:37:35 +02:00
Qu Wenruo 41750fe660 btrfs-progs: Remove fs_info parameter from btrfs_leaf_free_space()
For btrfs_leaf_free_space(), to get leaf data size, we have two way to
get it:

1) leaf->fs_info->nodesize
2) leaf->len

Anyway, we could get rid of @fs_info parameter for
btrfs_leaf_free_space().
And here we choose method 2), as it provides extra benefit to get leaf
free space without initializing a real fs_info.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-06-07 16:37:35 +02:00
Qu Wenruo 9e061cae19 btrfs-progs: print-tree: Avoid segfault for heavily corrupted item pointers
Normally corrupted leaf should be caught by csum check, but sometimes
corrupted item pointers (out of leaf range) can still pass csum check.
In fact, our fsck/005 test case image has such corrupted item pointer
and btrfs check can surprisingly fix it.

Anyway, make print-tree to skip such item and remaining slots to avoid
segfault.

Please note that, in btrfs-progs we can't put such check into
check_tree_block() nor do kernel level comprehensive check as under
certain case, btrfs-progs can handle or even repair it.
A strict check_tree_block() or backporting kernel btrfs_check_leaf()
could break such test cases and reduce the utility of btrfs-progs.

Issue: #128
Reported-by: Hubert Kario <hubert@kario.pl>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-06-07 16:37:32 +02:00
Qu Wenruo 26c1dafbf6 btrfs-progs: print-tree: Remove btrfs_root parameter
Just like kernel cleanup made by David, btrfs_print_leaf() and
btrfs_print_tree() doesn't need btrfs_root parameter at all.

With previous patches as preparation, now we can remove the btrfs_root
parameter.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-04-24 13:00:11 +02:00
Qu Wenruo 47c694b0f4 btrfs-progs: Unify btrfs_leaf_free_space() parameter with kernel
Instead of struct btrfs_root, use struct btrfs_fs_info, since nodesize
is now a per-fs setting, and with the need to pass a @root, caller don't
need to wonder which root should be passed.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-04-24 13:00:11 +02:00
Nikolay Borisov 30b852cd7e btrfs-progs: Beautify owner when printing leaf/nodes
Currently we print the raw values of the owner field of leaf/nodes.
This can result in output like the following:

leaf 30490624 items 2 free space 16061 generation 4 owner 18446744073709551607

With the patch applied the same leaf looks like:

leaf 30490624 items 2 free space 16061 generation 4 owner DATA_RELOC_TREE

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-03-30 22:15:54 +02:00
Qu Wenruo f37ae8d275 btrfs-progs: print-tree: Enhance warning on tree block level mismatch and error handling
This patch enhances the tree block level mismatch by the following
methods:

1) Merge same warning branches into one
   We had two branches showing the same message, and their condition
   is also the same. Merge them

2) Only skip bad slot
   The old code skipped all the remaining slots, here we just skip one
   slot to output as many correct tree blocks as possible.

3) Enhance warning message
   Output the parent bytenr and expected and wrong level, so we don't
   need to refer to stdout to get which tree block is corrupted.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-03-30 22:15:54 +02:00
Qu Wenruo 7065345c99 btrfs-progs: print-tree: Do correct offset output for ROOT_ITEM
Commit Fixes: 8c36786c81 ("btrfs-progs: print-tree: Print offset as
tree objectid for ROOT_ITEM") changes how we translate offset of
ROOT_ITEM.

However the fact is, even for ROOT_ITEM, we have different meaning of
offset.

For tree reloc tree, it's indeed subvolume id.  But for other trees,
it's the transid of when it's created.

Reported-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-03-30 22:15:54 +02:00
Anand Jain 9fe78033cb btrfs-progs: print-tree: fix INODE_ITEM sequence and flags
dump-tree prints wrong sequence number and the flags numbers,
as we misplaced the printf args. This patch fixes it.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-02-13 16:22:55 +01:00
Gu Jinxiang 3809b36d85 btrfs-progs: Use fs_info instead of root for BTRFS_NODEPTRS_PER_BLOCK
Do a cleanup. Also make it consistent with kernel.  Use fs_info instead
of root for BTRFS_NODEPTRS_PER_BLOCK, since maybe in some situation we
do not know root, but just know fs_info.

To be consistent with kernel, change macro to inline function.

Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-02-02 16:01:57 +01:00
Misono, Tomohiro f23506c8a4 btrfs-progs: dump-tree: print c/o/s/r time of ROOT_ITEM
Currently ctime/otime/stime/rtime of ROOT_ITEM are not printed in
print_root_item().  Fix this and print them if the values are not zero.
The function print_timespec() is moved forward to reuse.

Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2018-01-03 17:08:57 +01:00
Qu Wenruo 8c36786c81 btrfs-progs: print-tree: Print offset as tree objectid for ROOT_ITEM
For cases like reloc trees and subvolume trees, their key offset is the
tree id.  The key will be printed as:

(TREE_RELOC ROOT_ITEM 18446744073709551607)

The negative number is long and even guys with real engineer brains
can't easily get the meaning.

This patch will change the output format to:

(TREE_RELOC ROOT_ITEM DATA_RELOC_TREE)

While for special offset value like 0 or (u64)-1, it's still shown as
is.

Signed-off-by: Qu Wenruo <wqu@suse.com>
[ reword comment ]
Signed-off-by: David Sterba <dsterba@suse.com>
2017-11-14 15:59:01 +01:00
David Sterba 510a282f7f btrfs-progs: print-tree: use proper helper for reading offset
Sparse warns

print-tree.c:1261:49: warning: incorrect type in argument 4 (different base types)
print-tree.c:1261:49:    expected unsigned long long [unsigned] [usertype] start
print-tree.c:1261:49:    got restricted __le64 [addressable] [usertype] offset

which means we have to use the helper instead of directly accessing the offset
member. This could print bogus number on bigendian arch.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-25 15:18:19 +02:00
Nick Terrell 717a8b1e5d btrfs-progs: Add zstd support
Adds zstd support to the btrfs program. An optional dependency on libzstd
>= 1.0.0 is added. Autoconf accepts `--enable-zstd' or `--disable-zstd' and
defaults to detecting if libzstd is present using `pkg-config'.

The patch is also available in my fork of btrfs-progs [1], which passes
Travis-CI with the new tests. The prebuilt binary is available there.

I haven't updated Android.mk.

[1] https://github.com/terrelln/btrfs-progs/tree/devel

Signed-off-by: Nick Terrell <terrelln@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-25 15:17:13 +02:00
Zhang Yu e96921bcaa Btrfs-progs: print-tree: check num_stripes in print_chunk
[TEST/fuzz] case: 004-simple-dump-tree

Since the wrong key(DATA_RELOC_TREE CHUNK_ITEM 0) in root tree,
error calling print_chunk(), resulting in num_stripes == 0.

ERROR:
     [TEST/fuzz]   004-simple-dump-tree
ctree.h:317: btrfs_chunk_item_size: BUG_ON `num_stripes == 0`
        triggered, value 1

failed (ignored, ret=134): /myproject/btrfs-progs/btrfs
inspect-internal dump-tree
/myproject/btrfs-progs/tests/fuzz-tests/images/
bko-155201-wrong-chunk-item-in-root-tree.raw.restored

test failed for case 004-simple-dump-tree
Makefile:288: recipe for target 'test-fuzz' failed
make: *** [test-fuzz] Error 1

So, check on num_stripes in print_chunk

Signed-off-by: Zhang Yu <zhangyu-fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00
David Sterba 36db1080c3 btrfs-progs: print-tree: factor out extent_csum dump
Factor out code to own helper and tweak the format so it matches the
rest.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00
Josef Bacik 5fbc00cc73 btrfs-progs: print the csum length in debug-tree
While looking at a log of a corrupted fs I needed to verify we were
missing csums for a given range.  Make this easier by printing out the
range of bytes a csum item covers.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00
David Sterba 8609c8bad6 btrfs-progs: print-tree: factor out temporary_item dump
Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00
David Sterba a4b65f00d5 btrfs-progs: print-tree: factor out persistent_item dump
Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00
David Sterba 61a578751d btrfs-progs: print-tree: factor out qgroup_limit dump
Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00
David Sterba 90631b721e btrfs-progs: print-tree: factor out qgroup_info dump
Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00
David Sterba 346d2e16dd btrfs-progs: print-tree: factor out qgroup_status dump
Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00
David Sterba 59714a77c3 btrfs-progs: print-tree: factor out dev_extent dump
Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00
David Sterba c3b767a208 btrfs-progs: print-tree: factor out free_space_info dump
Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00
David Sterba b3122697f6 btrfs-progs: print-tree: factor out shared_data_ref dump
Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00
David Sterba c23c1271d3 btrfs-progs: print-tree: factor out extent_data_ref dump
Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00
David Sterba e853a1abcd btrfs-progs: print-tree: factor out block_group_item dump
Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00
David Sterba 077a7024cd btrfs-progs: print-tree: don't print the item type for all items
In some cases it's clear from the context which item is being printed,
so we can remove them. If the item has no data, some description is
still desired (eg. orphan or various backrefs).

Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00
David Sterba 1224f7343e btrfs-progs: print-tree: rename item callbacks to match the key name
Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00
David Sterba 98909c21d7 btrfs-progs: drop blocksize from read_tree_block
Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00
David Sterba 1fa9653dc8 btrfs-progs: drop local blocksize variables if they're nodesize
Prep work so we can drop the blocksize argument from several functions.

Signed-off-by: David Sterba <dsterba@suse.com>
2017-09-08 16:15:05 +02:00