Skip to content

Commit

Permalink
btrfs: extent_io: Introduce needed structure for recoding set/clear bits
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Qu Wenruo authored and Chris Mason committed Oct 22, 2015
1 parent a408365 commit ac46777
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions fs/btrfs/extent_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define __EXTENTIO__

#include <linux/rbtree.h>
#include "ulist.h"

/* bits for the extent state */
#define EXTENT_DIRTY (1U << 0)
Expand Down Expand Up @@ -161,6 +162,17 @@ struct extent_buffer {
#endif
};

/*
* Structure to record how many bytes and which ranges are set/cleared
*/
struct extent_changeset {
/* How many bytes are set/cleared in this operation */
u64 bytes_changed;

/* Changed ranges */
struct ulist *range_changed;
};

static inline void extent_set_compress_type(unsigned long *bio_flags,
int compress_type)
{
Expand Down

0 comments on commit ac46777

Please sign in to comment.