Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196010
b: refs/heads/master
c: 73bb488
h: refs/heads/master
v: v3
  • Loading branch information
Li Hong authored and Ryusuke Konishi committed May 10, 2010
1 parent 194b6f9 commit 6aff580
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 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: f905440f5edfa70a07e64bdbc973cbdd55dd001d
refs/heads/master: 73bb48869b14fd5094b9ec173a2bf86bc0e464d4
22 changes: 5 additions & 17 deletions trunk/fs/nilfs2/btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,14 @@ static struct nilfs_btree_path *nilfs_btree_alloc_path(void)
return path;
}

static inline void nilfs_btree_free_path(struct nilfs_btree_path *path)
static void nilfs_btree_free_path(struct nilfs_btree_path *path)
{
kmem_cache_free(nilfs_btree_path_cache, path);
}

static void nilfs_btree_release_path(struct nilfs_btree_path *path)
{
int level;
int level = NILFS_BTREE_LEVEL_DATA;

for (level = NILFS_BTREE_LEVEL_DATA; level < NILFS_BTREE_LEVEL_MAX;
level++)
for (; level < NILFS_BTREE_LEVEL_MAX; level++)
brelse(path[level].bp_bh);

kmem_cache_free(nilfs_btree_path_cache, path);
}

/*
Expand Down Expand Up @@ -573,7 +569,6 @@ static int nilfs_btree_lookup(const struct nilfs_bmap *bmap,
if (ptrp != NULL)
*ptrp = ptr;

nilfs_btree_release_path(path);
nilfs_btree_free_path(path);

return ret;
Expand Down Expand Up @@ -655,7 +650,6 @@ static int nilfs_btree_lookup_contig(const struct nilfs_bmap *bmap,
*ptrp = ptr;
ret = cnt;
out:
nilfs_btree_release_path(path);
nilfs_btree_free_path(path);
return ret;
}
Expand Down Expand Up @@ -1139,7 +1133,6 @@ static int nilfs_btree_insert(struct nilfs_bmap *bmap, __u64 key, __u64 ptr)
nilfs_bmap_add_blocks(bmap, stats.bs_nblocks);

out:
nilfs_btree_release_path(path);
nilfs_btree_free_path(path);
return ret;
}
Expand Down Expand Up @@ -1472,7 +1465,6 @@ static int nilfs_btree_delete(struct nilfs_bmap *bmap, __u64 key)
nilfs_bmap_sub_blocks(bmap, stats.bs_nblocks);

out:
nilfs_btree_release_path(path);
nilfs_btree_free_path(path);
return ret;
}
Expand All @@ -1490,7 +1482,6 @@ static int nilfs_btree_last_key(const struct nilfs_bmap *bmap, __u64 *keyp)

ret = nilfs_btree_do_lookup_last(btree, path, keyp, NULL);

nilfs_btree_release_path(path);
nilfs_btree_free_path(path);

return ret;
Expand Down Expand Up @@ -1944,7 +1935,6 @@ static int nilfs_btree_propagate(const struct nilfs_bmap *bmap,
nilfs_btree_propagate_p(btree, path, level, bh);

out:
nilfs_btree_release_path(path);
nilfs_btree_free_path(path);

return ret;
Expand Down Expand Up @@ -2126,7 +2116,6 @@ static int nilfs_btree_assign(struct nilfs_bmap *bmap,
nilfs_btree_assign_p(btree, path, level, bh, blocknr, binfo);

out:
nilfs_btree_release_path(path);
nilfs_btree_free_path(path);

return ret;
Expand Down Expand Up @@ -2190,7 +2179,6 @@ static int nilfs_btree_mark(struct nilfs_bmap *bmap, __u64 key, int level)
nilfs_bmap_set_dirty(&btree->bt_bmap);

out:
nilfs_btree_release_path(path);
nilfs_btree_free_path(path);
return ret;
}
Expand Down

0 comments on commit 6aff580

Please sign in to comment.