summaryrefslogtreecommitdiff
path: root/extent-tree.c
Commit message (Collapse)AuthorAge
* Check for RAID10 in set_avail_alloc_bitsChris Mason2011-04-22
| | | | | | | | | | | | | When raid is setup with mkfs, it is supposed to cow the initial filesystem it creates up to the desired raid level. RAID10 was not in the list of RAID levels it checked for, so the initial FS created for RAID10 actually only lived on the first disk. This works well enough because all the roots get quickly cowed during the first mount. The exception is the data relocation tree, which only gets cowed when we do a balance. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Check duplicate backrefs for both data and metadataYan Zheng2009-06-11
| | | | | | | | | | lookup_inline_extent_backref only checks for duplicate backref for data extent. It assumes backrefs for tree block never conflict. This patch makes lookup_inline_extent_backref check duplicate backrefs for both data and tree block, so that we can detect potential bug earlier. Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Make sure all dirty blocks are written at commit timeYan Zheng2009-06-08
| | | | | | | | | Write dirty block groups may make some block groups dirty. This patch make btrfs_write_dirty_block_groups properly handle the recursion. 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>
* Mixed back reference (FORWARD ROLLING FORMAT CHANGE)Chris Mason2009-06-08
| | | | | | | | | | | | | | | | | This commit introduces a new kind of back reference for btrfs metadata. Once a filesystem has been mounted with this commit, IT WILL NO LONGER BE MOUNTABLE BY OLDER KERNELS. The new back ref provides information about pointer's key, level and in which tree the pointer lives. This information allow us to find the pointer by searching the tree. The shortcoming of the new back ref is that it only works for pointers in tree blocks referenced by their owner trees. This is mostly a problem for snapshots, where resolving one of these fuzzy back references would be O(number_of_snapshots) and quite slow. The solution used here is to use the fuzzy back references in the common case where a given tree block is only referenced by one root, and use the full back references when multiple roots have a reference
* Fix printf format casting errorsLuca Bruno2009-06-03
| | | | | | | | | | | | There are still some warnings of the form: format '%llu' expects type 'long long unsigned int' but argument has type 'u64' In conjunction with -Werror, this is causing some build failures. Now they're properly casted, avoiding compiler warnings. Signed-off-by: Luca Bruno <lucab@debian.org> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add semantic checks to btrfsck for files and directoriesYan Zheng2009-01-07
| | | | | | | | | | | | | | | | This patch makes btrfsck check more things, including directory items, file extents, checksumming, inode link counts etc. The code for these checks is similar to the code verifies extent back references. The main difference is that shared tree blocks are treated specially. The partial checking results(unresolved references and/or errors) of shared sub-trees are cached. This avoids scanning the shared blocks several times. Thank you, 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>
* superblock duplicationYan Zheng2008-12-05
| | | | | | | | | | This patch updates btrfs-progs for superblock duplication. Note: I didn't make this patch as complete as the one for kernel since updating the converter requires changing the code again. Thank you, Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
* update btrfs-progs for seed device supportYan Zheng2008-11-18
| | | | | | | | | | | | This patch does the following: 1) Update device management code to match the kernel code. 2) Allocator fixes. 3) Add a program called btrfstune to set/clear the SEEDING super block flags.
* Remove offset field from struct btrfs_extent_refYan Zheng2008-10-09
| | | | | | | | | | | | | | The offset field in struct btrfs_extent_ref records the position inside file that file extent is referenced by. In the new back reference system, tree leaves holding reference to file extent are recorded explicitly. We can quickly scan these tree leaves, so the offset field is not required. This patch also makes the back reference system check the objectid when extents are being deleted Signed-off-by: Yan Zheng <zheng.yan@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.
* Verify parent generation number on btree readsChris Mason2008-05-13
|
* Pass down the expected generation number when reading tree blocksChris Mason2008-05-12
|
* 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.
* Fix balance_level to free the middle block if there is room in the left oneChris Mason2008-04-24
| | | | | | balance level starts by trying to empty the middle block, and then pushes from the right to the middle. This might empty the right block and leave a small number of pointers in the middle.
* 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 chunk uuids and update multi-device back referencesChris Mason2008-04-15
| | | | | | | | | | | | | | | | | | Block headers now store the chunk tree uuid Chunk items records the device uuid for each stripes Device extent items record better back refs to the chunk tree Block groups record better back refs to the chunk tree The chunk tree format has also changed. The objectid of BTRFS_CHUNK_ITEM_KEY used to be the logical offset of the chunk. Now it is a chunk tree id, with the logical offset being stored in the offset field of the key. This allows a single chunk tree to record multiple logical address spaces, upping the number of bytes indexed by a chunk tree from 2^64 to 2^128.
* Don't allow written blocks from this transaction to be reallocatedChris Mason2008-04-04
| | | | | | | | | | | | When a block is freed, it can be immediately reused if it is from the current transaction. But, an extra check is required to make sure the block had not been written yet. If it were reused after being written, the transid in the block header might match the transid of the next time the block was allocated. The parent node records the transaction ID of the block it is pointing to, and this is used as part of validating the block on reads. So, there can only be one version of a block per transaction.
* Recow all roots at the end of mkfsChris Mason2008-04-04
| | | | | | The mkfs code bootstraps the filesystem on a single device. Once the raid block groups are setup, it needs to recow all of the blocks so that each tree is properly allocated.
* Add support for single single duplication of metadataChris Mason2008-04-03
|
* Add mirroring support across multiple drivesChris Mason2008-04-03
|
* btrfs-progs: Fix printf format casting errorsAlex Chiang2008-04-01
| | | | | | | | | | | We get lots of warnings of the flavor: utils.c:441: warning: format '%Lu' expects type 'long long unsigned int' but argument 2 has type 'u64' And thanks to -Werror, the build fails. Clean up these printfs by properly casting the arg to the format specified. Signed-off-by: Alex Chiang <achiang@hp.com>
* Implement raid0 when multiple devices are presentChris Mason2008-03-25
| | | | This defaults to striping across all devices
* Walk all block devices looking for btrfsChris Mason2008-03-24
|
* Dynamic chunk allocationChris Mason2008-03-24
|
* Add support for multiple devices per filesystemChris Mason2008-03-24
|
* Remove extent back refs in batches, and avoid duplicate searchesChris Mason2008-03-04
|
* Add debugging for block group update failureChris Mason2008-02-04
|
* Insert extent record and the first backref in a single balanceChris Mason2008-03-04
|
* Tune readahead during defrag to avoid reading too much at onceChris Mason2008-01-24
|
* Rename the extent_map code to extent_ioChris Mason2008-03-04
| | | | This mirrors the changes in the kernel code.
* Hash in the owner and offset for file extent backref keysChris Mason2008-02-01
|
* A few update for btrfs-progsYan2008-01-08
| | | | | | | Hello, This patch adds inode flags definition to btrfs-progs and updates extent-tree.c to match the kernel.
* Update find_free_extent for the ext3 conversion toolYan2008-01-04
| | | | | This patch adds customized find_free_extent support to btrfs-progs, the conversion program requires this.
* Update btrfs-progs to match kernel sourcesYan2008-01-04
|
* Add back pointers from extents to the file or btree referencing themChris Mason2007-12-11
|
* Add generation numbers to block pointersChris Mason2007-12-09
|
* Update btrfs-progs to better match the kernelYan2007-12-05
|
* Add simple stripe size parameterChris Mason2007-11-30
|
* properly init block group cache structsChris Mason2007-10-19
|
* Remove the last radix tree (block_group_cache)Chris Mason2007-10-17
|
* Create a slightly more generic extent-caching structureChris Mason2007-10-15
|
* Switch to byte granular allocationsChris Mason2007-10-15
|
* Stop using radix trees to record pending allocationsChris Mason2007-10-15
|
* Allow large blocksChris Mason2007-10-15
|
* Make btrfs-progs compile with -fstrict-aliasing (included in -O2) again.Jan Engelhardt2007-09-14
| | | | | | | | | This is done by doing a two-step conversion (rather than a one-step). First, the variable goes from type * to void *, and then to implicitly to void **. (Not sure if this is "good practice", but it shuts up the compiler, so it seems the compiler takes into account that we are actually punning it this way.)
* btrfs-progs support for root block accountingJosef Bacik2007-08-29
| | | | | | This adds support for keeping track of the number of blocks used by root_item's. This makes it so that mkfs lays down the "default" subvol with the correct block accounting in place. Thank you,
* add GPLv2Chris Mason2007-06-12
|
* printf cleanupsChris Mason2007-06-12
|