Commit Graph

37 Commits

Author SHA1 Message Date
Arne Jansen
89fe5b5f66 Btrfs progs: quota groups support
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Arne Jansen <sensille@gmx.net>
2012-09-04 11:15:49 +02:00
Chris Mason
e7580bb296 Add open_ctree_fs_info for partial FS opens
fsck needs to be able to open a damaged FS, which means open_ctree needs
to be able to return a damaged FS.

This adds a new open_ctree_fs_info which can be used to open any and all
roots that are valid.  btrfs-debug-tree is changed to use it.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
2012-02-05 16:11:48 -05:00
Chris Mason
13eced9a0c Btrfs: add the tree history log to btrfs-progs
This also adds btrfs-debug-tree -R to print the history

Signed-off-by: Chris Mason <chris.mason@oracle.com>
2011-11-05 14:58:41 -04:00
Chris Mason
b670b9285e btrfs-debug-tree: add -r option to print only the roots
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2011-10-27 17:42:26 -04:00
Anton Blanchard
fa81a569ac btrfs-progs: cast u64 to long long to avoid printf warnings
When building on ppc64 I hit a number of warnings in printf:

btrfs-map-logical.c:69: error: format ‘%Lu’ expects type ‘long long
unsigned int’, but argument 4 has type ‘u64’

Fix them.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:57 -04:00
Chris Ball
fcdc0929c6 Fix unused-but-set errors in gcc-4.6
gcc-4.6 (as shipped in Fedora) turns on -Wunused-but-set-variable by
default, which breaks the build when combined with -Wall, e.g.:

debug-tree.c: In function ‘print_extent_leaf’:
debug-tree.c:45:13: error: variable ‘last_len’ set but not used [-Werror=unused-but-set-variable]
debug-tree.c:44:13: error: variable ‘last’ set but not used [-Werror=unused-but-set-variable]
debug-tree.c:41:21: error: variable ‘item’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

This patch fixes the errors by removing the unused variables.

Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
2011-10-25 09:18:32 -04:00
Miao Xie
b4d668ee6b btrfs-progs: fix wrong extent buffer size when reading tree block
the root extent buffer of a tree may not be a leaf, so we must get the right
size by its level when reading it.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2011-10-25 09:18:31 -04:00
Chris Mason
1b444cd2e6 btrfs-debug-tree: add -d option to print only the device mapping
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2010-10-06 09:53:38 -04:00
Chris Mason
075587c96c Btrfs: add btrfs-debug-tree -b <block number> to print a single block 2010-04-06 09:30:17 -04:00
Chris Mason
95d3f20b51 Mixed back reference (FORWARD ROLLING FORMAT CHANGE)
This commit introduces a new kind of back reference for btrfs metadata.
Once a filesystem has been mounted with this commit, IT WILL NO LONGER
BE MOUNTABLE BY OLDER KERNELS.

The new back ref provides information about pointer's key, level and in which
tree the pointer lives. This information allow us to find the pointer by
searching the tree. The shortcoming of the new back ref is that it only works
for pointers in tree blocks referenced by their owner trees.

This is mostly a problem for snapshots, where resolving one of these fuzzy back
references would be O(number_of_snapshots) and quite slow.  The solution used
here is to use the fuzzy back references in the common case where a given tree
block is only referenced by one root, and use the full back references when
multiple roots have a reference
2009-06-08 13:30:36 -04:00
Shen Feng
61907d4e81 Update btrfs-debug-tree to output more readable strings.
output objectid in btrfs_disk_key with human readable strings.
Other updates are included for more readable output.

Thanks Fengguang's fix to this patch.

Signed-off-by: Shen Feng <shen@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-06-03 12:15:40 -04:00
Chris Mason
cc04d99e90 Add scan of the btrfs log tree to btrfs-debug-tree 2009-04-15 14:30:14 -04:00
Shen Feng
52b14673e6 debug-tree output tree/key type instead of id
This makes the tree name and key type output more readable.

Signed-off-by: Shen Feng <shen@cn.fujitsu.com>
2009-01-07 14:57:12 -05:00
Yan Zheng
5986faaf47 Remove offset field from struct btrfs_extent_ref
The offset field in struct btrfs_extent_ref records the position
inside file that file extent is referenced by. In the new back
reference system, tree leaves holding reference to file extent
are recorded explicitly. We can quickly scan these tree leaves, so the
offset field is not required.

This patch also makes the back reference system check the objectid
when extents are being deleted

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
2008-10-09 11:55:30 -04:00
Zheng Yan
428b7fa630 Full back reference support
This patch makes the back reference system to explicit record the
location of parent node for all types of extents. The location of
parent node is placed into the offset field of backref key. Every
time a tree block is balanced, the back references for the affected
lower level extents are updated.
2008-09-23 12:29:10 -04:00
Chris Mason
9864c90760 Print the version string in a few programs 2008-07-24 12:13:30 -04:00
Chris Mason
9a9bdd6047 Pass down the expected generation number when reading tree blocks 2008-05-12 13:51:24 -04:00
Chris Mason
a62332eeb2 Add a readonly flag open_ctree to force RO opens 2008-05-05 09:45:26 -04:00
Chris Mason
510be29677 Add support for multiple devices per filesystem 2008-03-24 15:03:18 -04:00
Chris Mason
79599947bf Add debug-tree -e to print all allocated extents, and show-blocks to graph them 2008-03-03 19:55:16 -05:00
Yan
7777e63b42 Update btrfs-progs to match kernel sources 2008-01-04 10:38:22 -05:00
Chris Mason
38f79f9077 Switch to byte granular allocations 2007-10-15 16:25:14 -04:00
Chris Mason
f12d799856 Allow large blocks 2007-10-15 16:24:39 -04:00
Chris Mason
d9f1317c7d add GPLv2 2007-06-12 09:07:11 -04:00
Chris Mason
38ef945266 printf cleanups 2007-06-12 08:08:04 -04:00
Chris Mason
b53a236c3e remove device tree 2007-06-09 09:22:37 -04:00
Chris Mason
d23ea8706c early support for multiple devices 2007-04-11 13:57:55 -04:00
Chris Mason
1b4ca380ed drop the inode map tree 2007-04-10 12:13:29 -04:00
Chris Mason
43f6ab83bf btrfsctl 2007-04-10 09:27:30 -04:00
Chris Mason
d785b7d058 uuids 2007-04-05 14:29:12 -04:00
Chris Mason
b55672a2a1 Better block record keeping, real mkfs 2007-03-20 20:35:03 -04:00
Chris Mason
099f1ae6e4 Add inode map, and the start of file extent items 2007-03-20 14:38:32 -04:00
Chris Mason
f247156e4f transaction handles everywhere 2007-03-16 16:20:31 -04:00
Chris Mason
d9c9960f8d Change the super to point to a tree of trees to enable persistent snapshots 2007-03-13 16:47:54 -04:00
Chris Mason
aa60202f13 rename funcs and structs to btrfs 2007-03-13 10:46:10 -04:00
Chris Mason
9b4f51240c Add sparse checking to Makefile 2007-02-28 09:40:58 -05:00
Chris Mason
8f3b86bae3 Add fsx-style randomized tree tester
Add debug-tree command to print the tree
Add extent-tree.c to the repo
Comment ctree.h
2007-02-26 10:40:21 -05:00