aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorYan, Zheng <zheng.yan@oracle.com>2010-05-16 10:49:58 -0400
committerChris Mason <chris.mason@oracle.com>2010-05-25 10:34:52 -0400
commit8929ecfa50f266163832eeacfbc3642ed5eb83b6 (patch)
treee0177748af36d49d5f652cff0e421a8268cf7194 /fs/btrfs/inode.c
parent0ca1f7ceb1991099ed5273885ebcf4323948c72e (diff)
Btrfs: Introduce global metadata reservation
Reserve metadata space for extent tree, checksum tree and root tree Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 6e54665d37f7..f9c40b839452 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4060,7 +4060,7 @@ int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc)
4060 struct btrfs_trans_handle *trans; 4060 struct btrfs_trans_handle *trans;
4061 int ret = 0; 4061 int ret = 0;
4062 4062
4063 if (root->fs_info->btree_inode == inode) 4063 if (BTRFS_I(inode)->dummy_inode)
4064 return 0; 4064 return 0;
4065 4065
4066 if (wbc->sync_mode == WB_SYNC_ALL) { 4066 if (wbc->sync_mode == WB_SYNC_ALL) {
@@ -4081,10 +4081,19 @@ void btrfs_dirty_inode(struct inode *inode)
4081{ 4081{
4082 struct btrfs_root *root = BTRFS_I(inode)->root; 4082 struct btrfs_root *root = BTRFS_I(inode)->root;
4083 struct btrfs_trans_handle *trans; 4083 struct btrfs_trans_handle *trans;
4084 int ret;
4085
4086 if (BTRFS_I(inode)->dummy_inode)
4087 return;
4084 4088
4085 trans = btrfs_join_transaction(root, 1); 4089 trans = btrfs_join_transaction(root, 1);
4086 btrfs_set_trans_block_group(trans, inode); 4090 btrfs_set_trans_block_group(trans, inode);
4087 btrfs_update_inode(trans, root, inode); 4091
4092 ret = btrfs_update_inode(trans, root, inode);
4093 if (ret)
4094 printk(KERN_ERR"btrfs: fail to dirty inode %lu error %d\n",
4095 inode->i_ino, ret);
4096
4088 btrfs_end_transaction(trans, root); 4097 btrfs_end_transaction(trans, root);
4089} 4098}
4090 4099