summaryrefslogtreecommitdiff
path: root/convert/source-fs.c
Commit message (Collapse)AuthorAge
* btrfs-progs: convert: move and rename dev_t helpers to common fileDavid Sterba2017-09-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move acl helper to common source fileDavid Sterba2017-09-08
| | | | | | There were 2 copies of ext2_acl_count and acl_ea_size. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: properly handle reserved ranges while iterating filesJeff Mahoney2017-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 522ef705e38 (btrfs-progs: convert: Introduce function to calculate the available space) changed how we handle migrating file data so that we never have btrfs space associated with the reserved ranges. This works pretty well and when we iterate over the file blocks, the associations are redirected to the migrated locations. This commit missed the case in block_iterate_proc where we just check for intersection with a superblock location before looking up a block group. intersect_with_sb checks to see if the range intersects with a stripe containing a superblock but, in fact, we've reserved the full 0-1MB range at the start of the disk. So a file block located at e.g. 160kB will fall in the reserved region but won't be excepted in block_iterate_block. We ultimately hit a BUG_ON when we fail to look up the block group for that location. This is reproducible using convert-tests/003-ext4-basic. The fix is to have intersect_with_sb and block_iterate_proc understand the full size of the reserved ranges. Since we use the range to determine the boundary for the block iterator, let's just return the boundary. 0 isn't a valid boundary and means that we proceed normally with block group lookup. Cc: Qu Wenruo <quwenruo.btrfs@gmx.com> Signed-off-by: Jeff Mahoney <jeffm@suse.com> Reviewed-by: Qu Wenruo <quwenruo.btrfs@gmx.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: Refactor sectorsize in convert/source-fs.cQu Wenruo2017-07-03
| | | | Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
* btrfs-progs: convert: Make btrfs_reserved_ranges constQu Wenruo2017-03-16
| | | | | | | | | | | | Since btrfs_reserved_ranges array is just used to store btrfs reserved ranges, no one will nor should modify them at run time, make them static and const will be better. This also eliminates the use of immediate number 3. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ definition stays in source-fs.c ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: Introduce simple range structure for convert reserved ↵Qu Wenruo2017-03-16
| | | | | | | | | | | | | | | ranges Introduce a new strucutre, simple_range, to present one contingous range. Also, use such structure to define btrfs_reserved_ranges(), which convert and rollback will use. Suggested-by: David Sterba <dsterba@suse.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ split hunks to new file structure ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: rename members that clash with other functionsDavid Sterba2017-03-08
| | | | | | Rename 'free' and also 'used' for consistency. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move struct initialization to the init functionDavid Sterba2017-03-08
| | | | | | | The context is zeroed in convert_open_fs after and overwrites the rbtree initialization, which accidentally is the same (NULL). Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move implementation for interal conversion API to own fileDavid Sterba2017-03-08
Signed-off-by: David Sterba <dsterba@suse.com>