Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360443
b: refs/heads/master
c: 5d80366
h: refs/heads/master
i:
  360441: a0f0edd
  360439: c8c423e
v: v3
  • Loading branch information
Josef Bacik committed Feb 20, 2013
1 parent 86b4e61 commit 40a2433
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8696c53304f16fde9368b9d5c89a5acb4a815d4c
refs/heads/master: 5d80366e9b5e56b3ffc1923b4995e83bbbf605e3
5 changes: 5 additions & 0 deletions trunk/fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,11 @@ struct seq_list {
u64 seq;
};

enum btrfs_orphan_cleanup_state {
ORPHAN_CLEANUP_STARTED = 1,
ORPHAN_CLEANUP_DONE = 2,
};

/* fs_info */
struct reloc_control;
struct btrfs_device;
Expand Down
11 changes: 11 additions & 0 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ static void dump_space_info(struct btrfs_space_info *info, u64 bytes,
int dump_block_groups);
static int btrfs_update_reserved_bytes(struct btrfs_block_group_cache *cache,
u64 num_bytes, int reserve);
static int block_rsv_use_bytes(struct btrfs_block_rsv *block_rsv,
u64 num_bytes);

static noinline int
block_group_cache_done(struct btrfs_block_group_cache *cache)
Expand Down Expand Up @@ -4099,6 +4101,15 @@ static int reserve_metadata_bytes(struct btrfs_root *root,
goto again;

out:
if (ret == -ENOSPC &&
unlikely(root->orphan_cleanup_state == ORPHAN_CLEANUP_STARTED)) {
struct btrfs_block_rsv *global_rsv =
&root->fs_info->global_block_rsv;

if (block_rsv != global_rsv &&
!block_rsv_use_bytes(global_rsv, orig_bytes))
ret = 0;
}
if (flushing) {
spin_lock(&space_info->lock);
space_info->flush = 0;
Expand Down
5 changes: 0 additions & 5 deletions trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2218,11 +2218,6 @@ void btrfs_run_delayed_iputs(struct btrfs_root *root)
}
}

enum btrfs_orphan_cleanup_state {
ORPHAN_CLEANUP_STARTED = 1,
ORPHAN_CLEANUP_DONE = 2,
};

/*
* This is called in transaction commit time. If there are no orphan
* files in the subvolume, it removes orphan item and frees block_rsv
Expand Down

0 comments on commit 40a2433

Please sign in to comment.