summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file-item.c
Commit message (Collapse)AuthorAgeFilesLines
* Btrfs: Fix variable init during csum creationChris Mason2008-09-251-0/+1
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Lookup readpage checksums on bio submission againChris Mason2008-09-251-2/+2
| | | | | | | | This optimization had been removed because I thought it was triggering csum errors. The real cause of the errors was elsewhere, and so this optimization is back. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Lower contention on the csum mutexChris Mason2008-09-251-4/+12
| | | | | | | This takes the csum mutex deeper in the call chain and releases it more often. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs_lookup_bio_sums seems broken, go back to the readpage_io_hook for nowChris Mason2008-09-251-1/+3
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Hold csum mutex while reading in sums during readpagesChris Mason2008-09-251-1/+1
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Fix streaming read performance with checksumming onChris Mason2008-09-251-0/+77
| | | | | | | | | | | | | | | | | | Large streaming reads make for large bios, which means each entry on the list async work queues represents a large amount of data. IO congestion throttling on the device was kicking in before the async worker threads decided a single thread was busy and needed some help. The end result was that a streaming read would result in a single CPU running at 100% instead of balancing the work off to other CPUs. This patch also changes the pre-IO checksum lookup done by reads to work on a per-bio basis instead of a per-page. This results in many extra btree lookups on large streaming reads. Doing the checksum lookup right before bio submit allows us to reuse searches while processing adjacent offsets. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: implement memory reclaim for leaf reference cacheYan2008-09-251-1/+0
| | | | | | | | | | | | | | The memory reclaiming issue happens when snapshot exists. In that case, some cache entries may not be used during old snapshot dropping, so they will remain in the cache until umount. The patch adds a field to struct btrfs_leaf_ref to record create time. Besides, the patch makes all dead roots of a given snapshot linked together in order of create time. After a old snapshot was completely dropped, we check the dead root list and remove all cache entries created before the oldest dead root in the list. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Take the csum mutex while reading checksumsChris Mason2008-09-251-3/+5
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Fix btrfs_wait_ordered_extent_range to properly waitChris Mason2008-09-251-1/+2
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Keep extent mappings in ram until pending ordered extents are doneChris Mason2008-09-251-4/+1
| | | | | | | | It was possible for stale mappings from disk to be used instead of the new pending ordered extent. This adds a flag to the extent map struct to keep it pinned until the pending ordered extent is actually on disk. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Handle data checksumming on bios that span multiple ordered extentsChris Mason2008-09-251-4/+39
| | | | | | | | Data checksumming is done right before the bio is sent down the IO stack, which means a single bio might span more than one ordered extent. In this case, the checksumming data is split between two ordered extents. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: New data=ordered implementationChris Mason2008-09-251-26/+36
| | | | | | | | | | | | | | | | | | | | | | | | The old data=ordered code would force commit to wait until all the data extents from the transaction were fully on disk. This introduced large latencies into the commit and stalled new writers in the transaction for a long time. The new code changes the way data allocations and extents work: * When delayed allocation is filled, data extents are reserved, and the extent bit EXTENT_ORDERED is set on the entire range of the extent. A struct btrfs_ordered_extent is allocated an inserted into a per-inode rbtree to track the pending extents. * As each page is written EXTENT_ORDERED is cleared on the bytes corresponding to that page. * When all of the bytes corresponding to a single struct btrfs_ordered_extent are written, The previously reserved extent is inserted into the FS btree and into the extent allocation trees. The checksums for the file data are also updated. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Clone file data ioctlSage Weil2008-09-251-6/+6
| | | | | | Add a new ioctl to clone file data Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Write bio checksumming outside the FS mutexChris Mason2008-09-251-14/+32
| | | | | | | This significantly improves streaming write performance by allowing concurrency in the data checksumming. 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: Make sure bio pages are adjacent during bulk csummingChris Mason2008-09-251-2/+4
| | | | 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-251-11/+39
| | | | | | | | | | | | | | | | 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: Add some extra debugging around file data checksum failuresChris Mason2008-09-251-0/+4
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Fix a number of inline extent problems that Yan Zheng reported.Chris Mason2008-09-251-1/+1
| | | | | | | | | | | | | | | | | | 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>
* 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>
* Btrfs: Optimize csum insertion to create larger items when possibleChris Mason2008-09-251-1/+36
| | | | | | | 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: Add back file data checksummingChris Mason2008-09-251-8/+9
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Allow tree blocks larger than the page sizeChris Mason2008-09-251-5/+5
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Create extent_buffer interface for large blocksizesChris Mason2008-09-251-32/+31
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: trivial include fixupsZach Brown2007-07-111-1/+0
| | | | | | | | | | | Almost none of the files including module.h need to do so, remove them. Include sched.h in extent-tree.c to silence a warning about cond_resched() being undeclared. Signed-off-by: Zach Brown <zach.brown@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Audit callers and return codes to make sure -ENOSPC gets up the stackChris Mason2007-06-221-40/+6
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Subject: Rework btrfs_file_write to only allocate while page locks are heldChris Mason2007-06-181-1/+0
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: patch queue: page_mkwriteChris Mason2007-06-151-1/+1
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs: Code cleanupAneesh2007-06-131-2/+0
| | | | | | | | | | | Attaching below is some of the code cleanups that i came across while reading the code. a) alloc_path already calls init_path. b) Mention that btrfs_inode is the in memory copy.Ext4 have ext4_inode_info as the in memory copy ext4_inode as the disk copy Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: add GPLv2Chris Mason2007-06-121-0/+18
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: printk fixesChris Mason2007-06-121-5/+0
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: 64 bit div fixesChris Mason2007-06-121-1/+2
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: fixup various fsx failuresChris Mason2007-05-291-0/+30
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: sparse files!Chris Mason2007-05-241-5/+6
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: switch to crc32c instead of sha256Chris Mason2007-05-101-16/+19
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: many file_write fixes, inline dataChris Mason2007-04-191-0/+1
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: working file_write, reorganized key flagsChris Mason2007-04-181-19/+47
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: rework csums and extent item orderingChris Mason2007-04-171-24/+2
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: progress on file_writeChris Mason2007-04-171-20/+41
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: early work to file_write in big extentsChris Mason2007-04-161-7/+104
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: drop owner and parentidChris Mason2007-04-101-1/+1
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: csum_verify_file_block locking fixChris Mason2007-04-021-0/+2
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: dynamic allocation of path structChris Mason2007-04-021-17/+26
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: corruption hunt continuesChris Mason2007-03-301-2/+2
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: verify csums on readChris Mason2007-03-291-0/+60
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: byte offsets for file keysChris Mason2007-03-271-2/+3
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: add generation field to file extentChris Mason2007-03-271-0/+1
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs_get_block, file read/writeChris Mason2007-03-261-2/+50
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: initial move to kernel module landChris Mason2007-03-211-5/+1
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
OpenPOWER on IntegriCloud