diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2010-12-17 14:21:50 +0800 |
---|---|---|
committer | Li Zefan <lizf@cn.fujitsu.com> | 2010-12-22 23:15:45 +0800 |
commit | 261507a02ccba9afda919852263b6bc1581ce1ef (patch) | |
tree | c16bc657ff4e29a87042ceb379487f24dff01035 /fs/btrfs/ordered-data.h | |
parent | 4b72029dc3fd6ba7dc45ccd1cf0aa0ebfa209bd3 (diff) | |
download | op-kernel-dev-261507a02ccba9afda919852263b6bc1581ce1ef.zip op-kernel-dev-261507a02ccba9afda919852263b6bc1581ce1ef.tar.gz |
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/ordered-data.h')
-rw-r--r-- | fs/btrfs/ordered-data.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/btrfs/ordered-data.h b/fs/btrfs/ordered-data.h index 61dca83..ff1f69a 100644 --- a/fs/btrfs/ordered-data.h +++ b/fs/btrfs/ordered-data.h @@ -68,7 +68,7 @@ struct btrfs_ordered_sum { #define BTRFS_ORDERED_NOCOW 2 /* set when we want to write in place */ -#define BTRFS_ORDERED_COMPRESSED 3 /* writing a compressed extent */ +#define BTRFS_ORDERED_COMPRESSED 3 /* writing a zlib compressed extent */ #define BTRFS_ORDERED_PREALLOC 4 /* set when writing to prealloced extent */ @@ -93,6 +93,9 @@ struct btrfs_ordered_extent { /* flags (described above) */ unsigned long flags; + /* compression algorithm */ + int compress_type; + /* reference count */ atomic_t refs; @@ -148,6 +151,9 @@ int btrfs_add_ordered_extent(struct inode *inode, u64 file_offset, u64 start, u64 len, u64 disk_len, int type); int btrfs_add_ordered_extent_dio(struct inode *inode, u64 file_offset, u64 start, u64 len, u64 disk_len, int type); +int btrfs_add_ordered_extent_compress(struct inode *inode, u64 file_offset, + u64 start, u64 len, u64 disk_len, + int type, int compress_type); int btrfs_add_ordered_sum(struct inode *inode, struct btrfs_ordered_extent *entry, struct btrfs_ordered_sum *sum); |