summaryrefslogtreecommitdiff
path: root/convert
Commit message (Collapse)AuthorAge
...
* btrfs-progs: convert: Add comment for the overall convert designQu Wenruo2017-03-16
| | | | | | | | | | | | | Convert is now a little complex due to that fact we need to separate metadata and data chunks for different profiles. Add a comment with ascii art explaining the whole design and point out the really complex part, so any newcomers interested in convert can get a quick overview of it before digging into the hard to read code. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> [ wording and formatting adjustments ] Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: remove unused argument from clear_extent_dirtyDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: remove unused argument from set_extent_bitsDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: remove unused argument from write_and_map_ebDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: remove unused argument from btrfs_csum_dataDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: improve assert in make_convert_btrfsDavid Sterba2017-03-08
| | | | 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: mkfs: clear whole mkfs_cfg at onceDavid Sterba2017-03-08
| | | | | | Zero out the structure and set only the requested fields. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move internal bg size definitionDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: rename ext2 function to create a symlinkDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: build: add stub makefile to convertDavid Sterba2017-03-08
| | | | | | A shortcut to compile btrfs-convert from inside the directory. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: use bit field for convert flagsDavid Sterba2017-03-08
| | | | | | | Use one flag field instead of several variables. The change cascades down to the callchain and modifies several functions. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: use helper for special inode number checkDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: better error handling in ext2_read_used_spaceDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: remove unused includesDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: use on-stack buffer for subvol name dirDavid Sterba2017-03-08
| | | | | | Get rid of dynamic allocation. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: use fixed lenght array for source fs nameDavid Sterba2017-03-08
| | | | 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: update some forward declarationsDavid Sterba2017-03-08
| | | | | | Add missing and reorder so they come next to the structures using them. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: use wider types types for inode counts for progress ↵David Sterba2017-03-08
| | | | | | reports Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs: make list of source fs more visibleDavid Sterba2017-03-08
| | | | 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>
* btrfs-progs: convert: move ext2 conversion out of main.cDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move ext2 definitions out of mainDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move definitions for interal conversion API to own fileDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: move fs features declarations to own header from utilsDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: move common api implementation to own fileDavid Sterba2017-03-08
| | | | | | Lots of moved code but no actual changes. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: move convert definitions to own headerDavid Sterba2017-03-08
| | | | | | | Create a header for filesystem conversion API, the config and the main entry function. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: move mkfs definitions to own headerDavid Sterba2017-03-08
| | | | | | | Create a header for filesystem creation API, the config and the main entry function. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: move help defines to own headerDavid Sterba2017-03-08
| | | | Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: mkfs/convert: separate the convert part from make_btrfsDavid Sterba2017-01-27
| | | | | | | The regulare mkfs_btrfs does not anything special about convert and just passes the arguments. Make that two functions. Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: file-item: Fix wrong file extents insertedQu Wenruo2016-12-21
| | | | | | | | | | | | | | | | | | | If we specify NO_HOLES incompat feature when converting, the result image still uses hole file extents. And further more, the hole is incorrect as its disk_num_bytes is not zero. The problem is at btrfs_insert_file_extent() which doesn't check if we are going to insert hole file extent. Modify it to skip hole file extents to allow it follow restrict NO_HOLES flag. And since no_holes flag can be triggered on half-way, so current fsck won't report such error, as it consider it as old file holes. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: Fix migrate_super_block() to work with 64k sectorsizeChandan Rajendra2016-12-14
| | | | | | | | | | | | | migrate_super_block() uses sectorsize to refer to the size of the superblock. Hence on 64k sectorsize filesystems, it ends up computing checksum beyond the super block length (i.e. BTRFS_SUPER_INFO_SIZE). This commit fixes the bug by using BTRFS_SUPER_INFO_SIZE instead of sectorsize of the underlying filesystem. Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com> Reviewed-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: convert: Prevent accounting blocks beyond end of deviceChandan Rajendra2016-12-14
| | | | | | | | | | | | When looping across data block bitmap, __ext2_add_one_block() may add blocks which do not exist on the underlying disk. This commit prevents this from happening by checking the block index against the maximum block count that was present in the ext4 filesystem instance that is being converted. Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com> Reviewed-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
* btrfs-progs: move btrfs-convert to own directoryDavid Sterba2016-12-14
Signed-off-by: David Sterba <dsterba@suse.com>