aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
AgeCommit message (Collapse)AuthorFilesLines
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: Fix a number of inline extent problems that Yan Zheng reported.Chris Mason8-38/+135
The fixes do a number of things: 1) Most btrfs_drop_extent callers will try to leave the inline extents in place. It can truncate bytes off the beginning of the inline extent if required. 2) writepage can now update the inline extent, allowing mmap writes to go directly into the inline extent. 3) btrfs_truncate_in_transaction truncates inline extents 4) extent_map.c fixed to not merge inline extent mappings and hole mappings together Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix PAGE_CACHE_SHIFT shifts on 32 bit machinesChris Mason5-22/+26
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Add O_SYNC support to btrfs_file_writeChris Mason1-2/+13
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Minor fix for btrfs_csum_file_block.Yan1-6/+4
Execution should goto label 'insert' when 'btrfs_next_leaf' return a non-zero value, otherwise the parameter 'slot' for 'btrfs_item_key_to_cpu' may be out of bounds. The original codes jump to label 'insert' only when 'btrfs_next_leaf' return a negative value. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Fix inline extent handling in btrfs_get_extentYan1-16/+18
1. Reorder kmap and the test for 'page != NULL' 2. Zero-fill rest area of a block when inline extent isn't big enough. 3. Do not insert extent_map into the map tree when page == NULL. (If insert the extent_map into the map tree, subsequent read requests will find it in the map tree directly and the corresponding inline extent data aren't copied into page by the the get_extent function. extent_read_full_page can't handle that case) Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix extent_map leak in extent_bmapYan1-2/+6
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Compile fixes for 2.6.24-rc1Chris Mason1-1/+10
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Fix ENOTEMPTY check in btrfs_rmdirYan1-1/+4
The ENOTEMPTY check in btrfs_rmdir isn't reliable. It's possible that the backward search finds . or .. at first, then some other directory entry. In that case, btrfs_rmdir delete . or .. improperly. The patch also fixes a fs_mutex unlock issue in btrfs_rmdir. -- Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25btrfs_inode_by_name return random value.Yan1-2/+3
When inode is found, the return value is from the uninitialized variable 'ret'. -- Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Tune the automatic defrag codeChris Mason2-44/+26
1) Forced defrag wasn't working properly (btrfsctl -d) because some cache only checks were incorrect. 2) Defrag only the leaves unless in forced defrag mode. 3) Don't use complex logic to figure out if a leaf is needs defrag Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix for insert_inline_extent to handle offset != 0Yan1-9/+12
This modifies inline extent size calculation, so that insert_inline_extent can handle the case that parameter 'offset' is not zero; it also a few codes to zero uninitialized area in inline extent. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix split_leaf to detect when it is extending an itemChris Mason1-51/+27
When making room for a new item, it is ok to create an empty leaf, but when making room to extend an item, split_leaf needs to make sure it keeps the item we're extending in the path and make sure we don't end up with an empty leaf. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Off by one fixes in extent_map.cYan2-5/+6
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Optimize csum insertion to create larger items when possibleChris Mason3-2/+38
This reduces the number of calls to btrfs_extend_item and greatly lowers the cpu usage while writing large files. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix split_leaf to avoid incorrect double splitsChris Mason1-1/+5
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Avoid recursive KM_USER1 mappings in copy_extent_bufferChris Mason1-2/+2
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: CPU usage optimizations in push and the extent_map codeChris Mason2-50/+39
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix read/write_extent_buffer to use KM_USER1 instead of KM_USER0Chris Mason1-4/+4
This avoids recursive use of KM_USER0 during btrfs_file_write Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: sysfs compile fixupJens Axboe1-3/+2
Just use kobject_set_name(), that works in all kernels (I think...). Kernels newer than 2.6.23 currently fail with: /home/axboe/git/btrfs/btrfs-unstable/sysfs.c:188: error: unknown field 'name' specified in initializer Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: KM_IRQ0 usage in end_io handlingJens Axboe1-0/+4
endio handling is typically called with interrupts disabled, but can also be called with it enabled. So save interrupts before using KM_IRQ0 to be completely safe. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix bi_end_io() functions on > 2.6.23 kernelsJens Axboe1-0/+25
It now returns void and it is never called for partial completions, so the bio->bi_size check must go. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25btrfs: 32-bit type problemsJens Axboe5-10/+10
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: Properly setup root key while reading the rootYan Zheng1-0/+1
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix typo: owner is a 64 bit fieldChris Mason1-2/+2
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Default to 8k max packed tailsChris Mason2-2/+2
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Defrag only leaves, and only when the parent node has a single objectidChris Mason4-40/+23
This allows us to defrag huge directories, but skip the expensive defrag case in more common usage, where it does not help as much. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add back file data checksummingChris Mason6-19/+26
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Defrag: only walk into nodes with the defrag bit setChris Mason2-5/+4
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: balance_dirty_pages_ratelimited is causing problems, use nr == 1 alwaysChris Mason1-1/+1
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Large block related defrag optimizationsChris Mason2-4/+23
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add back metadata checksummingChris Mason6-80/+244
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 Mason6-74/+104
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: extent_map optimizations to cut down on CPU usageChris Mason6-91/+40
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Allow tails larger than one pageChris Mason5-55/+155
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add an extent buffer LRU to reduce radix tree hitsChris Mason6-105/+128
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix allocation routines to avoid intermixing data and metadata allocationsChris Mason2-19/+25
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add back the online defragging codeChris Mason7-106/+166
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Use an array of pages in the extent buffers to reduce the cost of find_get_pageChris Mason3-19/+13
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Cache extent buffer mappingsChris Mason2-6/+49
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Allow tree blocks larger than the page sizeChris Mason15-497/+738
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 treesChris Mason6-138/+94
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Stop using radix trees for the block group cacheChris Mason5-223/+171
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix extent_buffer and extent_state leaksChris Mason7-87/+139
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Go back to kmaps instead of page_address in extent_buffersChris Mason1-31/+19
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Avoid memcpy where possible in extent_buffersChris Mason4-41/+147
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Optimizations for the extent_buffer codeChris Mason4-36/+76
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Create extent_buffer interface for large blocksizesChris Mason22-2076/+2782
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25btrfs_get_extent should treat inline extents as though they hold a whole blockChris Mason1-5/+7
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: factor page private preparations into a helperChristoph Hellwig4-37/+18
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>