summaryrefslogtreecommitdiff
path: root/print-tree.c
Commit message (Collapse)AuthorAge
* btrfs-progs: drop blocksize from read_tree_blockDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: drop local blocksize variables if they're nodesizeDavid Sterba2017-09-08
| | | | | | Prep work so we can drop the blocksize argument from several functions. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Tighten integer types in print-treeAdam Buchbinder2017-07-20
| | | | | | | | | There are likely more places where the wrong size types are used, but these tripped Clang's warnings because they eventually get passed to printf. Signed-off-by: Adam Buchbinder <abuchbinder@google.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Refactor read_tree_block to get rid of btrfs_rootQu Wenruo2017-07-03
| | | | | | | | | | | | | The only reasom read_tree_block() needs a btrfs_root parameter is to get its node/sector size. And long ago, I have already introduced a compactible interface, read_tree_block_fs_info() to pass btrfs_fs_info instead of btrfs_root. Since we have cleaned up all root->sector/node/stripesize users, we should be OK to refactor read_tree_block() function. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
* btrfs-progs: Refactor nodesize user in print-tree.cQu Wenruo2017-07-03
| | | | Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
* btrfs-progs: print-tree: Add leaf flags and backref revision outputQu Wenruo2017-05-15
| | | | | | | | | | | | Btrfs header has a u64 member flags, whose lowest 56 bits are for header flags like WRITTEN and RELOC. And its highest 8 bits are for backref revision. Manually checking btrfs_header_flags() will be a pain, so add such leaf flags and backref revision output for print-tree. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: add validation to print_chunkLu Fengqi2017-04-20
| | | | | | | | | | | In print_chunk, validate the value of uuid_offset when read the dev_uuid of stripe. Was triggered by misc-test/015-dump-super-garbage running indefinetelly. Issue: #37 Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: fix format string on 32bitDavid Sterba2016-11-24
| | | | | | We're passing a size_t, use the right format specifier. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: use new names for obsoleted keysDavid Sterba2016-11-09
| | | | | | | The DEV_STATS and BALANCE_ITEM have been deprecated in favor of more general items, print the new names in the dump. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: convert dir-item-to-string to tableDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: convert key-to-string to tableDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: cleanup types for item number iterationDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: move remaining item variables to the scope of useDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: move variable declarations closer to their useDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: rename extent buffer variable in btrfs_print_leafDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: add untyped item ptr helper and use itDavid Sterba2016-11-09
| | | | | | | | | | | There's lots of code that passes btrfs_item_ptr. Add a helper to extract the ptr at the beginning, ignoring the type. The print functions take the correct type, but we ignore it in the conversion macros as it does not provide the type checking anyway. If the typed variable is used more than once, it's kept in place. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: constify char argument in print_root_refDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: simplify and fix check for empty uuidDavid Sterba2016-11-09
| | | | | | | Counting non-zero bytes is wasteful, besides that it would not recognize uuids containing a 00 value. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: return void from print_* functionsDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: pass item size instead of itemDavid Sterba2016-11-09
| | | | | | | Several functions take item but use just the size, we can factor the item size and use that. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: remove unused parameter from print_inode_itemDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: consolidate data key namesDavid Sterba2016-11-09
| | | | | | | Rename to the structure members, add underscore so it's a single word. Compression is also printed as raw value. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: print dev statsDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: print balance status itemDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: teach print_leaf about temporary item subtypesDavid Sterba2016-11-09
| | | | | [ kernel patch 9f07e1d76eaeeddedcf9651395b4a8f870df31f0 ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: teach print_leaf about permanent item subtypesDavid Sterba2016-11-09
| | | | | [ kernel patch 585a3d0d238dfe42909cb58b0d05f644365fed14 ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: extract offset from the item keyDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: print missing data for file extent itemDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: print more root_item dataDavid Sterba2016-11-09
| | | | | | | Print a few more missing items of root_item (there are still some remaining). Drop key is printend unconditionally. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: print missing dir_item dataDavid Sterba2016-11-09
| | | | | | Add items from dir_item that are not printed, plus other adjustments. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: print missing inode_item dataDavid Sterba2016-11-09
| | | | | | Add items from inode_item that are not printed. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: add helper to print timespecDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: factor inode_item dump to functionDavid Sterba2016-11-09
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: print missing dev_extent dataDavid Sterba2016-11-09
| | | | | | | Add items from chunk that are not printed, unify names according to the member names and reorder a bit. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: print missing chunk dataDavid Sterba2016-11-09
| | | | | | | Add items from chunk that are not printed, unify names according to the member names and reorder a bit. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: dump-tree: print missing dev_item dataDavid Sterba2016-11-09
| | | | | | | Add items from dev_item that are not printed, unify names according to the member names. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Make btrfs-debug-tree print all readable strings for inode flagsQu Wenruo2016-10-24
| | | | | | | | | | | | Before this patch, only 3 inode flags have readable string: NODATACOW, NODATASUM, READONLY. This patch will output all readable strings for remaining inode flags, making debug-tree tool more handy. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ minor adjustments ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: improved error handling in btrfs_print_treeDavid Sterba2016-09-21
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Enhance and export print_key_type functionQu Wenruo2016-09-05
| | | | | | | Just the same thing done for print_objectid(). Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Enhance and export print_objectid functionQu Wenruo2016-09-05
| | | | | | | | | This function is quite useful for a lot of error report. Enhance it to support custom output other than stdout. And export it for later btrfsck enhancement. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: Print hex and human readable root flagsQu Wenruo2016-08-19
| | | | | Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: Print human readable inode flagsQu Wenruo2016-08-19
| | | | | Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check: write corrected qgroup info to diskMark Fasheh2016-07-13
| | | | | | | | | | | | | | | | Now that we can verify all qgroups, we can write the corrected qgroups out to disk when '--repair' is specified. The qgroup status item is also updated to clear any out-of-date state. The repair_ functions were modeled after the inode repair code in cmds-check.c. I also renamed the 'scan' member of qgroup_status_item to 'rescan' in order to keep consistency with the kernel. Testing this was easy, I just reproduced qgroup inconsistencies via the usual routes and had btrfsck fix them. Signed-off-by: Mark Fasheh <mfasheh@suse.de> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: deprecate and stop using btrfs_level_sizeDavid Sterba2016-05-02
| | | | | | Size of a b-tree node is always nodesize, regardless of the level. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: show the compression method stringWang Xiaoguang2016-03-14
| | | | | | Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com> [ changed the format of unknown value ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: add basic awareness of the free space treeOmar Sandoval2016-01-12
| | | | | | | | | | | To start, let's tell btrfs-progs to read the free space root and how to print the on-disk format of the free space tree. However, we're not adding the FREE_SPACE_TREE read-only compat bit to the set of supported bits because progs doesn't know how to keep the free space tree consistent. Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: Output stripe dev uuidQu Wenruo2015-11-03
| | | | | | | | | Add output for dev uuid for print_chunk(). Quite useful to debug temporary btrfs in btrfs-convert. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print root item's last_snapshot valueLakshmipathi.G2015-11-02
| | | | | | | | Include last_snapshot value in print_root(). With btrfs-debug-tree, it helps to identify whether its a snapshot-ed subvolume or not. Signed-off-by: Lakshmipathi.G <Lakshmipathi.G@giis.co.in> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: print-tree: print stripe len of a chunkQu Wenruo2015-08-31
| | | | | | | | | | | | Although it is fixed to BTRFS_STRIPE_LEN(64K) now, it's still used in a lot of code, just output it for user who wants to trace the source of stripe_len in btrfs_map_bio() code. Reported-by: Chris Murphy <lists@colorremedies.com> Reported-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Add nbytes output for print-tree and reformat inode outputQu Wenruo2015-06-26
| | | | | | | | | | | The original implementation doesn't output the nbytes for an inode. Add the output and since the output is too long, reformat it to multi lines. This is very handy to debug related bugs. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>