aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/extent_io.c
AgeCommit message (Collapse)AuthorFilesLines
2008-09-25Btrfs: Change find_extent_buffer to use TestSetPageLockedChris Mason1-1/+6
This makes it possible for callers to check for extent_buffers in cache without deadlocking against any btree locks held. Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Start btree concurrency work.Chris Mason1-8/+0
The allocation trees and the chunk trees are serialized via their own dedicated mutexes. This means allocation location is still not very fine grained. The main FS btree is protected by locks on each block in the btree. Locks are taken top / down, and as processing finishes on a given level of the tree, the lock is released after locking the lower level. The end result of a search is now a path where only the lowest level is locked. Releasing or freeing the path drops any locks held. Signed-off-by: Chris Mason <[email protected]>
2008-09-25Fix corners in writepage and btrfs_truncate_pageChris Mason1-6/+9
The extent_io writepage calls needed an extra check for discarding pages that started on th last byte in the file. btrfs_truncate_page needed checks to make sure the page was still part of the file after reading it, and most importantly, needed to wait for all IO to the page to finish before freeing the corresponding extents on disk. Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Handle write errors on raid1 and raid10Chris Mason1-8/+41
When duplicate copies exist, writes are allowed to fail to one of those copies. This changeset includes a few changes that allow the FS to continue even when some IOs fail. It also adds verification of the parent generation number for btree blocks. This generation is stored in the pointer to a block, and it ensures that missed writes to are detected. Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Drop some verbose printksChris Mason1-8/+5
Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: write_cache_pages came in 2.6.22Chris Mason1-1/+1
Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: write_extent_pages came in 2.6.23Chris Mason1-1/+1
Signed-off-by: Chris Mason <[email protected]>
2008-09-25Fix btrfs_get_extent and get_block corner cases, and disable O_DIRECT readsChris Mason1-0/+1
The generic O_DIRECT code assumes all the bios have the same bdev, which isn't true for multi-device btrfs. Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Don't drop extent_map cache during releasepage on the btree inodeChris Mason1-11/+27
The btree inode should only have a single extent_map in the cache, it doesn't make sense to ever drop it. Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Remove bogus max_sector warnings from the extent_io codeChris Mason1-7/+0
It was testing the bio before doing logical->physical mapping, so the test was always wrong. Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Use the extent map cache to find the logical disk block during data ↵Chris Mason1-4/+8
retries The data read retry code needs to find the logical disk block before it can resubmit new bios. But, finding this block isn't allowed to take the fs_mutex because that will deadlock with a number of different callers. This changes the retry code to use the extent map cache instead, but that requires the extent map cache to have the extent we're looking for. This is a problem because btrfs_drop_extent_cache just drops the entire extent instead of the little tiny part it is invalidating. The bulk of the code in this patch changes btrfs_drop_extent_cache to invalidate only a portion of the extent cache, and changes btrfs_get_extent to deal with the results. Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: define write_cache_pages for linux kernel <= 2.6.20 insteadMiguel1-2/+1
write_cache_pages doesn't exist in linux 2.6.20, change the #if condition to match that. Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Handle checksumming errors while reading data blocksChris Mason1-0/+9
Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Retry metadata reads in the face of checksum failuresChris Mason1-21/+29
Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Do metadata checksums for reads via a workqueueChris Mason1-22/+78
Before, metadata checksumming was done by the callers of read_tree_block, which would set EXTENT_CSUM bits in the extent tree to show that a given range of pages was already checksummed and didn't need to be verified again. But, those bits could go away via try_to_releasepage, and the end result was bogus checksum failures on pages that never left the cache. The new code validates checksums when the page is read. It is a little tricky because metadata blocks can span pages and a single read may end up going via multiple bios. Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Add additional debugging for metadata checksum failuresChris Mason1-3/+51
Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Correct usage of IS_ERR() in extent_io.cPeter1-9/+9
Signed-off-by: Peter Teoh <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Add leak debugging for extent_buffer and extent_stateChris Mason1-2/+26
This also fixes one leak around the super block when failing to mount the FS. Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Bring back mount -o ssd optimizationsChris Mason1-0/+2
Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Add support for multiple devices per filesystemChris Mason1-3/+3
Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: checksum file data at bio submission time instead of during writepageChris Mason1-0/+2
When we checkum file data during writepage, the checksumming is done one page at a time, making it difficult to do bulk metadata modifications to insert checksums for large ranges of the file at once. This patch changes btrfs to checksum on a per-bio basis instead. The bios are checksummed before they are handed off to the block layer, so each bio is contiguous and only has pages from the same inode. Checksumming on a bio basis allows us to insert and modify the file checksum items in large groups. It also allows the checksumming to be done more easily by async worker threads. Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Allocator improvementsChris Mason1-4/+34
Reduce CPU time searching for free blocks by optimizing find_first_extent_bit Fix find_free_extent to make better use of the last_alloc hint. Before it was often finding blocks just before the hint. Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Fix "no csum found for inode" issue.Yan1-2/+3
A few codes were not properly updated for changes of extent map. This may be the causes of "no csum found for inode" issue. Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Create larger bios for btree blocksChris Mason1-3/+9
Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Don't case unsigned long to int in bio submissionChris Mason1-1/+1
Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Fix typo in extent_io.cYan1-2/+2
--- Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Fix delalloc account on state deletionChris Mason1-0/+1
Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Add a lookup cache to the extent state treeChris Mason1-17/+40
Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Enable delalloc accountingChris Mason1-7/+7
Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: mount -o max_inline=size to control the maximum inline extent sizeChris Mason1-1/+0
Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Do delalloc accounting via hooks in the extent_state codeChris Mason1-0/+25
Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: During deletes and truncate, remove many items at once from the treeChris Mason1-1/+0
Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: extent_io and extent_state optimizationsChris Mason1-95/+263
The end_bio routines are changed to take a pointer to the extent state struct, and the state tree is walked in order to set/clear appropriate bits as IO completes. This greatly reduces the number of rbtree searches done by the end_bio handlers, and reduces lock contention. The extent_io releasepage function is changed to avoid expensive searches for locked state. Signed-off-by: Chris Mason <[email protected]>
2008-09-25Btrfs: Split the extent_map code into two partsChris Mason1-0/+3089
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 <[email protected]>