Project

General

Profile

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
1007 1007
 * 
1008 1008
 * INSERTIONS: The search will split full nodes and leaves on its way down
1009 1009
 * and guarentee that the leaf it ends up on is not full.  If we run out
1010
 * of space the search continues to the leaf (to position the cursor for
1011
 * the spike), but ENOSPC is returned.
1010
 * of space the search continues to the leaf, but ENOSPC is returned.
1012 1011
 *
1013 1012
 * The search is only guarenteed to end up on a leaf if an error code of 0
1014 1013
 * is returned, or if inserting and an error code of ENOENT is returned.
......
1314 1313
		 * prepend and append an empty leaf node in order to make
1315 1314
		 * the boundary correction.
1316 1315
		 *
1317
		 * If we run out of space we set enospc and continue on
1318
		 * to a leaf to provide the spike code with a good point
1319
		 * of entry.
1316
		 * If we run out of space we set enospc but continue on
1317
		 * to a leaf.
1320 1318
		 */
1321 1319
		if ((flags & HAMMER_CURSOR_INSERT) && enospc == 0) {
1322 1320
			if (btree_node_is_full(node)) {
......
1460 1458
	/*
1461 1459
	 * We reached a leaf but did not find the key we were looking for.
1462 1460
	 * If this is an insert we will be properly positioned for an insert
1463
	 * (ENOENT) or spike (ENOSPC) operation.
1461
	 * (ENOENT) or unable to insert (ENOSPC).
1464 1462
	 */
1465 1463
	error = enospc ? ENOSPC : ENOENT;
1466 1464
done:
......
1790 1788
	 * right to try to optimize node fill and flag it.  If we hit
1791 1789
	 * that same leaf again our heuristic failed and we don't try
1792 1790
	 * to optimize node fill (it could lead to a degenerate case).
1793
	 *
1794
	 * Spikes are made up of two leaf elements which cannot be
1795
	 * safely split.
1796 1791
	 */
1797 1792
	leaf = cursor->node;
1798 1793
	ondisk = leaf->ondisk;
sys/vfs/hammer/hammer_cursor.c
641 641

  
642 642
	/*
643 643
	 * Ok, push down into elm.  If elm specifies an internal or leaf
644
	 * node the current node must be an internal node.  If elm specifies
645
	 * a spike then the current node must be a leaf node.
644
	 * node the current node must be an internal node.
646 645
	 */
647 646
	switch(elm->base.btype) {
648 647
	case HAMMER_BTREE_TYPE_INTERNAL:
649
-