summaryrefslogtreecommitdiff
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-01-03 09:08:27 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:58 -0400
commit56b453c92fdf51fd3283a2dc2dfbedf36f516031 (patch)
tree273b7fa9f03f61f6241f722ffa6ff5a3eb64736d /fs/btrfs/inode.c
parent8f662a76c6af8eb367fa519e9bb9766040d9cea8 (diff)
downloadlwn-56b453c92fdf51fd3283a2dc2dfbedf36f516031.tar.gz
lwn-56b453c92fdf51fd3283a2dc2dfbedf36f516031.zip
Btrfs: Explicitly send a root objectid to count_snapshots_in_path
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c39
1 files changed, 5 insertions, 34 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index d6de46961887..5003a86510a1 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1770,6 +1770,11 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
again:
em = lookup_extent_mapping(em_tree, start, end);
if (em) {
+ if (em->start > start) {
+ printk("get_extent start %Lu em start %Lu\n",
+ start, em->start);
+ WARN_ON(1);
+ }
goto out;
}
if (!em) {
@@ -1952,23 +1957,6 @@ static sector_t btrfs_bmap(struct address_space *mapping, sector_t iblock)
return extent_bmap(mapping, iblock, btrfs_get_extent);
}
-static int btrfs_prepare_write(struct file *file, struct page *page,
- unsigned from, unsigned to)
-{
- struct btrfs_root *root = BTRFS_I(page->mapping->host)->root;
- int err;
-
- mutex_lock(&root->fs_info->fs_mutex);
- err = btrfs_check_free_space(root, PAGE_CACHE_SIZE, 0);
- mutex_unlock(&root->fs_info->fs_mutex);
- if (err)
- return -ENOSPC;
-
- return extent_prepare_write(&BTRFS_I(page->mapping->host)->extent_tree,
- page->mapping->host, page, from, to,
- btrfs_get_extent);
-}
-
int btrfs_readpage(struct file *file, struct page *page)
{
struct extent_map_tree *tree;
@@ -2120,21 +2108,6 @@ static void btrfs_truncate(struct inode *inode)
btrfs_btree_balance_dirty(root, nr);
}
-int btrfs_commit_write(struct file *file, struct page *page,
- unsigned from, unsigned to)
-{
- loff_t pos = ((loff_t)page->index << PAGE_CACHE_SHIFT) + to;
- struct inode *inode = page->mapping->host;
-
- btrfs_cow_one_page(inode, page, PAGE_CACHE_SIZE);
-
- if (pos > inode->i_size) {
- i_size_write(inode, pos);
- mark_inode_dirty(inode);
- }
- return 0;
-}
-
static int create_subvol(struct btrfs_root *root, char *name, int namelen)
{
struct btrfs_trans_handle *trans;
@@ -2930,8 +2903,6 @@ static struct address_space_operations btrfs_aops = {
.writepages = btrfs_writepages,
.readpages = btrfs_readpages,
.sync_page = block_sync_page,
- .prepare_write = btrfs_prepare_write,
- .commit_write = btrfs_commit_write,
.bmap = btrfs_bmap,
.invalidatepage = btrfs_invalidatepage,
.releasepage = btrfs_releasepage,