diff options
Diffstat (limited to 'fs/btrfs/inode.c')
| -rw-r--r-- | fs/btrfs/inode.c | 111 |
1 files changed, 84 insertions, 27 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index d8bb0dbc4941..83baec24946d 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, |
| @@ -1010,7 +1010,7 @@ static noinline void async_cow_submit(struct btrfs_work *work) | |||
| 1010 | atomic_sub(nr_pages, &root->fs_info->async_delalloc_pages); | 1010 | atomic_sub(nr_pages, &root->fs_info->async_delalloc_pages); |
| 1011 | 1011 | ||
| 1012 | if (atomic_read(&root->fs_info->async_delalloc_pages) < | 1012 | if (atomic_read(&root->fs_info->async_delalloc_pages) < |
| 1013 | 5 * 1042 * 1024 && | 1013 | 5 * 1024 * 1024 && |
| 1014 | waitqueue_active(&root->fs_info->async_submit_wait)) | 1014 | waitqueue_active(&root->fs_info->async_submit_wait)) |
| 1015 | wake_up(&root->fs_info->async_submit_wait); | 1015 | wake_up(&root->fs_info->async_submit_wait); |
| 1016 | 1016 | ||
| @@ -1035,7 +1035,7 @@ static int cow_file_range_async(struct inode *inode, struct page *locked_page, | |||
| 1035 | struct btrfs_root *root = BTRFS_I(inode)->root; | 1035 | struct btrfs_root *root = BTRFS_I(inode)->root; |
| 1036 | unsigned long nr_pages; | 1036 | unsigned long nr_pages; |
| 1037 | u64 cur_end; | 1037 | u64 cur_end; |
| 1038 | int limit = 10 * 1024 * 1042; | 1038 | int limit = 10 * 1024 * 1024; |
| 1039 | 1039 | ||
| 1040 | clear_extent_bit(&BTRFS_I(inode)->io_tree, start, end, EXTENT_LOCKED, | 1040 | clear_extent_bit(&BTRFS_I(inode)->io_tree, start, end, EXTENT_LOCKED, |
| 1041 | 1, 0, NULL, GFP_NOFS); | 1041 | 1, 0, NULL, GFP_NOFS); |
| @@ -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,8 +2732,10 @@ 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 | btrfs_update_root_times(trans, root); | ||
| 2738 | |||
| 2737 | ret = btrfs_delayed_update_inode(trans, root, inode); | 2739 | ret = btrfs_delayed_update_inode(trans, root, inode); |
| 2738 | if (!ret) | 2740 | if (!ret) |
| 2739 | btrfs_set_inode_last_trans(trans, inode); | 2741 | btrfs_set_inode_last_trans(trans, inode); |
| @@ -2833,7 +2835,7 @@ err: | |||
| 2833 | inode_inc_iversion(inode); | 2835 | inode_inc_iversion(inode); |
| 2834 | inode_inc_iversion(dir); | 2836 | inode_inc_iversion(dir); |
| 2835 | inode->i_ctime = dir->i_mtime = dir->i_ctime = CURRENT_TIME; | 2837 | inode->i_ctime = dir->i_mtime = dir->i_ctime = CURRENT_TIME; |
| 2836 | btrfs_update_inode(trans, root, dir); | 2838 | ret = btrfs_update_inode(trans, root, dir); |
| 2837 | out: | 2839 | out: |
| 2838 | return ret; | 2840 | return ret; |
| 2839 | } | 2841 | } |
| @@ -3743,7 +3745,7 @@ void btrfs_evict_inode(struct inode *inode) | |||
| 3743 | 3745 | ||
| 3744 | truncate_inode_pages(&inode->i_data, 0); | 3746 | truncate_inode_pages(&inode->i_data, 0); |
| 3745 | if (inode->i_nlink && (btrfs_root_refs(&root->root_item) != 0 || | 3747 | if (inode->i_nlink && (btrfs_root_refs(&root->root_item) != 0 || |
| 3746 | btrfs_is_free_space_inode(root, inode))) | 3748 | btrfs_is_free_space_inode(inode))) |
| 3747 | goto no_delete; | 3749 | goto no_delete; |
| 3748 | 3750 | ||
| 3749 | if (is_bad_inode(inode)) { | 3751 | if (is_bad_inode(inode)) { |
| @@ -3754,7 +3756,7 @@ void btrfs_evict_inode(struct inode *inode) | |||
| 3754 | btrfs_wait_ordered_range(inode, 0, (u64)-1); | 3756 | btrfs_wait_ordered_range(inode, 0, (u64)-1); |
| 3755 | 3757 | ||
| 3756 | if (root->fs_info->log_root_recovering) { | 3758 | if (root->fs_info->log_root_recovering) { |
| 3757 | BUG_ON(!test_bit(BTRFS_INODE_HAS_ORPHAN_ITEM, | 3759 | BUG_ON(test_bit(BTRFS_INODE_HAS_ORPHAN_ITEM, |
| 3758 | &BTRFS_I(inode)->runtime_flags)); | 3760 | &BTRFS_I(inode)->runtime_flags)); |
| 3759 | goto no_delete; | 3761 | goto no_delete; |
| 3760 | } | 3762 | } |
| @@ -4082,7 +4084,6 @@ static int btrfs_init_locked_inode(struct inode *inode, void *p) | |||
| 4082 | struct btrfs_iget_args *args = p; | 4084 | struct btrfs_iget_args *args = p; |
| 4083 | inode->i_ino = args->ino; | 4085 | inode->i_ino = args->ino; |
| 4084 | BTRFS_I(inode)->root = args->root; | 4086 | BTRFS_I(inode)->root = args->root; |
| 4085 | btrfs_set_inode_space_info(args->root, inode); | ||
| 4086 | return 0; | 4087 | return 0; |
| 4087 | } | 4088 | } |
| 4088 | 4089 | ||
| @@ -4247,7 +4248,7 @@ static void btrfs_dentry_release(struct dentry *dentry) | |||
| 4247 | } | 4248 | } |
| 4248 | 4249 | ||
| 4249 | static struct dentry *btrfs_lookup(struct inode *dir, struct dentry *dentry, | 4250 | static struct dentry *btrfs_lookup(struct inode *dir, struct dentry *dentry, |
| 4250 | struct nameidata *nd) | 4251 | unsigned int flags) |
| 4251 | { | 4252 | { |
| 4252 | struct dentry *ret; | 4253 | struct dentry *ret; |
| 4253 | 4254 | ||
| @@ -4457,7 +4458,7 @@ int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc) | |||
| 4457 | if (test_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags)) | 4458 | if (test_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags)) |
| 4458 | return 0; | 4459 | return 0; |
| 4459 | 4460 | ||
| 4460 | if (btrfs_fs_closing(root->fs_info) && btrfs_is_free_space_inode(root, inode)) | 4461 | if (btrfs_fs_closing(root->fs_info) && btrfs_is_free_space_inode(inode)) |
| 4461 | nolock = true; | 4462 | nolock = true; |
| 4462 | 4463 | ||
| 4463 | if (wbc->sync_mode == WB_SYNC_ALL) { | 4464 | if (wbc->sync_mode == WB_SYNC_ALL) { |
| @@ -4518,6 +4519,11 @@ int btrfs_dirty_inode(struct inode *inode) | |||
| 4518 | static int btrfs_update_time(struct inode *inode, struct timespec *now, | 4519 | static int btrfs_update_time(struct inode *inode, struct timespec *now, |
| 4519 | int flags) | 4520 | int flags) |
| 4520 | { | 4521 | { |
| 4522 | struct btrfs_root *root = BTRFS_I(inode)->root; | ||
| 4523 | |||
| 4524 | if (btrfs_root_readonly(root)) | ||
| 4525 | return -EROFS; | ||
| 4526 | |||
| 4521 | if (flags & S_VERSION) | 4527 | if (flags & S_VERSION) |
| 4522 | inode_inc_iversion(inode); | 4528 | inode_inc_iversion(inode); |
| 4523 | if (flags & S_CTIME) | 4529 | if (flags & S_CTIME) |
| @@ -4662,7 +4668,6 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, | |||
| 4662 | BTRFS_I(inode)->root = root; | 4668 | BTRFS_I(inode)->root = root; |
| 4663 | BTRFS_I(inode)->generation = trans->transid; | 4669 | BTRFS_I(inode)->generation = trans->transid; |
| 4664 | inode->i_generation = BTRFS_I(inode)->generation; | 4670 | inode->i_generation = BTRFS_I(inode)->generation; |
| 4665 | btrfs_set_inode_space_info(root, inode); | ||
| 4666 | 4671 | ||
| 4667 | if (S_ISDIR(mode)) | 4672 | if (S_ISDIR(mode)) |
| 4668 | owner = 0; | 4673 | owner = 0; |
| @@ -4690,6 +4695,8 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, | |||
| 4690 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; | 4695 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; |
| 4691 | inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0], | 4696 | inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0], |
| 4692 | struct btrfs_inode_item); | 4697 | struct btrfs_inode_item); |
| 4698 | memset_extent_buffer(path->nodes[0], 0, (unsigned long)inode_item, | ||
| 4699 | sizeof(*inode_item)); | ||
| 4693 | fill_inode_item(trans, path->nodes[0], inode_item, inode); | 4700 | fill_inode_item(trans, path->nodes[0], inode_item, inode); |
| 4694 | 4701 | ||
| 4695 | ref = btrfs_item_ptr(path->nodes[0], path->slots[0] + 1, | 4702 | ref = btrfs_item_ptr(path->nodes[0], path->slots[0] + 1, |
| @@ -4723,6 +4730,8 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, | |||
| 4723 | trace_btrfs_inode_new(inode); | 4730 | trace_btrfs_inode_new(inode); |
| 4724 | btrfs_set_inode_last_trans(trans, inode); | 4731 | btrfs_set_inode_last_trans(trans, inode); |
| 4725 | 4732 | ||
| 4733 | btrfs_update_root_times(trans, root); | ||
| 4734 | |||
| 4726 | return inode; | 4735 | return inode; |
| 4727 | fail: | 4736 | fail: |
| 4728 | if (dir) | 4737 | if (dir) |
| @@ -4893,7 +4902,7 @@ out_unlock: | |||
| 4893 | } | 4902 | } |
| 4894 | 4903 | ||
| 4895 | static int btrfs_create(struct inode *dir, struct dentry *dentry, | 4904 | static int btrfs_create(struct inode *dir, struct dentry *dentry, |
| 4896 | umode_t mode, struct nameidata *nd) | 4905 | umode_t mode, bool excl) |
| 4897 | { | 4906 | { |
| 4898 | struct btrfs_trans_handle *trans; | 4907 | struct btrfs_trans_handle *trans; |
| 4899 | struct btrfs_root *root = BTRFS_I(dir)->root; | 4908 | struct btrfs_root *root = BTRFS_I(dir)->root; |
| @@ -5876,8 +5885,17 @@ map: | |||
| 5876 | bh_result->b_size = len; | 5885 | bh_result->b_size = len; |
| 5877 | bh_result->b_bdev = em->bdev; | 5886 | bh_result->b_bdev = em->bdev; |
| 5878 | set_buffer_mapped(bh_result); | 5887 | set_buffer_mapped(bh_result); |
| 5879 | if (create && !test_bit(EXTENT_FLAG_PREALLOC, &em->flags)) | 5888 | if (create) { |
| 5880 | set_buffer_new(bh_result); | 5889 | if (!test_bit(EXTENT_FLAG_PREALLOC, &em->flags)) |
| 5890 | set_buffer_new(bh_result); | ||
| 5891 | |||
| 5892 | /* | ||
| 5893 | * Need to update the i_size under the extent lock so buffered | ||
| 5894 | * readers will get the updated i_size when we unlock. | ||
| 5895 | */ | ||
| 5896 | if (start + len > i_size_read(inode)) | ||
| 5897 | i_size_write(inode, start + len); | ||
| 5898 | } | ||
| 5881 | 5899 | ||
| 5882 | free_extent_map(em); | 5900 | free_extent_map(em); |
| 5883 | 5901 | ||
| @@ -6360,12 +6378,48 @@ static ssize_t btrfs_direct_IO(int rw, struct kiocb *iocb, | |||
| 6360 | */ | 6378 | */ |
| 6361 | ordered = btrfs_lookup_ordered_range(inode, lockstart, | 6379 | ordered = btrfs_lookup_ordered_range(inode, lockstart, |
| 6362 | lockend - lockstart + 1); | 6380 | lockend - lockstart + 1); |
| 6363 | if (!ordered) | 6381 | |
| 6382 | /* | ||
| 6383 | * We need to make sure there are no buffered pages in this | ||
| 6384 | * range either, we could have raced between the invalidate in | ||
| 6385 | * generic_file_direct_write and locking the extent. The | ||
| 6386 | * invalidate needs to happen so that reads after a write do not | ||
| 6387 | * get stale data. | ||
| 6388 | */ | ||
| 6389 | if (!ordered && (!writing || | ||
| 6390 | !test_range_bit(&BTRFS_I(inode)->io_tree, | ||
| 6391 | lockstart, lockend, EXTENT_UPTODATE, 0, | ||
| 6392 | cached_state))) | ||
| 6364 | break; | 6393 | break; |
| 6394 | |||
| 6365 | unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend, | 6395 | unlock_extent_cached(&BTRFS_I(inode)->io_tree, lockstart, lockend, |
| 6366 | &cached_state, GFP_NOFS); | 6396 | &cached_state, GFP_NOFS); |
| 6367 | btrfs_start_ordered_extent(inode, ordered, 1); | 6397 | |
| 6368 | btrfs_put_ordered_extent(ordered); | 6398 | if (ordered) { |
| 6399 | btrfs_start_ordered_extent(inode, ordered, 1); | ||
| 6400 | btrfs_put_ordered_extent(ordered); | ||
| 6401 | } else { | ||
| 6402 | /* Screw you mmap */ | ||
| 6403 | ret = filemap_write_and_wait_range(file->f_mapping, | ||
| 6404 | lockstart, | ||
| 6405 | lockend); | ||
| 6406 | if (ret) | ||
| 6407 | goto out; | ||
| 6408 | |||
| 6409 | /* | ||
| 6410 | * If we found a page that couldn't be invalidated just | ||
| 6411 | * fall back to buffered. | ||
| 6412 | */ | ||
| 6413 | ret = invalidate_inode_pages2_range(file->f_mapping, | ||
| 6414 | lockstart >> PAGE_CACHE_SHIFT, | ||
| 6415 | lockend >> PAGE_CACHE_SHIFT); | ||
| 6416 | if (ret) { | ||
| 6417 | if (ret == -EBUSY) | ||
| 6418 | ret = 0; | ||
| 6419 | goto out; | ||
| 6420 | } | ||
| 6421 | } | ||
| 6422 | |||
| 6369 | cond_resched(); | 6423 | cond_resched(); |
| 6370 | } | 6424 | } |
| 6371 | 6425 | ||
| @@ -6575,6 +6629,7 @@ int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
| 6575 | u64 page_start; | 6629 | u64 page_start; |
| 6576 | u64 page_end; | 6630 | u64 page_end; |
| 6577 | 6631 | ||
| 6632 | sb_start_pagefault(inode->i_sb); | ||
| 6578 | ret = btrfs_delalloc_reserve_space(inode, PAGE_CACHE_SIZE); | 6633 | ret = btrfs_delalloc_reserve_space(inode, PAGE_CACHE_SIZE); |
| 6579 | if (!ret) { | 6634 | if (!ret) { |
| 6580 | ret = file_update_time(vma->vm_file); | 6635 | ret = file_update_time(vma->vm_file); |
| @@ -6664,12 +6719,15 @@ again: | |||
| 6664 | unlock_extent_cached(io_tree, page_start, page_end, &cached_state, GFP_NOFS); | 6719 | unlock_extent_cached(io_tree, page_start, page_end, &cached_state, GFP_NOFS); |
| 6665 | 6720 | ||
| 6666 | out_unlock: | 6721 | out_unlock: |
| 6667 | if (!ret) | 6722 | if (!ret) { |
| 6723 | sb_end_pagefault(inode->i_sb); | ||
| 6668 | return VM_FAULT_LOCKED; | 6724 | return VM_FAULT_LOCKED; |
| 6725 | } | ||
| 6669 | unlock_page(page); | 6726 | unlock_page(page); |
| 6670 | out: | 6727 | out: |
| 6671 | btrfs_delalloc_release_space(inode, PAGE_CACHE_SIZE); | 6728 | btrfs_delalloc_release_space(inode, PAGE_CACHE_SIZE); |
| 6672 | out_noreserve: | 6729 | out_noreserve: |
| 6730 | sb_end_pagefault(inode->i_sb); | ||
| 6673 | return ret; | 6731 | return ret; |
| 6674 | } | 6732 | } |
| 6675 | 6733 | ||
| @@ -6894,7 +6952,6 @@ struct inode *btrfs_alloc_inode(struct super_block *sb) | |||
| 6894 | return NULL; | 6952 | return NULL; |
| 6895 | 6953 | ||
| 6896 | ei->root = NULL; | 6954 | ei->root = NULL; |
| 6897 | ei->space_info = NULL; | ||
| 6898 | ei->generation = 0; | 6955 | ei->generation = 0; |
| 6899 | ei->last_trans = 0; | 6956 | ei->last_trans = 0; |
| 6900 | ei->last_sub_trans = 0; | 6957 | ei->last_sub_trans = 0; |
| @@ -6942,7 +6999,7 @@ void btrfs_destroy_inode(struct inode *inode) | |||
| 6942 | struct btrfs_ordered_extent *ordered; | 6999 | struct btrfs_ordered_extent *ordered; |
| 6943 | struct btrfs_root *root = BTRFS_I(inode)->root; | 7000 | struct btrfs_root *root = BTRFS_I(inode)->root; |
| 6944 | 7001 | ||
| 6945 | WARN_ON(!list_empty(&inode->i_dentry)); | 7002 | WARN_ON(!hlist_empty(&inode->i_dentry)); |
| 6946 | WARN_ON(inode->i_data.nrpages); | 7003 | WARN_ON(inode->i_data.nrpages); |
| 6947 | WARN_ON(BTRFS_I(inode)->outstanding_extents); | 7004 | WARN_ON(BTRFS_I(inode)->outstanding_extents); |
| 6948 | WARN_ON(BTRFS_I(inode)->reserved_extents); | 7005 | WARN_ON(BTRFS_I(inode)->reserved_extents); |
| @@ -7001,7 +7058,7 @@ int btrfs_drop_inode(struct inode *inode) | |||
| 7001 | struct btrfs_root *root = BTRFS_I(inode)->root; | 7058 | struct btrfs_root *root = BTRFS_I(inode)->root; |
| 7002 | 7059 | ||
| 7003 | if (btrfs_root_refs(&root->root_item) == 0 && | 7060 | if (btrfs_root_refs(&root->root_item) == 0 && |
| 7004 | !btrfs_is_free_space_inode(root, inode)) | 7061 | !btrfs_is_free_space_inode(inode)) |
| 7005 | return 1; | 7062 | return 1; |
| 7006 | else | 7063 | else |
| 7007 | return generic_drop_inode(inode); | 7064 | return generic_drop_inode(inode); |
