summaryrefslogtreecommitdiff
path: root/fs/btrfs/extent-tree.c
AgeCommit message (Collapse)AuthorFilesLines
2008-09-25Btrfs: Add data block hints to SSD mode tooChris Mason1-12/+16
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Do delalloc accounting via hooks in the extent_state codeChris Mason1-6/+0
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Tune readahead during defrag to avoid reading too much at onceChris Mason1-13/+28
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Split the extent_map code into two partsChris Mason1-22/+21
There is now extent_map for mapping offsets in the file to disk and extent_io for state tracking, IO submission and extent_bufers. The new extent_map code shifts from [start,end] pairs to [start,len], and pushes the locking out into the caller. This allows a few performance optimizations and is easier to use. A number of extent_map usage bugs were fixed, mostly with failing to remove extent_map entries when changing the file. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add mount -o ssd, which includes optimizations for seek free storageChris Mason1-1/+30
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix extent_buffer usage when nodesize != leafsizeChris Mason1-3/+10
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: online shrinking fixesChris Mason1-9/+23
While shrinking the FS, the allocation functions need to make sure they don't try to allocate bytes past the end of the FS. nodatacow needed an extra check to force cows when the existing extents are past the end of the FS. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Disable btree reada during extent backref lookups.Chris Mason1-0/+4
This reada is generally not effective. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add data=ordered supportChris Mason1-1/+3
This forces file data extents down the disk along with the metadata that references them. The current implementation is fairly simple, and just writes out all of the dirty pages in an inode before the commit. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: resizer: don't hold the fs_mutex for long periods of timeChris Mason1-1/+21
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Properly call btrfs_search_slot while shrinkingChris Mason1-1/+9
The shrinking code used btrfs_next_leaf to find the next item, but this does not cow the blocks it touches. This fix calls search_slot after finding the next item to do appropriate cow and balancing. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Properly handle overlapping extent in shrink_extent_treeYan1-84/+56
The patch fixes the overlapping extent issue in shrink_extent_tree. It checks whether there is an overlapping extent by using find_previous_extent. If there is an overlapping extent, it setups key.objectid and cur_byte properly. --- Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add a helper that finds previous extent itemYan1-44/+36
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25count_snapshots: Properly update the leaf pointer after btrfs_next_leafChris Mason1-2/+2
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Force inlining off in a few places to save stack usageChris Mason1-29/+37
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: 32 bit compile fixes for the resizer and enospc checksChris Mason1-1/+3
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Reduce stack usage in the resizer, fix 32 bit compilesChris Mason1-36/+38
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Explicitly send a root objectid to count_snapshots_in_pathChris Mason1-10/+6
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add readahead to the online shrinker, and a mount -o alloc_start= for ↵Chris Mason1-4/+5
testing Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix NULL block groups on reading the inodeChris Mason1-2/+2
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Support for online FS resize (grow and shrink)Chris Mason1-0/+480
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add mount option to turn off data cowChris Mason1-3/+98
A number of workloads do not require copy on write data or checksumming. mount -o nodatasum to disable checksums and -o nodatacow to disable both copy on write and checksumming. In nodatacow mode, copy on write is still performed when a given extent is under snapshot. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Reorder extent back refs to differentiate btree blocks from file dataChris Mason1-8/+8
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Fix btrfs_inc_ref to add backref hintsChris Mason1-2/+4
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Extra NULL block group checks in find_free_extentChris Mason1-0/+6
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add lowest key information to back refs for extent tree blocks as well.Chris Mason1-1/+101
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add back pointers from extents to the btree or file referencing themChris Mason1-62/+311
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Implement generation numbers in block pointersChris Mason1-2/+58
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix extent allocation for btree blocks as the disk fillsChris Mason1-11/+17
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add simple stripe size parameterChris Mason1-8/+28
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25btrfs_drop_extents: make sure the item is getting smaller before truncateChris Mason1-0/+8
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Handle writeback under high memory pressure betterChris Mason1-1/+1
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add check for null block group to find_search_startChris Mason1-0/+3
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Off by one fixes for extent-tree.cYan1-7/+3
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add full_scan parameter to find_search_startYan1-8/+6
This patch adds a new parameter 'full_scan' to 'find_search_start', thereby 'find_search_start' can know whether 'find_free_extent' is in full scan phrase. I feel that 'find_search_start' should skip calling 'btrfs_find_block_group' when 'find_free_extent' is in full scan phrase. In my test on a 2GB volume, Oops occurs when space usage is about 76%. After apply the patch, Oops occurs when space usage is near 100%. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add block group pinned accounting backYan1-14/+40
This patch adds a helper function 'update_pinned_extents' to extent-tree.c. The usage of the helper function is similar to 'update_block_group', the last parameter of the function indicates pin vs unpin. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Allow large data extents in a single file to span into metadata block ↵Chris Mason1-6/+30
groups Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Optimize allocations as we need to mix data and metadata into one groupChris Mason1-6/+36
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Properly update free space cache in __free_extentYan1-2/+4
When pin_down_bytes decides not to pin a block because it was from the current transaction, make sure the in memory cache of free extents is updated Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix typo and memory leak in extent-tree.cYan1-6/+8
This patch fixes a typo in update_block_group and memory leak in btrfs_free_block_groups. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25btrfs: 32-bit type problemsJens Axboe1-4/+4
An assorted set of casts to get rid of the warnings on 32-bit archs. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add back metadata checksummingChris Mason1-0/+4
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Breakout BTRFS_SETGET_FUNCS into a separate C file, the inlines were too big.Chris Mason1-1/+1
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add an extent buffer LRU to reduce radix tree hitsChris Mason1-1/+0
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix allocation routines to avoid intermixing data and metadata ↵Chris Mason1-16/+22
allocations Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add back the online defragging codeChris Mason1-7/+1
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Allow tree blocks larger than the page sizeChris Mason1-138/+147
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Change the remaining radix trees used by extent-tree.c to extent_map ↵Chris Mason1-121/+72
trees Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Stop using radix trees for the block group cacheChris Mason1-214/+148
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix extent_buffer and extent_state leaksChris Mason1-68/+58
Signed-off-by: Chris Mason <chris.mason@oracle.com>