summaryrefslogtreecommitdiffstats
path: root/src/H5Bprivate.h
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2010-02-16 17:18:38 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2010-02-16 17:18:38 (GMT)
commit7c82bbf030c2fbd226addc94db35fda253d83ca3 (patch)
tree761e19f98d2b21a11e660272bb07127d2b89baaa /src/H5Bprivate.h
parent5156b8a043f744799e0dc77a7dfa0690502a3397 (diff)
downloadhdf5-7c82bbf030c2fbd226addc94db35fda253d83ca3.zip
hdf5-7c82bbf030c2fbd226addc94db35fda253d83ca3.tar.gz
hdf5-7c82bbf030c2fbd226addc94db35fda253d83ca3.tar.bz2
[svn-r18262] Purpose: Fix bug in b-tree code
Description: In certain cases, removal of an object in a v1 b-tree would cause the leftmost key in the right neighbor to be overwritten. While this did not pose a problem for group b-trees, with chunked datasets it would overwrite the offset value of the neighbor's leftmost child, causing corruption. Reworked the code to differentiate between b-trees whose children are fundamentally associated with their left key and those who are associated with their right key. Tested: jam, linew, amani (h5committest)
Diffstat (limited to 'src/H5Bprivate.h')
-rw-r--r--src/H5Bprivate.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h
index 716b608..b0ffa07 100644
--- a/src/H5Bprivate.h
+++ b/src/H5Bprivate.h
@@ -78,6 +78,13 @@ typedef enum H5B_ins_t {
H5B_INS_REMOVE = 5 /*remove current node */
} H5B_ins_t;
+/* Enum for specifying the direction of the critical key in relation to the
+ * child */
+typedef enum H5B_dir_t {
+ H5B_LEFT = 0, /* Critical key is to the left */
+ H5B_RIGHT = 1 /* Critical key is to the right */
+} H5B_dir_t;
+
/* Define the operator callback function pointer for H5B_iterate() */
typedef int (*H5B_operator_t)(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
const void *_rt_key, void *_udata);
@@ -123,6 +130,9 @@ typedef struct H5B_class_t {
hbool_t follow_min;
hbool_t follow_max;
+ /* The direction of the key that is intrinsically associated with each node */
+ H5B_dir_t critical_key;
+
/* remove existing data */
H5B_ins_t (*remove)(H5F_t*, hid_t, haddr_t, void*, hbool_t*, void*, void*,
hbool_t*);