Project

General

Profile

Submit #2764 ยป 0001-sys-vfs-hammer-fix-comments-regarding-obsolete-spike.patch

tkusumi, 01/08/2015 05:38 AM

View differences:

sys/vfs/hammer/hammer_btree.c
*
* INSERTIONS: The search will split full nodes and leaves on its way down
* and guarentee that the leaf it ends up on is not full. If we run out
* of space the search continues to the leaf (to position the cursor for
* the spike), but ENOSPC is returned.
* of space the search continues to the leaf, but ENOSPC is returned.
*
* The search is only guarenteed to end up on a leaf if an error code of 0
* is returned, or if inserting and an error code of ENOENT is returned.
......
* prepend and append an empty leaf node in order to make
* the boundary correction.
*
* If we run out of space we set enospc and continue on
* to a leaf to provide the spike code with a good point
* of entry.
* If we run out of space we set enospc but continue on
* to a leaf.
*/
if ((flags & HAMMER_CURSOR_INSERT) && enospc == 0) {
if (btree_node_is_full(node)) {
......
/*
* We reached a leaf but did not find the key we were looking for.
* If this is an insert we will be properly positioned for an insert
* (ENOENT) or spike (ENOSPC) operation.
* (ENOENT) or unable to insert (ENOSPC).
*/
error = enospc ? ENOSPC : ENOENT;
done:
......
* right to try to optimize node fill and flag it. If we hit
* that same leaf again our heuristic failed and we don't try
* to optimize node fill (it could lead to a degenerate case).
*
* Spikes are made up of two leaf elements which cannot be
* safely split.
*/
leaf = cursor->node;
ondisk = leaf->ondisk;
sys/vfs/hammer/hammer_cursor.c
/*
* Ok, push down into elm. If elm specifies an internal or leaf
* node the current node must be an internal node. If elm specifies
* a spike then the current node must be a leaf node.
* node the current node must be an internal node.
*/
switch(elm->base.btype) {
case HAMMER_BTREE_TYPE_INTERNAL:
    (1-1/1)