aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2010-12-17 01:21:50 -0500
committerLi Zefan <lizf@cn.fujitsu.com>2010-12-22 10:15:45 -0500
commit261507a02ccba9afda919852263b6bc1581ce1ef (patch)
treec16bc657ff4e29a87042ceb379487f24dff01035 /fs/btrfs/file.c
parent4b72029dc3fd6ba7dc45ccd1cf0aa0ebfa209bd3 (diff)
btrfs: Allow to add new compression algorithm
Make the code aware of compression type, instead of always assuming zlib compression. Also make the zlib workspace function as common code for all compression types. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 66836d85763b..05df688c96f4 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -224,6 +224,7 @@ int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end,
224 224
225 split->bdev = em->bdev; 225 split->bdev = em->bdev;
226 split->flags = flags; 226 split->flags = flags;
227 split->compress_type = em->compress_type;
227 ret = add_extent_mapping(em_tree, split); 228 ret = add_extent_mapping(em_tree, split);
228 BUG_ON(ret); 229 BUG_ON(ret);
229 free_extent_map(split); 230 free_extent_map(split);
@@ -238,6 +239,7 @@ int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end,
238 split->len = em->start + em->len - (start + len); 239 split->len = em->start + em->len - (start + len);
239 split->bdev = em->bdev; 240 split->bdev = em->bdev;
240 split->flags = flags; 241 split->flags = flags;
242 split->compress_type = em->compress_type;
241 243
242 if (compressed) { 244 if (compressed) {
243 split->block_len = em->block_len; 245 split->block_len = em->block_len;