diff options
author | David S. Miller <davem@davemloft.net> | 2016-06-30 05:03:36 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-30 05:03:36 -0400 |
commit | ee58b57100ca953da7320c285315a95db2f7053d (patch) | |
tree | 77b815a31240adc4d6326346908137fc6c2c3a96 /fs/btrfs/inode.c | |
parent | 6f30e8b022c8e3a722928ddb1a2ae0be852fcc0e (diff) | |
parent | e7bdea7750eb2a64aea4a08fa5c0a31719c8155d (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Several cases of overlapping changes, except the packet scheduler
conflicts which deal with the addition of the free list parameter
to qdisc_enqueue().
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 8b1212e8f7a8..4421954720b8 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -3271,7 +3271,16 @@ int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode) | |||
3271 | /* grab metadata reservation from transaction handle */ | 3271 | /* grab metadata reservation from transaction handle */ |
3272 | if (reserve) { | 3272 | if (reserve) { |
3273 | ret = btrfs_orphan_reserve_metadata(trans, inode); | 3273 | ret = btrfs_orphan_reserve_metadata(trans, inode); |
3274 | BUG_ON(ret); /* -ENOSPC in reservation; Logic error? JDM */ | 3274 | ASSERT(!ret); |
3275 | if (ret) { | ||
3276 | atomic_dec(&root->orphan_inodes); | ||
3277 | clear_bit(BTRFS_INODE_ORPHAN_META_RESERVED, | ||
3278 | &BTRFS_I(inode)->runtime_flags); | ||
3279 | if (insert) | ||
3280 | clear_bit(BTRFS_INODE_HAS_ORPHAN_ITEM, | ||
3281 | &BTRFS_I(inode)->runtime_flags); | ||
3282 | return ret; | ||
3283 | } | ||
3275 | } | 3284 | } |
3276 | 3285 | ||
3277 | /* insert an orphan item to track this unlinked/truncated file */ | 3286 | /* insert an orphan item to track this unlinked/truncated file */ |
@@ -4549,6 +4558,7 @@ delete: | |||
4549 | BUG_ON(ret); | 4558 | BUG_ON(ret); |
4550 | if (btrfs_should_throttle_delayed_refs(trans, root)) | 4559 | if (btrfs_should_throttle_delayed_refs(trans, root)) |
4551 | btrfs_async_run_delayed_refs(root, | 4560 | btrfs_async_run_delayed_refs(root, |
4561 | trans->transid, | ||
4552 | trans->delayed_ref_updates * 2, 0); | 4562 | trans->delayed_ref_updates * 2, 0); |
4553 | if (be_nice) { | 4563 | if (be_nice) { |
4554 | if (truncate_space_check(trans, root, | 4564 | if (truncate_space_check(trans, root, |
@@ -5748,6 +5758,7 @@ static int btrfs_real_readdir(struct file *file, struct dir_context *ctx) | |||
5748 | int name_len; | 5758 | int name_len; |
5749 | int is_curr = 0; /* ctx->pos points to the current index? */ | 5759 | int is_curr = 0; /* ctx->pos points to the current index? */ |
5750 | bool emitted; | 5760 | bool emitted; |
5761 | bool put = false; | ||
5751 | 5762 | ||
5752 | /* FIXME, use a real flag for deciding about the key type */ | 5763 | /* FIXME, use a real flag for deciding about the key type */ |
5753 | if (root->fs_info->tree_root == root) | 5764 | if (root->fs_info->tree_root == root) |
@@ -5765,7 +5776,8 @@ static int btrfs_real_readdir(struct file *file, struct dir_context *ctx) | |||
5765 | if (key_type == BTRFS_DIR_INDEX_KEY) { | 5776 | if (key_type == BTRFS_DIR_INDEX_KEY) { |
5766 | INIT_LIST_HEAD(&ins_list); | 5777 | INIT_LIST_HEAD(&ins_list); |
5767 | INIT_LIST_HEAD(&del_list); | 5778 | INIT_LIST_HEAD(&del_list); |
5768 | btrfs_get_delayed_items(inode, &ins_list, &del_list); | 5779 | put = btrfs_readdir_get_delayed_items(inode, &ins_list, |
5780 | &del_list); | ||
5769 | } | 5781 | } |
5770 | 5782 | ||
5771 | key.type = key_type; | 5783 | key.type = key_type; |
@@ -5912,8 +5924,8 @@ next: | |||
5912 | nopos: | 5924 | nopos: |
5913 | ret = 0; | 5925 | ret = 0; |
5914 | err: | 5926 | err: |
5915 | if (key_type == BTRFS_DIR_INDEX_KEY) | 5927 | if (put) |
5916 | btrfs_put_delayed_items(&ins_list, &del_list); | 5928 | btrfs_readdir_put_delayed_items(inode, &ins_list, &del_list); |
5917 | btrfs_free_path(path); | 5929 | btrfs_free_path(path); |
5918 | return ret; | 5930 | return ret; |
5919 | } | 5931 | } |
@@ -10525,7 +10537,7 @@ static const struct inode_operations btrfs_dir_ro_inode_operations = { | |||
10525 | static const struct file_operations btrfs_dir_file_operations = { | 10537 | static const struct file_operations btrfs_dir_file_operations = { |
10526 | .llseek = generic_file_llseek, | 10538 | .llseek = generic_file_llseek, |
10527 | .read = generic_read_dir, | 10539 | .read = generic_read_dir, |
10528 | .iterate = btrfs_real_readdir, | 10540 | .iterate_shared = btrfs_real_readdir, |
10529 | .unlocked_ioctl = btrfs_ioctl, | 10541 | .unlocked_ioctl = btrfs_ioctl, |
10530 | #ifdef CONFIG_COMPAT | 10542 | #ifdef CONFIG_COMPAT |
10531 | .compat_ioctl = btrfs_compat_ioctl, | 10543 | .compat_ioctl = btrfs_compat_ioctl, |