summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorJeff Mahoney2015-06-15 15:41:19 +0200
committerChris Mason2015-07-29 17:15:29 +0200
commite33e17ee1098d8d751552ac11c111e1c1a3db014 (patch)
tree49b4c9b5c4123db86d9256a5b9122da73275d730 /fs/btrfs/super.c
parentbtrfs: explictly delete unused block groups in close_ctree and ro-remount (diff)
downloadkernel-qcow2-linux-e33e17ee1098d8d751552ac11c111e1c1a3db014.tar.gz
kernel-qcow2-linux-e33e17ee1098d8d751552ac11c111e1c1a3db014.tar.xz
kernel-qcow2-linux-e33e17ee1098d8d751552ac11c111e1c1a3db014.zip
btrfs: add missing discards when unpinning extents with -o discard
When we clear the dirty bits in btrfs_delete_unused_bgs for extents in the empty block group, it results in btrfs_finish_extent_commit being unable to discard the freed extents. The block group removal patch added an alternate path to forget extents other than btrfs_finish_extent_commit. As a result, any extents that would be freed when the block group is removed aren't discarded. In my test run, with a large copy of mixed sized files followed by removal, it left nearly 2/3 of extents undiscarded. To clean up the block groups, we add the removed block group onto a list that will be discarded after transaction commit. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Reviewed-by: Filipe Manana <fdmanana@suse.com> Tested-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index a1077e0ffaa8..8da24e242896 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -69,7 +69,7 @@ static struct file_system_type btrfs_fs_type;
static int btrfs_remount(struct super_block *sb, int *flags, char *data);
-static const char *btrfs_decode_error(int errno)
+const char *btrfs_decode_error(int errno)
{
char *errstr = "unknown";