summaryrefslogtreecommitdiff
path: root/free-space-cache.h
Commit message (Collapse)AuthorAge
* btrfs-progs: check: add support to clear v1 free space cacheQu Wenruo2016-11-09
| | | | | | | | | | | | | | | | Kernel clear_cache mount option will only rebuild free space cache if the used space of that chunk has changed. So it won't ensure any corrupted free space cache get cleared. So add a new option "--clear-space-cache v1|v2" to btrfsck, to completely wipe out free space cache. So kernel won't complain again. Reported-by: Ivan P <chrnosphered@gmail.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ adjusted error messages, doc wording changes ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: check the free space tree in btrfsckOmar Sandoval2016-01-12
| | | | | | | | | | This reuses the existing code for checking the free space cache, we just need to load the free space tree. While we do that, we check a couple of invariants on the free space tree itself. This requires pulling in some code from the kernel to exclude the super stripes. Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: add missing includes to header filesDavid Sterba2015-06-10
| | | | | | | Add includes that let the header files compile or add explicit include of kerncompat if the uXX types are used. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: unify header file inclusion protectionsDavid Sterba2015-01-21
| | | | | | There are missing ifdefs or defines with very generic names. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: make free space checker work on non-4k sectorsize filesystemsDavid Sterba2014-10-10
| | | | | | | | | The value of sector for space cache was hardcoded to 4k, and used to calculate bitmap sizes. In kernel, the BITS_PER_BITMAP is derived from PAGE_CACHE_SIZE which is not available for userspace, that can also deal with filesystem of varying sectorsize. Signed-off-by: David Sterba <dsterba@suse.cz>
* Btrfs-progs: add a free space cache checker to fsck V2Josef Bacik2013-04-23
In trying to track down a weird tree log problem I wanted to make sure that the free space cache was actually valid, which we currently have no way of doing. So this patch adds a bunch of support for the free space cache code and then a checker to fsck. Basically we go through and if we can actually load the free space cache then we will walk the extent tree and verify that the free space cache exactly matches what is in the extent tree. Hopefully this will always be correct, the only time it wouldn't is if the extent tree is corrupt or we have some sort of awful bug in the free space cache. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com>