summaryrefslogtreecommitdiff
path: root/print-tree.c
Commit message (Collapse)AuthorAge
* 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>
* btrfs-progs: unify naming of key types in print-treeDavid Sterba2015-06-16
| | | | | | Drop the BTRFS_ prefix and _KEY suffix where applicable. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Allow btrfs-debug-tree to print human readable qgroup status flag.Qu Wenruo2015-03-24
| | | | | | | | | | | | Now btrfs-debug-tree can print qgroup status flag as ON|INCONSISTENT instead of 0x5. BTW, this patch helped us to find a bug that INCONSISTENT flag is never cleared in kernel. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [renamed to qgroup_flags_to_str] Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Update qgroup status flags and replace qgroup level/subvid ↵Qu Wenruo2015-03-24
| | | | | | | | | | | | | | calculation with inline function Ctree.h of btrfs-progs contains wrong flags for btrfs_qgroup_status. Update it with the one in kernel. Also, introduce the inline function btrfs_qgroup_(level/subvid) to get the level/subvolid of qgroup, to replace the old open-coded bit operations. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: make debug-tree spit out full_backref flagJosef Bacik2015-02-09
| | | | | | | Currently btrfs-debug-tree ignores the FULL_BACKREF flag which makes it hard to figure out problems related to FULL_BACKREF. Thanks, Signed-off-by: Josef Bacik <jbacik@fb.com>
* btrfs-progs: read_tree_block() and read_node_slot() cleanup.Qu Wenruo2015-02-02
| | | | | | | | | | | | Allow read_tree_block() and read_node_slot() to return error pointer. This should help caller to get more specified error number. For existing callers, change (!eb) judgmentt to (!extent_buffer_uptodate(eb)) to keep the compatibility, and for caller missing the check, use PTR_ERR(eb) if possible. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: debug: print more info about inodeDavid Sterba2014-10-10
| | | | | | Add uid, gid, rdev and flags to btrfs_print_leaf. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Add human readable flags output for chunk/block group type.Qu Wenruo2014-08-22
| | | | | | | | | | | Current btrfs-debug-tree output chunk/block group type as numbers, which makes it hard to understand and need to check the source to understand the meaning. This patch will convert numeric type output to human readable strings. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: Add human readable flags output string for extent flags.Qu Wenruo2014-08-22
| | | | | | | | | | | Current btrfs-debug-tree outputs extent flags as numbers, which makes it hard to understand and need to check the source to understand the meaning. This patch will convert numberic flags output to human readable strings. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>