summaryrefslogtreecommitdiff
path: root/fs/btrfs/inode.c
AgeCommit message (Collapse)AuthorFilesLines
2008-09-25Btrfs: Add backrefs for symbolic link inodesChris Mason1-17/+13
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add back pointers from the inode to the directory that references itChris Mason1-141/+117
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-10/+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-10/+28
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix buffer get/release issue in create_snapshotYan1-2/+2
btrfs_cow_block expects a reference to be held on the buffer being cow'd. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25xattr support for btrfsJosef Bacik1-1/+14
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add readpages supportChris Mason1-1/+11
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Properly delete csum item in btrfs_truncate_in_trans.Yan1-1/+2
When 'item_end' is equal to 'inode->i_size', 'found_type' is updated and current item is skipped. This behavior is correct for extent item, but incorrect for csum item. For example, there is a csum item with 'offset == 0'. When deleting the inode, 'inode->i_size' is set to 0, so the csum item isn't deleted. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add writepages supportChris Mason1-0/+10
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-19/+48
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-7/+7
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: 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: Off by one fixes in extent_map.cYan1-0/+1
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Optimize csum insertion to create larger items when possibleChris Mason1-1/+1
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: 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: 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: Add back file data checksummingChris Mason1-11/+10
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Add back metadata checksummingChris Mason1-4/+0
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Allow tails larger than one pageChris Mason1-12/+20
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Allow tree blocks larger than the page sizeChris Mason1-46/+44
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Create extent_buffer interface for large blocksizesChris Mason1-168/+267
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 Hellwig1-6/+1
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix double free and off by one in inode.cYan1-2/+1
The first change removes potential double free, the second fix a off by one error. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: truncate: don't update inode->i_blocks when extent is a holeYan1-4/+6
I think check whether extent is a hole before update 'inode->i_blocks' is unconditional required. (original codes check it only when del_item isn't equal to 0) Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25create btrfs_path slab with the correct sizeYan1-1/+1
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25fix found_type decrement in btrfs_truncate_in_transYan1-1/+1
found_type has already been decreased by codes above the change, I think decrease it by one again doesn't make sense. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Use balance_dirty_pages_nr on btree blocksChris Mason1-12/+35
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-14split up btrfs_ioctlChristoph Hellwig1-47/+59
Add a helper per ioctl function to make the code more readable. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-09-14Btrfs: use unlocked_ioctlChristoph Hellwig1-18/+5
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-14Btrfs: Fix extra link count dec in renameChris Mason1-7/+0
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-09-11Btrfs: [PATCH] extent_map: provide generic bmapChristoph Hellwig1-21/+2
generic_bmap is completely trivial, while the extent to bh mapping in btrfs is rather complex. So provide a extent_bmap instead that takes a get_extent callback and can be used by filesystem using the extent_map code. 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-1/+9
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-09-11Add support for defragging files via btrfsctl -d. Avoid OOM on extent treeChris Mason1-12/+81
defrag. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-08-30Btrfs: fsx delalloc fixesChris Mason1-163/+14
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-08-30Btrfs: Add file data csums back in via hooks in the extent map codeChris Mason1-3/+95
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-08-29Btrfs: Fix mknod to properly send rdev info back to diskYan1-0/+1
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-08-29Btrfs: Add per-root block accounting and sysfs entriesJosef Bacik1-4/+9
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-08-28Btrfs: Add delayed allocation to the extent based page tree codeChris Mason1-62/+79
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-510/+306
instead of buffer heads. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-08-28Btrfs: Make sure to cow the root during a snapshotChris Mason1-0/+2
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-08-28Btrfs: Do more extensive readahead during tree searchesChris Mason1-1/+1
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-08-11Btrfs: delay commits during fsync to allow more writersJosef Bacik1-0/+2
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-08-10Btrfs: Btree defrag on the extent-mapping tree as wellChris Mason1-21/+2
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-3/+30
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-08-07Btrfs: Fold some btree readahead routines into something more generic.Chris Mason1-67/+2
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-07-25Btrfs: deal with api changes in 2.6.23-rc1Chris Mason1-24/+26
Signed-off-by: Chris Mason <chris.mason@oracle.com>