summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/free-space-cache.h
diff options
context:
space:
mode:
authorLi Dongyang <lidongyang@novell.com>2011-03-24 11:24:28 +0100
committerroot <Chris Mason chris.mason@oracle.com>2011-03-28 11:37:47 +0200
commitf7039b1d5c32241f87a513e33120db36bf30264d (patch)
treee911bc79c795fceb3e9a618d8f18571c2a776307 /fs/btrfs/free-space-cache.h
parentBtrfs: adjust btrfs_discard_extent() return errors and trimmed bytes (diff)
downloadlinux-f7039b1d5c32241f87a513e33120db36bf30264d.tar.xz
linux-f7039b1d5c32241f87a513e33120db36bf30264d.zip
Btrfs: add btrfs_trim_fs() to handle FITRIM
We take an free extent out from allocator, trim it, then put it back, but before we trim the block group, we should make sure the block group is cached, so plus a little change to make cache_block_group() run without a transaction. Signed-off-by: Li Dongyang <lidongyang@novell.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/free-space-cache.h')
-rw-r--r--fs/btrfs/free-space-cache.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/free-space-cache.h b/fs/btrfs/free-space-cache.h
index e49ca5c321b5..65c3b935289f 100644
--- a/fs/btrfs/free-space-cache.h
+++ b/fs/btrfs/free-space-cache.h
@@ -68,4 +68,6 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group_cache *block_group,
int btrfs_return_cluster_to_free_space(
struct btrfs_block_group_cache *block_group,
struct btrfs_free_cluster *cluster);
+int btrfs_trim_block_group(struct btrfs_block_group_cache *block_group,
+ u64 *trimmed, u64 start, u64 end, u64 minlen);
#endif