Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309925
b: refs/heads/master
c: e9b7fd4
h: refs/heads/master
i:
  309923: bdf7f2f
v: v3
  • Loading branch information
Jan Schmidt committed May 31, 2012
1 parent 708c6ae commit ad15dbb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 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: 926dd8a640da1bbf7478eebea1c23a842fc9c890
refs/heads/master: e9b7fd4d8b7c915cff353ca085b83bd19737396b
24 changes: 15 additions & 9 deletions trunk/fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,14 +455,25 @@ __tree_mod_log_insert(struct btrfs_fs_info *fs_info, struct tree_mod_elem *tm)
return ret;
}

static inline int tree_mod_dont_log(struct btrfs_fs_info *fs_info,
struct extent_buffer *eb) {
smp_mb();
if (list_empty(&(fs_info)->tree_mod_seq_list))
return 1;
if (!eb)
return 0;
if (btrfs_header_level(eb) == 0)
return 1;
return 0;
}

static inline int tree_mod_alloc(struct btrfs_fs_info *fs_info, gfp_t flags,
struct tree_mod_elem **tm_ret)
{
struct tree_mod_elem *tm;
int seq;

smp_mb();
if (list_empty(&fs_info->tree_mod_seq_list))
if (tree_mod_dont_log(fs_info, NULL))
return 0;

tm = *tm_ret = kzalloc(sizeof(*tm), flags);
Expand Down Expand Up @@ -643,8 +654,7 @@ tree_mod_log_eb_copy(struct btrfs_fs_info *fs_info, struct extent_buffer *dst,
int ret;
int i;

smp_mb();
if (list_empty(&fs_info->tree_mod_seq_list))
if (tree_mod_dont_log(fs_info, NULL))
return;

if (btrfs_header_level(dst) == 0 && btrfs_header_level(src) == 0)
Expand Down Expand Up @@ -691,11 +701,7 @@ static void tree_mod_log_free_eb(struct btrfs_fs_info *fs_info,
int ret;
u32 nritems;

smp_mb();
if (list_empty(&fs_info->tree_mod_seq_list))
return;

if (btrfs_header_level(eb) == 0)
if (tree_mod_dont_log(fs_info, eb))
return;

nritems = btrfs_header_nritems(eb);
Expand Down

0 comments on commit ad15dbb

Please sign in to comment.