}
}
-static void nilfs_btree_clear_path(struct nilfs_btree_path *path)
+static void nilfs_btree_release_path(struct nilfs_btree_path *path)
{
int level;
- for (level = NILFS_BTREE_LEVEL_DATA;
- level < NILFS_BTREE_LEVEL_MAX;
- level++) {
- if (path[level].bp_bh != NULL) {
- brelse(path[level].bp_bh);
- path[level].bp_bh = NULL;
- }
- /* sib_bh is released or deleted by prepare or commit
- * operations. */
- path[level].bp_sib_bh = NULL;
- path[level].bp_index = 0;
- path[level].bp_oldreq.bpr_ptr = NILFS_BMAP_INVALID_PTR;
- path[level].bp_newreq.bpr_ptr = NILFS_BMAP_INVALID_PTR;
- path[level].bp_op = NULL;
- }
+ for (level = NILFS_BTREE_LEVEL_DATA; level < NILFS_BTREE_LEVEL_MAX;
+ level++)
+ brelse(path[level].bp_bh);
}
/*
if (ptrp != NULL)
*ptrp = ptr;
- nilfs_btree_clear_path(path);
+ nilfs_btree_release_path(path);
nilfs_btree_free_path(path);
return ret;
*ptrp = ptr;
ret = cnt;
out:
- nilfs_btree_clear_path(path);
+ nilfs_btree_release_path(path);
nilfs_btree_free_path(path);
return ret;
}
nilfs_bmap_add_blocks(bmap, stats.bs_nblocks);
out:
- nilfs_btree_clear_path(path);
+ nilfs_btree_release_path(path);
nilfs_btree_free_path(path);
return ret;
}
nilfs_bmap_sub_blocks(bmap, stats.bs_nblocks);
out:
- nilfs_btree_clear_path(path);
+ nilfs_btree_release_path(path);
nilfs_btree_free_path(path);
return ret;
}
ret = nilfs_btree_do_lookup_last(btree, path, keyp, NULL);
- nilfs_btree_clear_path(path);
+ nilfs_btree_release_path(path);
nilfs_btree_free_path(path);
return ret;
nilfs_btree_propagate_p(btree, path, level, bh);
out:
- nilfs_btree_clear_path(path);
+ nilfs_btree_release_path(path);
nilfs_btree_free_path(path);
return ret;
nilfs_btree_assign_p(btree, path, level, bh, blocknr, binfo);
out:
- nilfs_btree_clear_path(path);
+ nilfs_btree_release_path(path);
nilfs_btree_free_path(path);
return ret;
nilfs_bmap_set_dirty(&btree->bt_bmap);
out:
- nilfs_btree_clear_path(path);
+ nilfs_btree_release_path(path);
nilfs_btree_free_path(path);
return ret;
}