summaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
* Btrfs: Handle data block end_io through the async work queueChris Mason2008-09-253-12/+28
| | | | | | | Before it was done by the bio end_io routine, the work queue code is able to scale much better with faster IO subsystems. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Do metadata checksums for reads via a workqueueChris Mason2008-09-257-67/+310
| | | | | | | | | | | | | | | | 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 <chris.mason@oracle.com>
* Btrfs: Add additional debugging for metadata checksum failuresChris Mason2008-09-253-4/+55
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Change btrfs_map_block to return a structure with mappings for all stripesChris Mason2008-09-254-69/+103
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Fix allocation profile initChris Mason2008-09-253-21/+13
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Don't allow written blocks from this transaction to be reallocatedChris Mason2008-09-251-1/+3
| | | | | | | | | | | | | | 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. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Add support for duplicate blocks on a single spindleChris Mason2008-09-254-9/+37
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Add support for mirroring across drivesChris Mason2008-09-256-93/+198
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Properly dirty buffers in the split corner casesChris Mason2008-09-251-0/+2
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Verify checksums on tree blocks found without read_tree_blockChris Mason2008-09-255-36/+60
| | | | | | | | | | | | | | | | | Checksums were only verified by btrfs_read_tree_block, which meant the functions to probe the page cache for blocks were not validating checksums. Normally this is fine because the buffers will only be in cache if they have already been validated. But, there is a window while the buffer is being read from disk where it could be up to date in the cache but not yet verified. This patch makes sure all buffers go through checksum verification before they are used. This is safer, and it prevents modification of buffers before they go through the csum code. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Keep fs_mutex during reads done by snapshot deletionChris Mason2008-09-251-3/+4
| | | | | | | | There was an optimization to drop the fs_mutex when doing snapshot deletion reads, but this can lead to false positives on checksumming errors. Keep the lock for now. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs-progs: Stop stomping on 'name' input parameterAlex Chiang2008-09-251-1/+1
| | | | | | | | | | | | | | | | | | In btrfs_name_hash, Local variable 'buf' is declared as __u32 buf[2]; but we then try to do this: buf[0] = 0x67452301; buf[1] = 0xefcdab89; buf[2] = 0x98badcfe; buf[3] = 0x10325476; Oops. Fix buf to be the proper size. Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Correct usage of IS_ERR() in extent_io.cPeter2008-09-251-9/+9
| | | | | Signed-off-by: Peter Teoh <htmldeveloper@gmail.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Fix btrfs_fill_super to return -EINVAL when no FS foundYan2008-09-253-5/+4
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Reorder the flags field in struct btrfs_header and record a flag on writeoutChris Mason2008-09-253-9/+42
| | | | | | | | This allows detection of blocks that have already been written in the running transaction so they can be recowed instead of modified again. It is step one in trusting the transid field of the block pointers. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Add leak debugging for extent_buffer and extent_stateChris Mason2008-09-253-3/+30
| | | | | | | This also fixes one leak around the super block when failing to mount the FS. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Use a higher default ra pagesChris Mason2008-09-251-1/+1
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Create a btrfs backing dev infoChris Mason2008-09-253-0/+60
| | | | | | This allows intelligent versions of unplug and congestion functions Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Implement raid0 when multiple devices are presentChris Mason2008-09-255-66/+173
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Add support for device scanning and detection ioctlsChris Mason2008-09-257-44/+333
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Bring back mount -o ssd optimizationsChris Mason2008-09-258-2/+103
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Move device information into the super block so it can be scannedChris Mason2008-09-255-91/+23
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Make the FS tree the last objectid in the tree of tree rootsChris Mason2008-09-251-9/+8
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add /dev/btrfs-control for device scanning ioctlsChris Mason2008-09-252-5/+40
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Bring back find_free_extent CPU usage optimizationsChris Mason2008-09-251-8/+12
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Dynamic chunk and block group allocationChris Mason2008-09-256-57/+263
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Add support for multiple devices per filesystemChris Mason2008-09-2513-380/+1563
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Match the extent tree code to btrfs-progs for multi-device mergingChris Mason2008-09-251-52/+7
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Use KM_USERN instead of KM_IRQ during data summingChris Mason2008-09-251-5/+5
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Disable sysfs files on older kernelsChris Mason2008-09-251-0/+34
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Make sure bio pages are adjacent during bulk csummingChris Mason2008-09-251-2/+4
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Misc 2.6.25 updatesChris Mason2008-09-252-29/+11
| | | | | | Remove the btrfs read_inode method, and use save_mount_options Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs: fixes for kobject changes in mainlineGreg KH2008-09-251-24/+15
| | | | | | | | | | | | | Here's a patch against the unstable tree that gets the code to build against Linus's current tree (2.6.24-git12). This is needed as the kobject/kset api has changed there. I tried to make the smallest changes needed, and it builds and loads successfully, but I don't have a btrfs volume anywhere (yet) to try to see if things still work properly :) Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: While doing checksums on bios, cache the extent_buffer mappingChris Mason2008-09-251-3/+33
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: checksum file data at bio submission time instead of during writepageChris Mason2008-09-255-18/+75
| | | | | | | | | | | | | | | | 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 <chris.mason@oracle.com>
* Btrfs: Properly cast before shiftingChris Mason2008-09-251-1/+1
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Take the extent lock before dropping the delalloc bitsChris Mason2008-09-251-0/+4
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Fix looping on readdir of the subvol rootsYan Zheng2008-09-251-1/+4
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Properly clear dirty and delalloc extent bits while preparing the ↵Chris Mason2008-09-251-0/+7
| | | | | | | | | | | file for write Yan Zheng noticed that we don't clear the extent state tree dirty and delalloc bits when we clear the dirty bits on the page during file write. This leads to csum errors later on. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Remove extent back refs in batches, and avoid duplicate searchesChris Mason2008-09-251-9/+54
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Allocator improvementsChris Mason2008-09-254-15/+70
| | | | | | | | | 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 <chris.mason@oracle.com>
* Btrfs: Disable tree defrag in SSD modeChris Mason2008-09-252-1/+5
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: unaligned access fixesDavid Miller2008-09-255-45/+33
| | | | | | | | | | | | | Btrfs set/get macros lose type information needed to avoid unaligned accesses on sparc64. ere is a patch for the kernel bits which fixes most of the unaligned accesses on sparc64. btrfs_name_hash is modified to return the hash value instead of getting a return location via a (potentially unaligned) pointer. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Fix "no csum found for inode" issue.Yan2008-09-252-3/+7
| | | | | | | 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 <chris.mason@oracle.com>
* Btrfs: Fix i_blocks accountingChris Mason2008-09-254-20/+50
| | | | | | | | | | Now that delayed allocation accounting works, i_blocks accounting is changed to only modify i_blocks when extents inserted or removed. The fillattr call is changed to include the delayed allocation byte count in the i_blocks result. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Create larger bios for btree blocksChris Mason2008-09-253-8/+17
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Don't case unsigned long to int in bio submissionChris Mason2008-09-251-1/+1
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Use 2MB as the empty_size for clustered allocationsChris Mason2008-09-251-1/+1
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs_drop_extents: handle BTRFS_INODE_REF_KEY typesYan2008-09-251-3/+4
| | | | | | It's possible "key.type == BTRFS_INODE_REF_KEY" and "key.offset >= end". Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Add checks for last byte in disk to allocator groupingChris Mason2008-09-251-1/+6
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
OpenPOWER on IntegriCloud