Re: [PATCH v3 2/6] btrfs-progs: utils: Introduce basic set operations for range

2017-01-23 Thread David Sterba
On Mon, Dec 19, 2016 at 02:56:38PM +0800, Qu Wenruo wrote: > +static u64 reserved_range_starts[3] = { 0, BTRFS_SB_MIRROR_OFFSET(1), > + BTRFS_SB_MIRROR_OFFSET(2) }; > +static u64 reserved_range_lens[3] = { 1024 * 1024, 64 * 1024, 64 * 1024 }; Also anywhere in

Re: [PATCH v3 2/6] btrfs-progs: utils: Introduce basic set operations for range

2017-01-23 Thread David Sterba
On Mon, Dec 19, 2016 at 02:56:38PM +0800, Qu Wenruo wrote: > Introduce basic set operations: is_subset() and is_intersection(). > > This is quite useful to check if a range [start, start + len) subset or > intersection of another range. > So we don't need to use open code to do it, which I

[PATCH v3 2/6] btrfs-progs: utils: Introduce basic set operations for range

2016-12-18 Thread Qu Wenruo
Introduce basic set operations: is_subset() and is_intersection(). This is quite useful to check if a range [start, start + len) subset or intersection of another range. So we don't need to use open code to do it, which I sometimes do it wrong. Also use these new facilities in btrfs-convert, to