diff options
author | Qu Wenruo <quwenruo@cn.fujitsu.com> | 2015-10-12 00:08:16 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-10-21 21:37:43 -0400 |
commit | ac46777213e00e26b9210060586f473368c54da2 (patch) | |
tree | e4e2b6758fb57e53fc0cec268dd133955ee7e615 /fs/btrfs/extent_io.h | |
parent | a408365c62762c30419018587cffd2b89836434e (diff) |
btrfs: extent_io: Introduce needed structure for recoding set/clear bits
Add a new structure, extent_change_set, to record how many bytes are
changed in one set/clear_extent_bits() operation, with detailed changed
ranges info.
This provides the needed facilities for later qgroup reserve framework.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/extent_io.h')
-rw-r--r-- | fs/btrfs/extent_io.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index c668f36898d3..3107a6eb8e78 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __EXTENTIO__ | 2 | #define __EXTENTIO__ |
3 | 3 | ||
4 | #include <linux/rbtree.h> | 4 | #include <linux/rbtree.h> |
5 | #include "ulist.h" | ||
5 | 6 | ||
6 | /* bits for the extent state */ | 7 | /* bits for the extent state */ |
7 | #define EXTENT_DIRTY (1U << 0) | 8 | #define EXTENT_DIRTY (1U << 0) |
@@ -161,6 +162,17 @@ struct extent_buffer { | |||
161 | #endif | 162 | #endif |
162 | }; | 163 | }; |
163 | 164 | ||
165 | /* | ||
166 | * Structure to record how many bytes and which ranges are set/cleared | ||
167 | */ | ||
168 | struct extent_changeset { | ||
169 | /* How many bytes are set/cleared in this operation */ | ||
170 | u64 bytes_changed; | ||
171 | |||
172 | /* Changed ranges */ | ||
173 | struct ulist *range_changed; | ||
174 | }; | ||
175 | |||
164 | static inline void extent_set_compress_type(unsigned long *bio_flags, | 176 | static inline void extent_set_compress_type(unsigned long *bio_flags, |
165 | int compress_type) | 177 | int compress_type) |
166 | { | 178 | { |