summaryrefslogtreecommitdiff
path: root/fs
AgeCommit message (Collapse)AuthorFilesLines
2008-09-25Btrfs: Set the btree inode i_size to OFFSET_MAXChris Mason1-7/+26
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix chunk allocation when some devices don't have enough room for stripesChris Mason1-16/+29
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Calculate appropriate chunk sizes for both small and large filesystemsChris Mason1-7/+61
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Don't drop extent_map cache during releasepage on the btree inodeChris Mason3-20/+44
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 <chris.mason@oracle.com>
2008-09-25Btrfs: Add support for labels in the super blockChris Mason2-8/+11
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Check device uuids along with devidsChris Mason2-7/+28
Signed-off-by: Chris Mason <chris.mason@oracle.com>
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 <chris.mason@oracle.com>
2008-09-25Btrfs: Avoid 64 bit div for RAID10Chris Mason1-1/+1
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Use the extent map cache to find the logical disk block during data ↵Chris Mason5-15/+168
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 <chris.mason@oracle.com>
2008-09-25Btrfs: Only do async bio submission for pdflushChris Mason1-0/+7
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Don't wait on tree block writeback before freeing them anymoreChris Mason3-6/+2
This isn't required anymore because we don't reallocate blocks that have already been written in this transaction. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Write bio checksumming outside the FS mutexChris Mason3-16/+45
This significantly improves streaming write performance by allowing concurrency in the data checksumming. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Create a work queue for bio writesChris Mason5-13/+119
This allows checksumming to happen in parallel among many cpus, and keeps us from bogging down pdflush with the checksumming code. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add RAID10 supportChris Mason3-5/+49
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add chunk uuids and update multi-device back referencesChris Mason7-62/+160
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. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: A few updates for 2.6.18 and versions older than 2.6.25Chris Mason3-11/+24
This includes fixing a missing spinlock init call that caused oops on mount for most kernels other than 2.6.25. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Add a min size parameter to btrfs_alloc_extentChris Mason3-4/+13
On huge machines, delayed allocation may try to allocate massive extents. This change allows btrfs_alloc_extent to return something smaller than the caller asked for, and the data allocation routines will loop over the allocations until it fills the whole delayed alloc. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: bio_endio support for linux 2.6.23 and older.Miguel2-1/+8
bio_endio() changed prototype on linux 2.6.24, support older kernels using the older prototype. Signed-off-by: Chris Mason <chris.mason@oracle.com>
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 <chris.mason@oracle.com>
2008-09-25Btrfs: Endianess bug fix for v0.13 with kernelsMiguel3-9/+24
Fix for a endianess BUG when using btrfs v0.13 with kernels older than 2.6.23 Problem: Has of v0.13, btrfs-progs is using crc32c.c equivalent to the one found on linux-2.6.23/lib/libcrc32c.c Since crc32c_le() changed in linux-2.6.23, when running btrfs v0.13 with older kernels we have a missmatch between the versions of crc32c_le() from btrfs-progs and libcrc32c in the kernel. This missmatch causes a bug when using btrfs on big endian machines. Solution: btrfs_crc32c() macro that when compiling for kernels older than 2.6.23, does endianess conversion to parameters and return value of crc32c(). This endianess conversion nullifies the differences in implementation of crc32c_le(). If kernel 2.6.23 or better, it calls crc32c(). Signed-off-by: Miguel Sousa Filipe <miguel.filipe@gmail.com> --- Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fixup a few u64<->pointer casts for 32 bitChris Mason1-3/+5
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add extra checks to avoid removing extent_state from pages we can't freeChris Mason1-0/+6
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Write out all super blocks on commit, and bring back proper barrier ↵Chris Mason4-8/+122
support Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add O_DIRECT read and write (writes == buffered + cache flush)Chris Mason2-2/+75
This adds basic O_DIRECT read and write support. In the write case, we just do a normal buffered write followed by a cache flush. O_DIRECT + O_SYNC are required to trigger metadata syncs. In the read case, there is a basic btrfs_get_block call for use by the generic O_DIRECT code. This does honor multi-volume mapping rules but it skips all checksumming. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Disable extra debugging checks on tree blocksChris Mason1-0/+1
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Handle checksumming errors while reading data blocksChris Mason4-1/+126
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Retry metadata reads in the face of checksum failuresChris Mason7-52/+138
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Handle data block end_io through the async work queueChris Mason3-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>
2008-09-25Btrfs: Do metadata checksums for reads via a workqueueChris Mason7-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>
2008-09-25Btrfs: Add additional debugging for metadata checksum failuresChris Mason3-4/+55
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Change btrfs_map_block to return a structure with mappings for all stripesChris Mason4-69/+103
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix allocation profile initChris Mason3-21/+13
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Don't allow written blocks from this transaction to be reallocatedChris Mason1-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>
2008-09-25Btrfs: Add support for duplicate blocks on a single spindleChris Mason4-9/+37
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add support for mirroring across drivesChris Mason6-93/+198
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Properly dirty buffers in the split corner casesChris Mason1-0/+2
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Verify checksums on tree blocks found without read_tree_blockChris Mason5-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>
2008-09-25Btrfs: Keep fs_mutex during reads done by snapshot deletionChris Mason1-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>
2008-09-25btrfs-progs: Stop stomping on 'name' input parameterAlex Chiang1-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>
2008-09-25Btrfs: Correct usage of IS_ERR() in extent_io.cPeter1-9/+9
Signed-off-by: Peter Teoh <htmldeveloper@gmail.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Fix btrfs_fill_super to return -EINVAL when no FS foundYan3-5/+4
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Reorder the flags field in struct btrfs_header and record a flag on writeoutChris Mason3-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>
2008-09-25Btrfs: Add leak debugging for extent_buffer and extent_stateChris Mason3-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>
2008-09-25Btrfs: Use a higher default ra pagesChris Mason1-1/+1
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Create a btrfs backing dev infoChris Mason3-0/+60
This allows intelligent versions of unplug and congestion functions Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Implement raid0 when multiple devices are presentChris Mason5-66/+173
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add support for device scanning and detection ioctlsChris Mason7-44/+333
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Bring back mount -o ssd optimizationsChris Mason8-2/+103
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Move device information into the super block so it can be scannedChris Mason5-91/+23
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Make the FS tree the last objectid in the tree of tree rootsChris Mason1-9/+8
Signed-off-by: Chris Mason <chris.mason@oracle.com>