summaryrefslogtreecommitdiff
path: root/root-tree.c
Commit message (Collapse)AuthorAge
* btrfs-progs: add btrfs_clear_free_space_tree() from the kernelOmar Sandoval2016-11-23
| | | | | | Reviewed-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: handle errors from btrfs_alloc_pathDavid Sterba2016-09-21
| | | | | | | All functions already return an error condition, so the callers should expect that. Signed-off-by: David Sterba <dsterba@suse.com>
* Btrfs-progs: free path if we don't find root itemRakesh Pandit2014-03-21
| | | | | | | | | | In btrfs_find_last_root before returning with -ENOENT (if root item is not found) free path and also remove btrfs_release_path before btrfs_free_path because btrfs_free_path anyway calls it. Signed-off-by: Rakesh Pandit <rakesh@tuxera.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
* Btrfs-progs: just return -ENOENT if we don't find the root itemJosef Bacik2013-10-24
| | | | | | | | We were bug_on(slot == 0), but that's just obnoxious, return -ENOENT so we can handle the situation properly. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* btrfs-progs: mark static & remove unused from shared kernel codeEric Sandeen2013-09-03
| | | | | | | | | | | In files copied from the kernel, mark many functions as static, and remove any resulting dead code. Some functions are left unmarked if they aren't static in the kernel tree. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* btrfs-progs: drop unused parameter from btrfs_release_pathEric Sandeen2013-09-03
| | | | | | | | | | | | | | | Port of commit b3b4aa7 to userspace. parameter tree root it's not used since commit 5f39d397dfbe140a14edecd4e73c34ce23c4f9ee ("Btrfs: Create extent_buffer interface for large blocksizes") This gets userspace a tad closer to kernelspace by removing this unused parameter that was all over the codebase... Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: add missing path alloc return value checkFilipe David Borba Manana2013-08-09
| | | | | | | | | Also remove unused path in extent-tree.c:finish_current_insert(). Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com> Reviewed-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: remove some dead/unbuilt codeEric Sandeen2013-08-09
| | | | | | | | | | | | | | | | | Remove some commented-out & #if 0'd code: * close_blocks() * btrfs_drop_snapshot() * btrfs_realloc_node() * btrfs_find_dead_roots() There are still some #if 0'd functions in there, but I'm hedging on those for now, they have been copied to cmds-check.c and I want to see if they can be brough back into ctree.c eventually. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* btrfs-progs: update generation_v2 in btrfs_update_rootEric Sandeen2013-04-23
| | | | | | | | | | | | | | This addresses the same issue as did: 2bd1169 btrfs-progs: root_item generation_v2 is out of sync after btrfsck but rather than optionally updating generation_v2 based on the size of the existing item, increase the size of the item as needed, and unconditionally set generation_v2. This matches the kernel code, and keeping things in sync is a Good Thing. Signed-off-by: Eric Sandeen <sandeen@redhat.com>
* btrfs-progs: set generation_v2 any time we write a new rootEric Sandeen2013-04-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this integration branch commit in place: 2bd1169 btrfs-progs: root_item generation_v2 is out of sync after btrfsck I started seeing generation mismatch messages from the kernel at mount time, after a fresh mkfs(!): btrfs: mismatching generation and generation_v2 found in root item... This is because the code which emits the warning does not do so if there is a mismatch but generation_v2 is 0; the above commit began setting generation_v2 to something non-zero, so the warning was emitted. The reason there is a mismatch at all is because mkfs.btrfs calls create_data_reloc_tree(), which copies a root, and then calls btrfs_set_root_generation(), bumping the original copied generation. But nothing updated generation_v2 to match on the way to disk. Fix this by updating generation_v2 in btrfs_insert_root(), as is done in the kernel. This is safe because it's a new root created by userspace, so the btrfs_root_item is guaranteed to be big enough to contain generation_v2. Signed-off-by: Eric Sandeen <sandeen@redhat.com>
* btrfs-progs: code cleanup for root-tree.c/btrfs_del_rootWang Sheng-Hui2013-02-07
| | | | | | | Remove the redundant if check on the condition ret > 0. Leave BUG_ON check here. Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
* Btrfs-progs: return an error if we can't find an fs rootJosef Bacik2013-02-07
| | | | | | | | | | | Instead of doing a BUG_ON() if we fail to find the last fs root just return an error so the callers can deal with it how they like. Also we need to actually return an error if we can't find the latest root so that the error handling works. With this btrfsck was able to deal with a file system that was missing a root item but still had extents that referred back to the root. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com>
* Btrfs: update converter for the new disk formatYan Zheng2008-12-17
| | | | | | | | | | | This patch updates the ext3 to btrfs converter for the new disk format. This mainly involves changing the convert's data relocation and free space management code. This patch also ports some functions from kernel module to btrfs-progs. Thank you, Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
* Add disk format requirements for subvol backward and forward refsChris Mason2008-11-18
|
* btrfs-progs: Fix printf format casting errorsAlex Chiang2008-04-01
| | | | | | | | | | | We get lots of warnings of the flavor: utils.c:441: warning: format '%Lu' expects type 'long long unsigned int' but argument 2 has type 'u64' And thanks to -Werror, the build fails. Clean up these printfs by properly casting the arg to the format specified. Signed-off-by: Alex Chiang <achiang@hp.com>
* Update btrfs-progs to match kernel sourcesYan2008-01-04
|
* Allow large blocksChris Mason2007-10-15
|
* disk format updates for finding dead rootsChris Mason2007-06-22
|
* add GPLv2Chris Mason2007-06-12
|
* transaction handles everywhereChris Mason2007-03-16
|
* Use a chunk of the key flags to record the item type.Chris Mason2007-03-15
| | | | | | Add (untested and simple) directory item code Fix comp_keys to use the new key ordering Add btrfs_insert_empty_item
* variable block size supportChris Mason2007-03-14
|
* Change the super to point to a tree of trees to enable persistent snapshotsChris Mason2007-03-13