summaryrefslogtreecommitdiff
path: root/free-space-cache.h
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2016-10-13 17:22:26 +0800
committerDavid Sterba <dsterba@suse.com>2016-11-09 13:12:47 +0100
commiteb8a61b235ad035cc474bef78e10453ec3d11d72 (patch)
treeec41a685063f7a315e728abeeef31afd4031d110 /free-space-cache.h
parent08d31c1c7ca5a6bb4e6485fa118c552c938e9efb (diff)
btrfs-progs: check: add support to clear v1 free space cache
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>
Diffstat (limited to 'free-space-cache.h')
-rw-r--r--free-space-cache.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/free-space-cache.h b/free-space-cache.h
index 9214077a..707fb6d3 100644
--- a/free-space-cache.h
+++ b/free-space-cache.h
@@ -59,4 +59,6 @@ void unlink_free_space(struct btrfs_free_space_ctl *ctl,
struct btrfs_free_space *info);
int btrfs_add_free_space(struct btrfs_free_space_ctl *ctl, u64 offset,
u64 bytes);
+int btrfs_clear_free_space_cache(struct btrfs_fs_info *fs_info,
+ struct btrfs_block_group_cache *bg);
#endif