diff options
Diffstat (limited to 'fs/btrfs/compression.h')
| -rw-r--r-- | fs/btrfs/compression.h | 20 | 
1 files changed, 8 insertions, 12 deletions
diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h index a5e3377db9ad..19ab2abeddc0 100644 --- a/fs/btrfs/compression.h +++ b/fs/btrfs/compression.h @@ -6,8 +6,8 @@  #ifndef BTRFS_COMPRESSION_H  #define BTRFS_COMPRESSION_H -#include <linux/blk_types.h>  #include <linux/sizes.h> +#include "bio.h"  struct btrfs_inode; @@ -23,6 +23,7 @@ struct btrfs_inode;  /* Maximum length of compressed data stored on disk */  #define BTRFS_MAX_COMPRESSED		(SZ_128K) +#define BTRFS_MAX_COMPRESSED_PAGES	(BTRFS_MAX_COMPRESSED / PAGE_SIZE)  static_assert((BTRFS_MAX_COMPRESSED % PAGE_SIZE) == 0);  /* Maximum size of data before compression */ @@ -37,9 +38,6 @@ struct compressed_bio {  	/* the pages with the compressed data on them */  	struct page **compressed_pages; -	/* inode that owns this data */ -	struct inode *inode; -  	/* starting offset in the inode for our pages */  	u64 start; @@ -55,14 +53,14 @@ struct compressed_bio {  	/* Whether this is a write for writeback. */  	bool writeback; -	/* IO errors */ -	blk_status_t status; -  	union {  		/* For reads, this is the bio we are copying the data into */ -		struct bio *orig_bio; +		struct btrfs_bio *orig_bbio;  		struct work_struct write_end_work;  	}; + +	/* Must be last. */ +	struct btrfs_bio bbio;  };  static inline unsigned int btrfs_compress_type(unsigned int type_level) @@ -88,16 +86,14 @@ int btrfs_decompress(int type, const u8 *data_in, struct page *dest_page,  int btrfs_decompress_buf2page(const char *buf, u32 buf_len,  			      struct compressed_bio *cb, u32 decompressed); -blk_status_t btrfs_submit_compressed_write(struct btrfs_inode *inode, u64 start, +void btrfs_submit_compressed_write(struct btrfs_inode *inode, u64 start,  				  unsigned int len, u64 disk_start,  				  unsigned int compressed_len,  				  struct page **compressed_pages,  				  unsigned int nr_pages,  				  blk_opf_t write_flags, -				  struct cgroup_subsys_state *blkcg_css,  				  bool writeback); -void btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, -				  int mirror_num); +void btrfs_submit_compressed_read(struct btrfs_bio *bbio, int mirror_num);  unsigned int btrfs_compress_str2level(unsigned int type, const char *str);  |