diff options
author | Li Dongyang <lidongyang@novell.com> | 2011-03-24 13:24:28 +0300 |
---|---|---|
committer | root <Chris Mason chris.mason@oracle.com> | 2011-03-28 13:37:47 +0400 |
commit | f7039b1d5c32241f87a513e33120db36bf30264d (patch) | |
tree | e911bc79c795fceb3e9a618d8f18571c2a776307 /fs/btrfs/free-space-cache.h | |
parent | 5378e60734f5b7bfe1b43dc191aaf6131c1befe7 (diff) | |
download | linux-f7039b1d5c32241f87a513e33120db36bf30264d.tar.xz |
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.h | 2 |
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 |