diff options
author | Liu Bo <liubo2009@cn.fujitsu.com> | 2012-07-10 07:28:39 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2012-07-23 16:28:00 -0400 |
commit | 83eea1f1bacd5dc7b44dcf84f5fdca54fdea5453 (patch) | |
tree | 6c4e2d70ece25c180c092aa4a8d69a71e73a55c6 /fs/btrfs/inode.c | |
parent | 51a8cf9d2d97017d334f33f1b39067bd2f03bc49 (diff) |
Btrfs: kill root from btrfs_is_free_space_inode
Since root can be fetched via BTRFS_I macro directly, we can save an args
for btrfs_is_free_space_inode().
Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 18f1b44d1610..321c415dea7f 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -825,7 +825,7 @@ static noinline int cow_file_range(struct inode *inode, | |||
825 | struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; | 825 | struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; |
826 | int ret = 0; | 826 | int ret = 0; |
827 | 827 | ||
828 | BUG_ON(btrfs_is_free_space_inode(root, inode)); | 828 | BUG_ON(btrfs_is_free_space_inode(inode)); |
829 | trans = btrfs_join_transaction(root); | 829 | trans = btrfs_join_transaction(root); |
830 | if (IS_ERR(trans)) { | 830 | if (IS_ERR(trans)) { |
831 | extent_clear_unlock_delalloc(inode, | 831 | extent_clear_unlock_delalloc(inode, |
@@ -1153,7 +1153,7 @@ static noinline int run_delalloc_nocow(struct inode *inode, | |||
1153 | return -ENOMEM; | 1153 | return -ENOMEM; |
1154 | } | 1154 | } |
1155 | 1155 | ||
1156 | nolock = btrfs_is_free_space_inode(root, inode); | 1156 | nolock = btrfs_is_free_space_inode(inode); |
1157 | 1157 | ||
1158 | if (nolock) | 1158 | if (nolock) |
1159 | trans = btrfs_join_transaction_nolock(root); | 1159 | trans = btrfs_join_transaction_nolock(root); |
@@ -1466,7 +1466,7 @@ static void btrfs_set_bit_hook(struct inode *inode, | |||
1466 | if (!(state->state & EXTENT_DELALLOC) && (*bits & EXTENT_DELALLOC)) { | 1466 | if (!(state->state & EXTENT_DELALLOC) && (*bits & EXTENT_DELALLOC)) { |
1467 | struct btrfs_root *root = BTRFS_I(inode)->root; | 1467 | struct btrfs_root *root = BTRFS_I(inode)->root; |
1468 | u64 len = state->end + 1 - state->start; | 1468 | u64 len = state->end + 1 - state->start; |
1469 | bool do_list = !btrfs_is_free_space_inode(root, inode); | 1469 | bool do_list = !btrfs_is_free_space_inode(inode); |
1470 | 1470 | ||
1471 | if (*bits & EXTENT_FIRST_DELALLOC) { | 1471 | if (*bits & EXTENT_FIRST_DELALLOC) { |
1472 | *bits &= ~EXTENT_FIRST_DELALLOC; | 1472 | *bits &= ~EXTENT_FIRST_DELALLOC; |
@@ -1501,7 +1501,7 @@ static void btrfs_clear_bit_hook(struct inode *inode, | |||
1501 | if ((state->state & EXTENT_DELALLOC) && (*bits & EXTENT_DELALLOC)) { | 1501 | if ((state->state & EXTENT_DELALLOC) && (*bits & EXTENT_DELALLOC)) { |
1502 | struct btrfs_root *root = BTRFS_I(inode)->root; | 1502 | struct btrfs_root *root = BTRFS_I(inode)->root; |
1503 | u64 len = state->end + 1 - state->start; | 1503 | u64 len = state->end + 1 - state->start; |
1504 | bool do_list = !btrfs_is_free_space_inode(root, inode); | 1504 | bool do_list = !btrfs_is_free_space_inode(inode); |
1505 | 1505 | ||
1506 | if (*bits & EXTENT_FIRST_DELALLOC) { | 1506 | if (*bits & EXTENT_FIRST_DELALLOC) { |
1507 | *bits &= ~EXTENT_FIRST_DELALLOC; | 1507 | *bits &= ~EXTENT_FIRST_DELALLOC; |
@@ -1612,7 +1612,7 @@ static int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, | |||
1612 | 1612 | ||
1613 | skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM; | 1613 | skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM; |
1614 | 1614 | ||
1615 | if (btrfs_is_free_space_inode(root, inode)) | 1615 | if (btrfs_is_free_space_inode(inode)) |
1616 | metadata = 2; | 1616 | metadata = 2; |
1617 | 1617 | ||
1618 | if (!(rw & REQ_WRITE)) { | 1618 | if (!(rw & REQ_WRITE)) { |
@@ -1869,7 +1869,7 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent) | |||
1869 | int ret; | 1869 | int ret; |
1870 | bool nolock; | 1870 | bool nolock; |
1871 | 1871 | ||
1872 | nolock = btrfs_is_free_space_inode(root, inode); | 1872 | nolock = btrfs_is_free_space_inode(inode); |
1873 | 1873 | ||
1874 | if (test_bit(BTRFS_ORDERED_IOERR, &ordered_extent->flags)) { | 1874 | if (test_bit(BTRFS_ORDERED_IOERR, &ordered_extent->flags)) { |
1875 | ret = -EIO; | 1875 | ret = -EIO; |
@@ -2007,7 +2007,7 @@ static int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end, | |||
2007 | ordered_extent->work.func = finish_ordered_fn; | 2007 | ordered_extent->work.func = finish_ordered_fn; |
2008 | ordered_extent->work.flags = 0; | 2008 | ordered_extent->work.flags = 0; |
2009 | 2009 | ||
2010 | if (btrfs_is_free_space_inode(root, inode)) | 2010 | if (btrfs_is_free_space_inode(inode)) |
2011 | workers = &root->fs_info->endio_freespace_worker; | 2011 | workers = &root->fs_info->endio_freespace_worker; |
2012 | else | 2012 | else |
2013 | workers = &root->fs_info->endio_write_workers; | 2013 | workers = &root->fs_info->endio_write_workers; |
@@ -2732,7 +2732,7 @@ noinline int btrfs_update_inode(struct btrfs_trans_handle *trans, | |||
2732 | * The data relocation inode should also be directly updated | 2732 | * The data relocation inode should also be directly updated |
2733 | * without delay | 2733 | * without delay |
2734 | */ | 2734 | */ |
2735 | if (!btrfs_is_free_space_inode(root, inode) | 2735 | if (!btrfs_is_free_space_inode(inode) |
2736 | && root->root_key.objectid != BTRFS_DATA_RELOC_TREE_OBJECTID) { | 2736 | && root->root_key.objectid != BTRFS_DATA_RELOC_TREE_OBJECTID) { |
2737 | ret = btrfs_delayed_update_inode(trans, root, inode); | 2737 | ret = btrfs_delayed_update_inode(trans, root, inode); |
2738 | if (!ret) | 2738 | if (!ret) |
@@ -3743,7 +3743,7 @@ void btrfs_evict_inode(struct inode *inode) | |||
3743 | 3743 | ||
3744 | truncate_inode_pages(&inode->i_data, 0); | 3744 | truncate_inode_pages(&inode->i_data, 0); |
3745 | if (inode->i_nlink && (btrfs_root_refs(&root->root_item) != 0 || | 3745 | if (inode->i_nlink && (btrfs_root_refs(&root->root_item) != 0 || |
3746 | btrfs_is_free_space_inode(root, inode))) | 3746 | btrfs_is_free_space_inode(inode))) |
3747 | goto no_delete; | 3747 | goto no_delete; |
3748 | 3748 | ||
3749 | if (is_bad_inode(inode)) { | 3749 | if (is_bad_inode(inode)) { |
@@ -4457,7 +4457,7 @@ int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc) | |||
4457 | if (test_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags)) | 4457 | if (test_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags)) |
4458 | return 0; | 4458 | return 0; |
4459 | 4459 | ||
4460 | if (btrfs_fs_closing(root->fs_info) && btrfs_is_free_space_inode(root, inode)) | 4460 | if (btrfs_fs_closing(root->fs_info) && btrfs_is_free_space_inode(inode)) |
4461 | nolock = true; | 4461 | nolock = true; |
4462 | 4462 | ||
4463 | if (wbc->sync_mode == WB_SYNC_ALL) { | 4463 | if (wbc->sync_mode == WB_SYNC_ALL) { |
@@ -7051,7 +7051,7 @@ int btrfs_drop_inode(struct inode *inode) | |||
7051 | struct btrfs_root *root = BTRFS_I(inode)->root; | 7051 | struct btrfs_root *root = BTRFS_I(inode)->root; |
7052 | 7052 | ||
7053 | if (btrfs_root_refs(&root->root_item) == 0 && | 7053 | if (btrfs_root_refs(&root->root_item) == 0 && |
7054 | !btrfs_is_free_space_inode(root, inode)) | 7054 | !btrfs_is_free_space_inode(inode)) |
7055 | return 1; | 7055 | return 1; |
7056 | else | 7056 | else |
7057 | return generic_drop_inode(inode); | 7057 | return generic_drop_inode(inode); |