summaryrefslogtreecommitdiff
path: root/convert.c
Commit message (Collapse)AuthorAge
* btrfs-progs: convert: access name_len and file_type the old wayDavid Sterba2013-03-18
| | | | | | | | | | | | We can't use ext2_dir_entry_2 typecast on big endian machines directly. The bytes do not get converted during extX block read due to missing flag EXT2_DIRBLOCK_V2_STRUCT passed down to ext2fs_read_dir_block4 from ext2fs_process_dir_block. Fixing on the ext2 side needs updating callers and (maybe) the library interfaces. We'll fix it on the convert side for now. CC: Jan Kara <jack@suse.cz> Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: separate super_copy out of fs_infoDavid Sterba2013-03-10
| | | | | | | | | Allocate fs_info::super_copy dynamically of full BTRFS_SUPER_INFO_SIZE and use it directly for saving superblock to disk. This fixes incorrect superblock checksum after mkfs. Signed-off-by: David Sterba <dsterba@suse.cz>
* btrfs-progs: free resources on do_rollback error returnsEric Sandeen2013-03-10
| | | | | | close fd if open, and free allocated memory in buf Signed-off-by: Eric Sandeen <sandeen@redhat.com>
* btrfs-progs: close fd on do_convert error returnsEric Sandeen2013-03-10
| | | | | | stops an fd leak that Coverity found. Signed-off-by: Eric Sandeen <sandeen@redhat.com>
* Add basic RAID[56] supportDavid Woodhouse2013-02-01
| | | | | | | | | | | | | | | | David Woodhouse originally contributed this code, and Chris Mason changed it around to reflect the current design goals for raid56. The original code expected all metadata and data writes to be full stripes. This meant metadata block size == stripe size, and had a few other restrictions. This version allows metadata blocks smaller than the stripe size. It implements both raid5 and raid6, although it does not have code to rebuild from parity if one of the drives is missing or incorrect. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
* Btrfs-progs: Fix compiler warnings on PPC64Wade Cline2013-01-17
| | | | | | | | | | | | | | | | The kernel uses unsigned long long for u64, but PPC64 uses unsigned long by default. This results in compilation warnings such as: print-tree.c:333: warning: format '%llu' expects type 'long long unsigned int', but argument 4 has type 'u64' To fix this, the macro __KERNEL__ needs to be defined before including the file <asm/types.h>. This can be done by defining the macro in "kerncompat.h" and making it the first included file in the relevant header files; this fixes the compiler warnings on PPC64. Reviewed-by: David Sterba <dsterba@suse.cz> Signed-off-by: Wade Cline <clinew@linux.vnet.ibm.com>
* Fix btrfs-convert, btrfs-restore and btrfs-find-root buildChris Mason2012-02-08
| | | | | | | Signed-off-by: Chris Mason <chris.mason@oracle.com> fixit Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfsck: fix block group accounting during repairChris Mason2012-02-08
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs-convert: fix typo: 'all inode' -> 'all inodes'Sergei Trofimovich2011-10-25
| | | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
* Btrfs-progs use safe string manipulation functionsEduardo Silva2011-10-25
| | | | | Signed-off-by: Eduardo Silva <eduardo.silva@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* used space accounting fix for the converterYan Zheng2009-06-12
| | | | | | | | remove code that updates the total used space, since btrfs_update_block_group does that work now. Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Update converter for the new formatYan Zheng2009-06-08
| | | | | Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Update convert for uninitialized block groupsYan Zheng2009-01-21
| | | | | | | | | | | There is a new feature 'uninitialized block groups' in ext4. Block and inode bitmaps in uninitialized block groups are uninitialized. This confuses the converter. The fix is call ext2fs_new_inode for each block group at open time. It set up uninitialized block and inode bitmaps appropriately. Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
* Fix isize/nbytes update bugs in btrfs-convertYan Zheng2009-01-12
| | | | | | | These fix a few converter problems found by the new btrfsck code. Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
* Btrfs: update converter for the new disk formatYan Zheng2008-12-17
| | | | | | | | | | | This patch updates the ext3 to btrfs converter for the new disk format. This mainly involves changing the convert's data relocation and free space management code. This patch also ports some functions from kernel module to btrfs-progs. Thank you, Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
* Btrfs: move data checksumming into a dedicated treeChris Mason2008-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Btrfs stores checksums for each data block. Until now, they have been stored in the subvolume trees, indexed by the inode that is referencing the data block. This means that when we read the inode, we've probably read in at least some checksums as well. But, this has a few problems: * The checksums are indexed by logical offset in the file. When compression is on, this means we have to do the expensive checksumming on the uncompressed data. It would be faster if we could checksum the compressed data instead. * If we implement encryption, we'll be checksumming the plain text and storing that on disk. This is significantly less secure. * For either compression or encryption, we have to get the plain text back before we can verify the checksum as correct. This makes the raid layer balancing and extent moving much more expensive. * It makes the front end caching code more complex, as we have touch the subvolume and inodes as we cache extents. * There is potentitally one copy of the checksum in each subvolume referencing an extent. The solution used here is to store the extent checksums in a dedicated tree. This allows us to index the checksums by phyiscal extent start and length. It means: * The checksum is against the data stored on disk, after any compression or encryption is done. * The checksum is stored in a central location, and can be verified without following back references, or reading inodes. This makes compression significantly faster by reducing the amount of data that needs to be checksummed. It will also allow much faster raid management code in general. The checksums are indexed by a key with a fixed objectid (a magic value in ctree.h) and offset set to the starting byte of the extent. This allows us to copy the checksum items into the fsync log tree directly (or any other tree), without having to invent a second format for them. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Full back reference supportZheng Yan2008-09-23
| | | | | | | | This patch makes the back reference system to explicit record the location of parent node for all types of extents. The location of parent node is placed into the offset field of backref key. Every time a tree block is balanced, the back references for the affected lower level extents are updated.
* btrfs-convert: Iterate correctly using libext2fs functionsRadoslaw Szkodzinski2008-07-30
| | | | | | This patch corrects open-coded inode_map iteration, which happens to be illegal in new libext2fs due to inode_map being private, causing warning, which becomes a compile error.
* btrfs-convert new dir index supportYan2008-07-30
| | | | This patch updates btrfs-convert for the new dir index format.
* Verify parent generation number on btree readsChris Mason2008-05-13
|
* Add a readonly flag open_ctree to force RO opensChris Mason2008-05-05
|
* Fix btrfs-convert's large file support.Zhu2008-04-28
| | | | | | This patch add ext2_inode.i_size_high into account when calculating regular file's size in btrfs-convert, which makes it deal with large files bigger than 4GB properly.
* Speed improvement and bug fixes for ext3 converterYan Zheng2008-04-24
| | | | | | | | This patch improves converter's allocator and fixes a bug in data relocation function. The new allocator caches free blocks as Btrfs's default allocator. In testing here, the user CPU time reduced to half of the original when checksum and small file packing was disabled. This patch also enlarges the size of block groups created by the converter.
* Update the Ext3 converterChris Mason2008-04-22
| | | | | | | | | | | The main changes in this patch are adding chunk handing and data relocation ability. In the last step of conversion, the converter relocates data in system chunk and move chunk tree into system chunk. In the rollback process, the converter remove chunk tree from system chunk and copy data back. Regards YZ ---
* Add support for multiple devices per filesystemChris Mason2008-03-24
|
* Fixes for the converterYan2008-01-22
| | | | | | | | | | | | | | Hello, This patch fixes two newly found bugs in the converter. The important one is in create_ext2_image, sub-volume root directory's size not properly updated after creating the ext2 image file. The other one is a small bug in xattr support codes. In addition to the fixes, this patch moves the 'if mounted' check to main() function. Regards YZ ---
* Add readonly inode flagYan2008-01-14
| | | | | This patch adds readonly inode flag support. A file with this flag can't be modified, but can be deleted.
* xattr support for the ext3->btrfs converterYan2008-01-14
|
* Add rollback support for the converterYan2008-01-08
| | | | | | This patch adds rollback support for the converter, the converter can roll back a conversion if the image file haven't been modified. In addition, I rearrange some codes in convert.c and add a few comments.
* Add Yan Zheng's ext3->btrfs conversion programChris Mason2008-01-04
run make convert to build it, the program is named btrfs-convert and is not installed by default.