summaryrefslogtreecommitdiffstats
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
* Fix recursive KM_USER1 usage in btrfs_realloc_nodeChris Mason2008-09-252-8/+19
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Optimize allocations as we need to mix data and metadata into one groupChris Mason2008-09-253-7/+43
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Fix EXTENT_MAP_INLINE off by one in btrfs_drop_extentsYan2008-09-251-2/+1
| | | | | | | | Don't set hint_byte to EXTENT_MAP_INLINE when 'end == extent_end' or 'start == key.offset' . The inline extent will be truncated in these cases. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Fix u32 overflow in dirty_and_release_pages.Yan2008-09-251-4/+5
| | | | | | | | | | | When calculating the size of inline extent, inode->i_size should also be take into consideration, otherwise sys_write may drop some data silently. You can test this bug by: #dd if=/dev/zero bs=4k count=1 of=test_file #dd if=/dev/zero bs=2k count=1 of=test_file conv=notrunc Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Make defrag check nodes against the progress key to prevent repeating ↵Chris Mason2008-09-252-25/+34
| | | | | | work Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Properly update free space cache in __free_extentYan2008-09-251-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>
* Btrfs: Add writepages supportChris Mason2008-09-253-25/+124
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: small fixes for find_lock_delalloc_range.Yan2008-09-251-1/+3
| | | | | | | | There is a 'finish_wait', but no 'prepare_to_wait' . So I think that the 'prepare_to_wait' is missing. The second change is according to the name of variable. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Fix typo and memory leak in extent-tree.cYan2008-09-251-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>
* Btrfs: Fix a number of inline extent problems that Yan Zheng reported.Chris Mason2008-09-258-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>
* Btrfs: Fix PAGE_CACHE_SHIFT shifts on 32 bit machinesChris Mason2008-09-255-22/+26
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add O_SYNC support to btrfs_file_writeChris Mason2008-09-251-2/+13
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Minor fix for btrfs_csum_file_block.Yan2008-09-251-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>
* Fix inline extent handling in btrfs_get_extentYan2008-09-251-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>
* Btrfs: Fix extent_map leak in extent_bmapYan2008-09-251-2/+6
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Compile fixes for 2.6.24-rc1Chris Mason2008-09-251-1/+10
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Fix ENOTEMPTY check in btrfs_rmdirYan2008-09-251-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>
* btrfs_inode_by_name return random value.Yan2008-09-251-2/+3
| | | | | | | | | When inode is found, the return value is from the uninitialized variable 'ret'. -- Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Tune the automatic defrag codeChris Mason2008-09-252-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>
* Btrfs: Fix for insert_inline_extent to handle offset != 0Yan2008-09-251-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>
* Btrfs: Fix split_leaf to detect when it is extending an itemChris Mason2008-09-251-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>
* Btrfs: Off by one fixes in extent_map.cYan2008-09-252-5/+6
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Optimize csum insertion to create larger items when possibleChris Mason2008-09-253-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>
* Btrfs: Fix split_leaf to avoid incorrect double splitsChris Mason2008-09-251-1/+5
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Avoid recursive KM_USER1 mappings in copy_extent_bufferChris Mason2008-09-251-2/+2
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: CPU usage optimizations in push and the extent_map codeChris Mason2008-09-252-50/+39
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Fix read/write_extent_buffer to use KM_USER1 instead of KM_USER0Chris Mason2008-09-251-4/+4
| | | | | | This avoids recursive use of KM_USER0 during btrfs_file_write Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: sysfs compile fixupJens Axboe2008-09-251-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>
* Btrfs: KM_IRQ0 usage in end_io handlingJens Axboe2008-09-251-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>
* Btrfs: Fix bi_end_io() functions on > 2.6.23 kernelsJens Axboe2008-09-251-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>
* btrfs: 32-bit type problemsJens Axboe2008-09-255-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>
* Btrfs: Properly setup root key while reading the rootYan Zheng2008-09-251-0/+1
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Fix typo: owner is a 64 bit fieldChris Mason2008-09-251-2/+2
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Default to 8k max packed tailsChris Mason2008-09-252-2/+2
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Defrag only leaves, and only when the parent node has a single objectidChris Mason2008-09-254-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>
* Btrfs: Add back file data checksummingChris Mason2008-09-256-19/+26
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Defrag: only walk into nodes with the defrag bit setChris Mason2008-09-252-5/+4
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: balance_dirty_pages_ratelimited is causing problems, use nr == 1 alwaysChris Mason2008-09-251-1/+1
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Large block related defrag optimizationsChris Mason2008-09-252-4/+23
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Add back metadata checksummingChris Mason2008-09-256-81/+245
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Breakout BTRFS_SETGET_FUNCS into a separate C file, the inlines were too big.Chris Mason2008-09-256-74/+104
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: extent_map optimizations to cut down on CPU usageChris Mason2008-09-256-91/+40
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Allow tails larger than one pageChris Mason2008-09-255-56/+156
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Add an extent buffer LRU to reduce radix tree hitsChris Mason2008-09-256-105/+128
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Fix allocation routines to avoid intermixing data and metadata ↵Chris Mason2008-09-252-19/+25
| | | | | | allocations Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Add back the online defragging codeChris Mason2008-09-257-106/+166
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Use an array of pages in the extent buffers to reduce the cost of ↵Chris Mason2008-09-253-19/+13
| | | | | | find_get_page Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Cache extent buffer mappingsChris Mason2008-09-252-6/+49
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Allow tree blocks larger than the page sizeChris Mason2008-09-2515-497/+738
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Change the remaining radix trees used by extent-tree.c to extent_map ↵Chris Mason2008-09-256-138/+94
| | | | | | trees Signed-off-by: Chris Mason <chris.mason@oracle.com>
OpenPOWER on IntegriCloud