summaryrefslogtreecommitdiff
path: root/fs/btrfs/file.c
AgeCommit message (Collapse)AuthorFilesLines
2008-09-25Btrfs: Lower the max inline size to 8kChris Mason1-1/+1
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix lock ordering of the snapshot semaphore against the page lockChris Mason1-2/+4
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Force inlining off in a few places to save stack usageChris Mason1-10/+6
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Implement basic support for -ENOSPCChris Mason1-4/+24
This is intended to prevent accidentally filling the drive. A determined user can still make things oops. It includes some accounting of the current bytes under delayed allocation, but this will change as things get optimized Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Back port to 2.6.18-el kernelsChris Mason1-4/+11
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Fixes for loopback files in btrfsChris Mason1-0/+1
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Off by one fix for btrfs_drop_extentsYan1-1/+2
One of my old patches introduces a new bug to btrfs_drop_extents(changeset 275). Inline extents are not truncated properly when "extent_end == end", it can trigger the BUG_ON at file.c:600. I hope I don't introduce new bug this time. --- Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add lowest key information to back refs for extent tree blocks as well.Chris Mason1-7/+4
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add back pointers from extents to the btree or file referencing themChris Mason1-3/+17
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25btrfs_drop_extents: make sure the item is getting smaller before truncateChris Mason1-15/+15
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fine tune the btree writeback exclusion some moreChris Mason1-1/+2
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Allow large data extents in a single file to span into metadata block ↵Chris Mason1-0/+6
groups Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Fix EXTENT_MAP_INLINE off by one in btrfs_drop_extentsYan1-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>
2008-09-25Btrfs: Fix u32 overflow in dirty_and_release_pages.Yan1-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>
2008-09-25Btrfs: Fix a number of inline extent problems that Yan Zheng reported.Chris Mason1-6/+30
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 Mason1-1/+2
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-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: 32-bit type problemsJens Axboe1-1/+1
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: Default to 8k max packed tailsChris Mason1-1/+1
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add back file data checksummingChris Mason1-0/+1
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: extent_map optimizations to cut down on CPU usageChris Mason1-1/+0
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Allow tails larger than one pageChris Mason1-36/+116
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Allow tree blocks larger than the page sizeChris Mason1-66/+60
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Create extent_buffer interface for large blocksizesChris Mason1-62/+67
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: factor page private preparations into a helperChristoph Hellwig1-6/+1
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Use balance_dirty_pages_nr on btree blocksChris Mason1-1/+1
btrfs_btree_balance_dirty is changed to pass the number of pages dirtied for more accurate dirty throttling. This lets the VM make better decisions about when to force some writeback. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-09-14Btrfs: Fix off by one error in dirty_and_release_pagesYan1-1/+1
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-09-14Btrfs: use unlocked_ioctlChristoph Hellwig1-2/+2
No reason to grab the BKL before calling into the btrfs ioctl code. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-09-11[PATCH] btrfs: fix printk format warningChristoph Hellwig1-1/+1
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-09-11Btrfs: Add more synchronization before creating a snapshotChris Mason1-0/+2
File data checksums are only done during writepage, so we have to make sure all pages are written when the snapshot is taken. This also adds some locking so that new writes don't race in and add new dirty pages. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-08-30Btrfs: remove extra drop_extent_cache callChris Mason1-2/+0
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-08-30Btrfs: fsx delalloc fixesChris Mason1-9/+17
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-08-28Btrfs: Add delayed allocation to the extent based page tree codeChris Mason1-29/+21
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-08-28Btrfs: Extent based page cache code. This uses an rbtree of extents and testsChris Mason1-157/+138
instead of buffer heads. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-08-11Btrfs: delay commits during fsync to allow more writersJosef Bacik1-4/+18
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-08-08Btrfs: Add run time btree defrag, and an ioctl to force btree defragChris Mason1-1/+1
This adds two types of btree defrag, a run time form that tries to defrag recently allocated blocks in the btree when they are still in ram, and an ioctl that forces defrag of all btree blocks. File data blocks are not defragged yet, but this can make a huge difference in sequential btree reads. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-07-25Btrfs: deal with api changes in 2.6.23-rc1Chris Mason1-2/+7
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-07-11Btrfs: trivial include fixupsZach Brown1-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>
2007-06-28Btrfs: crash recovery fixesChris Mason1-4/+11
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-06-22Btrfs: Audit callers and return codes to make sure -ENOSPC gets up the stackChris Mason1-50/+81
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-06-22Btrfs: Switch to libcrc32c to avoid problems with cryptomgr on highmem machinesChris Mason1-1/+2
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-06-18Subject: Rework btrfs_file_write to only allocate while page locks are heldChris Mason1-111/+133
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-06-15Btrfs: patch queue: page_mkwriteChris Mason1-150/+26
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-06-12Btrfs: i386 fixes from axboeChris Mason1-2/+5
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-06-12Btrfs: add GPLv2Chris Mason1-0/+18
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-06-12Btrfs: 64 bit div fixesChris Mason1-3/+4
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-06-12Btrfs: split up super.cChris Mason1-0/+783
Signed-off-by: Chris Mason <chris.mason@oracle.com>