summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5Atest.c1
-rw-r--r--src/H5B.c11
-rw-r--r--src/H5Bcache.c124
-rw-r--r--src/H5Bdbg.c7
-rw-r--r--src/H5Bpkg.h12
-rw-r--r--src/H5Bprivate.h17
-rw-r--r--src/H5D.c1
-rw-r--r--src/H5Dbtree.c54
-rw-r--r--src/H5Dchunk.c1
-rw-r--r--src/H5Dcontig.c1
-rw-r--r--src/H5Ddbg.c1
-rw-r--r--src/H5Ddeprec.c1
-rw-r--r--src/H5Dfill.c1
-rw-r--r--src/H5Dint.c2
-rw-r--r--src/H5Fpkg.h1
-rw-r--r--src/H5Gnode.c50
-rw-r--r--src/H5Gpkg.h1
-rw-r--r--src/H5I.c1
-rw-r--r--src/H5Opkg.h1
-rw-r--r--src/H5Pdcpl.c2
-rw-r--r--src/H5Pfapl.c1
-rw-r--r--src/H5R.c1
-rw-r--r--src/H5Rdeprec.c1
-rw-r--r--src/H5T.c1
-rw-r--r--src/H5Tcommit.c1
-rw-r--r--src/H5Tdeprec.c1
-rw-r--r--src/H5Zscaleoffset.c1
27 files changed, 127 insertions, 170 deletions
diff --git a/src/H5Atest.c b/src/H5Atest.c
index df88472..845c6c8 100644
--- a/src/H5Atest.c
+++ b/src/H5Atest.c
@@ -37,6 +37,7 @@
/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Apkg.h" /* Attributes */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Eprivate.h" /* Error handling */
#include "H5Iprivate.h" /* IDs */
#include "H5SMprivate.h" /* Shared object header messages */
diff --git a/src/H5B.c b/src/H5B.c
index 2573ba4..a0168aa 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -233,6 +233,7 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata,
bt->nchildren = 0;
if(NULL == (bt->rc_shared = (type->get_shared)(f, udata)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree node buffer")
+ H5RC_INC(bt->rc_shared);
shared=(H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared);
HDassert(shared);
if(NULL == (bt->native = H5FL_BLK_MALLOC(native_block, shared->sizeof_keys)) ||
@@ -321,7 +322,7 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u
while(lt < rt && cmp) {
idx = (lt + rt) / 2;
/* compare */
- if((cmp = (type->cmp3)(f, dxpl_id, H5B_NKEY(bt, shared, idx), udata, H5B_NKEY(bt, shared, (idx + 1)))) < 0)
+ if((cmp = (type->cmp3)(H5B_NKEY(bt, shared, idx), udata, H5B_NKEY(bt, shared, (idx + 1)))) < 0)
rt = idx;
else
lt = idx + 1;
@@ -823,7 +824,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type
while(lt < rt && cmp) {
idx = (lt + rt) / 2;
- if((cmp = (type->cmp3)(f, dxpl_id, H5B_NKEY(bt, shared, idx), udata, H5B_NKEY(bt, shared, idx + 1))) < 0)
+ if((cmp = (type->cmp3)(H5B_NKEY(bt, shared, idx), udata, H5B_NKEY(bt, shared, idx + 1))) < 0)
rt = idx;
else
lt = idx + 1;
@@ -1035,7 +1036,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type
* The max key in the original left node must be equal to the min key
* in the new node.
*/
- cmp = (type->cmp2)(f, dxpl_id, H5B_NKEY(bt, shared, bt->nchildren), udata,
+ cmp = (type->cmp2)(H5B_NKEY(bt, shared, bt->nchildren), udata,
H5B_NKEY(twin, shared, 0));
HDassert(0 == cmp);
#endif
@@ -1293,7 +1294,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type
rt = bt->nchildren;
while(lt < rt && cmp) {
idx = (lt + rt) / 2;
- if((cmp = (type->cmp3)(f, dxpl_id, H5B_NKEY(bt, shared, idx), udata, H5B_NKEY(bt, shared, idx + 1))) < 0)
+ if((cmp = (type->cmp3)(H5B_NKEY(bt, shared, idx), udata, H5B_NKEY(bt, shared, idx + 1))) < 0)
rt = idx;
else
lt = idx + 1;
@@ -1711,6 +1712,8 @@ H5B_shared_new(const H5F_t *f, const H5B_class_t *type, size_t sizeof_rkey)
/* Set up the "global" information for this file's groups */
shared->type = type;
shared->two_k = 2 * H5F_KVALUE(f, type);
+ shared->sizeof_addr = H5F_SIZEOF_ADDR(f);
+ shared->sizeof_len = H5F_SIZEOF_SIZE(f);
shared->sizeof_rkey = sizeof_rkey;
HDassert(shared->sizeof_rkey);
shared->sizeof_keys = (shared->two_k + 1) * type->sizeof_nkey;
diff --git a/src/H5Bcache.c b/src/H5Bcache.c
index cc5bbbf..99cd0cd 100644
--- a/src/H5Bcache.c
+++ b/src/H5Bcache.c
@@ -54,9 +54,6 @@
/* Local Prototypes */
/********************/
-/* General routines */
-static herr_t H5B_serialize(const H5F_t *f, const H5B_t *bt);
-
/* Metadata cache callbacks */
static H5B_t *H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata);
static herr_t H5B_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *b, unsigned UNUSED * flags_ptr);
@@ -86,78 +83,6 @@ const H5AC_class_t H5AC_BT[1] = {{
/*-------------------------------------------------------------------------
- * Function: H5B_serialize
- *
- * Purpose: Serialize the data structure for writing to disk.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Bill Wendling
- * wendling@ncsa.uiuc.edu
- * Sept. 15, 2003
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5B_serialize(const H5F_t *f, const H5B_t *bt)
-{
- H5B_shared_t *shared=NULL; /* Pointer to shared B-tree info */
- unsigned u;
- uint8_t *p; /* Pointer into raw data buffer */
- uint8_t *native; /* Pointer to native keys */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5B_serialize, FAIL)
-
- /* check arguments */
- HDassert(f);
- HDassert(bt);
- HDassert(bt->rc_shared);
- shared = (H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared);
- HDassert(shared);
-
- p = shared->page;
-
- /* magic number */
- HDmemcpy(p, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC);
- p += 4;
-
- /* node type and level */
- *p++ = (uint8_t)shared->type->id;
- H5_CHECK_OVERFLOW(bt->level, unsigned, uint8_t);
- *p++ = (uint8_t)bt->level;
-
- /* entries used */
- UINT16ENCODE(p, bt->nchildren);
-
- /* sibling pointers */
- H5F_addr_encode(f, &p, bt->left);
- H5F_addr_encode(f, &p, bt->right);
-
- /* child keys and pointers */
- native = bt->native;
- for(u = 0; u < bt->nchildren; ++u) {
- /* encode the key */
- if(shared->type->encode(f, bt, p, native) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key")
- p += shared->sizeof_rkey;
- native += shared->type->sizeof_nkey;
-
- /* encode the child address */
- H5F_addr_encode(f, &p, bt->child[u]);
- } /* end for */
- if(bt->nchildren > 0) {
- /* Encode the final key */
- if(shared->type->encode(f, bt, p, native) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key")
- } /* end if */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5B_serialize() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5B_load
*
* Purpose: Loads a B-tree node from the disk.
@@ -194,8 +119,12 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata)
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "can't allocate B-tree struct")
HDmemset(&bt->cache_info, 0, sizeof(H5AC_info_t));
+ /* Set & increment the ref-counted "shared" B-tree information for the node */
if(NULL == (bt->rc_shared = (type->get_shared)(f, udata)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "can't retrieve B-tree node buffer")
+ H5RC_INC(bt->rc_shared);
+
+ /* Get a pointer to the shared info, for convenience */
shared = (H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared);
HDassert(shared);
@@ -232,7 +161,7 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata)
native = bt->native;
for(u = 0; u < bt->nchildren; u++) {
/* Decode native key value */
- if((type->decode)(f, bt, p, native) < 0)
+ if((type->decode)(shared, p, native) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDECODE, NULL, "unable to decode key")
p += shared->sizeof_rkey;
native += type->sizeof_nkey;
@@ -244,7 +173,7 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata)
/* Decode final key */
if(bt->nchildren > 0) {
/* Decode native key value */
- if((type->decode)(f, bt, p, native) < 0)
+ if((type->decode)(shared, p, native) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDECODE, NULL, "unable to decode key")
} /* end if */
@@ -290,8 +219,45 @@ H5B_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *bt, uns
HDassert(shared->type->encode);
if(bt->cache_info.is_dirty) {
- if(H5B_serialize(f, bt) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTSERIALIZE, FAIL, "unable to serialize B-tree")
+ uint8_t *p; /* Pointer into raw data buffer */
+ uint8_t *native; /* Pointer to native keys */
+ unsigned u; /* Local index variable */
+
+ p = shared->page;
+
+ /* magic number */
+ HDmemcpy(p, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC);
+ p += 4;
+
+ /* node type and level */
+ *p++ = (uint8_t)shared->type->id;
+ H5_CHECK_OVERFLOW(bt->level, unsigned, uint8_t);
+ *p++ = (uint8_t)bt->level;
+
+ /* entries used */
+ UINT16ENCODE(p, bt->nchildren);
+
+ /* sibling pointers */
+ H5F_addr_encode(f, &p, bt->left);
+ H5F_addr_encode(f, &p, bt->right);
+
+ /* child keys and pointers */
+ native = bt->native;
+ for(u = 0; u < bt->nchildren; ++u) {
+ /* encode the key */
+ if(shared->type->encode(shared, p, native) < 0)
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key")
+ p += shared->sizeof_rkey;
+ native += shared->type->sizeof_nkey;
+
+ /* encode the child address */
+ H5F_addr_encode(f, &p, bt->child[u]);
+ } /* end for */
+ if(bt->nchildren > 0) {
+ /* Encode the final key */
+ if(shared->type->encode(shared, p, native) < 0)
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key")
+ } /* end if */
/*
* Write the disk page. We always write the header, but we don't
diff --git a/src/H5Bdbg.c b/src/H5Bdbg.c
index aafb999..dff2380 100644
--- a/src/H5Bdbg.c
+++ b/src/H5Bdbg.c
@@ -126,14 +126,14 @@ H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f
HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3),
"Left Key:");
HDassert(H5B_NKEY(bt,shared,u));
- (void)(type->debug_key)(stream, f, dxpl_id, indent + 6, MAX(0, fwidth - 6),
+ (void)(type->debug_key)(stream, indent + 6, MAX(0, fwidth - 6),
H5B_NKEY(bt, shared, u), udata);
/* Decode the 'right' key & print it */
HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3),
"Right Key:");
HDassert(H5B_NKEY(bt, shared, u + 1));
- (void)(type->debug_key)(stream, f, dxpl_id, indent + 6, MAX (0, fwidth - 6),
+ (void)(type->debug_key)(stream, indent + 6, MAX (0, fwidth - 6),
H5B_NKEY(bt, shared, u + 1), udata);
} /* end if */
} /* end for */
@@ -239,8 +239,7 @@ H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void
tail = tmp;
/* Check that the keys are monotonically increasing */
- cmp = (type->cmp2)(f, dxpl_id, H5B_NKEY(bt, shared, i), udata,
- H5B_NKEY(bt, shared, i + 1));
+ cmp = (type->cmp2)(H5B_NKEY(bt, shared, i), udata, H5B_NKEY(bt, shared, i + 1));
HDassert(cmp < 0);
} /* end for */
} /* end if */
diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h
index 7aedd00..79b5e8a 100644
--- a/src/H5Bpkg.h
+++ b/src/H5Bpkg.h
@@ -32,6 +32,9 @@
#include "H5Bprivate.h"
/* Other private headers needed by this file */
+#include "H5ACprivate.h" /* Metadata cache */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5RCprivate.h" /* Reference counted objects */
/**************************/
@@ -47,9 +50,9 @@
/****************************/
/* The B-tree node as stored in memory... */
-struct H5B_t {
- H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */
- /* first field in structure */
+typedef struct H5B_t {
+ H5AC_info_t cache_info; /* Information for H5AC cache functions */
+ /* _must_ be first field in structure */
H5RC_t *rc_shared; /*ref-counted shared info */
unsigned level; /*node level */
unsigned nchildren; /*number of child pointers */
@@ -57,7 +60,7 @@ struct H5B_t {
haddr_t right; /*address of right sibling */
uint8_t *native; /*array of keys in native format */
haddr_t *child; /*2k child pointers */
-};
+} H5B_t;
/*****************************/
/* Package Private Variables */
@@ -75,6 +78,7 @@ H5FL_BLK_EXTERN(native_block);
/* Declare a free list to manage the H5B_t struct */
H5FL_EXTERN(H5B_t);
+
/******************************/
/* Package Private Prototypes */
/******************************/
diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h
index b0ffa07..83a357b 100644
--- a/src/H5Bprivate.h
+++ b/src/H5Bprivate.h
@@ -33,9 +33,7 @@
/* Private headers needed by this file */
#include "H5private.h" /* Generic Functions */
-#include "H5ACprivate.h" /* Metadata cache */
#include "H5Fprivate.h" /* File access */
-#include "H5FLprivate.h" /* Free Lists */
#include "H5RCprivate.h" /* Reference counted object functions */
/**************************/
@@ -89,9 +87,6 @@ typedef enum H5B_dir_t {
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);
-/* Typedef for B-tree in memory (defined in H5Bpkg.h) */
-typedef struct H5B_t H5B_t;
-
/* Each B-tree has certain information that can be shared across all
* the instances of nodes in that B-tree.
*/
@@ -101,6 +96,8 @@ typedef struct H5B_shared_t {
size_t sizeof_rkey; /* Size of raw (disk) key */
size_t sizeof_rnode; /* Size of raw (disk) node */
size_t sizeof_keys; /* Size of native (memory) key node */
+ size_t sizeof_addr; /* Size of file address (in bytes) */
+ size_t sizeof_len; /* Size of file lengths (in bytes) */
uint8_t *page; /* Disk page */
size_t *nkey; /* Offsets of each native key in native key buffer */
} H5B_shared_t;
@@ -118,8 +115,8 @@ typedef struct H5B_class_t {
size_t sizeof_nkey; /*size of native (memory) key*/
H5RC_t * (*get_shared)(const H5F_t*, const void*); /*shared info for node */
herr_t (*new_node)(H5F_t*, hid_t, H5B_ins_t, void*, void*, void*, haddr_t*);
- int (*cmp2)(H5F_t*, hid_t, void*, void*, void*); /*compare 2 keys */
- int (*cmp3)(H5F_t*, hid_t, void*, void*, void*); /*compare 3 keys */
+ int (*cmp2)(void*, void*, void*); /*compare 2 keys */
+ int (*cmp3)(void*, void*, void*); /*compare 3 keys */
htri_t (*found)(H5F_t*, hid_t, haddr_t, const void*, void*);
/* insert new data */
@@ -138,9 +135,9 @@ typedef struct H5B_class_t {
hbool_t*);
/* encode, decode, debug key values */
- herr_t (*decode)(const H5F_t*, const struct H5B_t*, const uint8_t*, void*);
- herr_t (*encode)(const H5F_t*, const struct H5B_t*, uint8_t*, void*);
- herr_t (*debug_key)(FILE*, H5F_t*, hid_t, int, int, const void*, const void*);
+ herr_t (*decode)(const H5B_shared_t*, const uint8_t*, void*);
+ herr_t (*encode)(const H5B_shared_t*, uint8_t*, const void*);
+ herr_t (*debug_key)(FILE*, int, int, const void*, const void*);
} H5B_class_t;
/* Information about B-tree */
diff --git a/src/H5D.c b/src/H5D.c
index 597ca77..8c1ccbd 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -27,6 +27,7 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Dpkg.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free lists */
diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c
index 89d2596..6ca826c 100644
--- a/src/H5Dbtree.c
+++ b/src/H5Dbtree.c
@@ -26,7 +26,6 @@
/* Module Setup */
/****************/
-#define H5B_PACKAGE /*suppress error about including H5Bpkg */
#define H5D_PACKAGE /*suppress error about including H5Dpkg */
@@ -34,7 +33,8 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
-#include "H5Bpkg.h" /* B-link trees */
+#include "H5ACprivate.h" /* Metadata cache */
+#include "H5Bprivate.h" /* B-link trees */
#include "H5Dpkg.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* Files */
@@ -42,11 +42,8 @@
#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* IDs */
#include "H5MFprivate.h" /* File space management */
-#include "H5MMprivate.h" /* Memory management */
#include "H5Oprivate.h" /* Object headers */
-#include "H5Pprivate.h" /* Property lists */
#include "H5Sprivate.h" /* Dataspaces */
-#include "H5SLprivate.h" /* Skip lists */
#include "H5Vprivate.h" /* Vector and array functions */
/****************/
@@ -106,10 +103,8 @@ static int H5D_btree_idx_iterate_cb(H5F_t *f, hid_t dxpl_id, const void *left_ke
static H5RC_t *H5D_btree_get_shared(const H5F_t *f, const void *_udata);
static herr_t H5D_btree_new_node(H5F_t *f, hid_t dxpl_id, H5B_ins_t, void *_lt_key,
void *_udata, void *_rt_key, haddr_t *addr_p /*out*/);
-static int H5D_btree_cmp2(H5F_t *f, hid_t dxpl_id, void *_lt_key, void *_udata,
- void *_rt_key);
-static int H5D_btree_cmp3(H5F_t *f, hid_t dxpl_id, void *_lt_key, void *_udata,
- void *_rt_key);
+static int H5D_btree_cmp2(void *_lt_key, void *_udata, void *_rt_key);
+static int H5D_btree_cmp3(void *_lt_key, void *_udata, void *_rt_key);
static htri_t H5D_btree_found(H5F_t *f, hid_t dxpl_id, haddr_t addr,
const void *_lt_key, void *_udata);
static H5B_ins_t H5D_btree_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr,
@@ -118,12 +113,12 @@ static H5B_ins_t H5D_btree_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr,
static H5B_ins_t H5D_btree_remove( H5F_t *f, hid_t dxpl_id, haddr_t addr,
void *_lt_key, hbool_t *lt_key_changed, void *_udata, void *_rt_key,
hbool_t *rt_key_changed);
-static herr_t H5D_btree_decode_key(const H5F_t *f, const H5B_t *bt,
- const uint8_t *raw, void *_key);
-static herr_t H5D_btree_encode_key(const H5F_t *f, const H5B_t *bt,
- uint8_t *raw, void *_key);
-static herr_t H5D_btree_debug_key(FILE *stream, H5F_t *f, hid_t dxpl_id,
- int indent, int fwidth, const void *key, const void *udata);
+static herr_t H5D_btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw,
+ void *_key);
+static herr_t H5D_btree_encode_key(const H5B_shared_t *shared, uint8_t *raw,
+ void *_key);
+static herr_t H5D_btree_debug_key(FILE *stream, int indent, int fwidth,
+ const void *key, const void *udata);
/* Chunked layout indexing callbacks */
static herr_t H5D_btree_idx_init(const H5D_chk_idx_info_t *idx_info,
@@ -231,9 +226,6 @@ H5D_btree_get_shared(const H5F_t UNUSED *f, const void *_udata)
HDassert(udata->storage->idx_type == H5D_CHUNK_BTREE);
HDassert(udata->storage->u.btree.shared);
- /* Increment reference count on B-tree info */
- H5RC_INC(udata->storage->u.btree.shared);
-
/* Return the pointer to the ref-count object */
FUNC_LEAVE_NOAPI(udata->storage->u.btree.shared)
} /* end H5D_btree_get_shared() */
@@ -332,10 +324,8 @@ done:
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static int
-H5D_btree_cmp2(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_udata,
- void *_rt_key)
+H5D_btree_cmp2(void *_lt_key, void *_udata, void *_rt_key)
{
H5D_btree_key_t *lt_key = (H5D_btree_key_t *) _lt_key;
H5D_btree_key_t *rt_key = (H5D_btree_key_t *) _rt_key;
@@ -383,10 +373,8 @@ H5D_btree_cmp2(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_udat
*
*-------------------------------------------------------------------------
*/
-/* ARGSUSED */
static int
-H5D_btree_cmp3(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_udata,
- void *_rt_key)
+H5D_btree_cmp3(void *_lt_key, void *_udata, void *_rt_key)
{
H5D_btree_key_t *lt_key = (H5D_btree_key_t *) _lt_key;
H5D_btree_key_t *rt_key = (H5D_btree_key_t *) _rt_key;
@@ -540,7 +528,7 @@ H5D_btree_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key,
HDassert(rt_key);
HDassert(new_node_p);
- cmp = H5D_btree_cmp3(f, dxpl_id, lt_key, udata, rt_key);
+ cmp = H5D_btree_cmp3(lt_key, udata, rt_key);
HDassert(cmp <= 0);
if(cmp < 0) {
@@ -674,19 +662,15 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_btree_decode_key(const H5F_t UNUSED *f, const H5B_t *bt, const uint8_t *raw, void *_key)
+H5D_btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key)
{
H5D_btree_key_t *key = (H5D_btree_key_t *) _key;
- H5B_shared_t *shared; /* Pointer to shared B-tree info */
size_t ndims;
unsigned u;
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_btree_decode_key)
/* check args */
- HDassert(f);
- HDassert(bt);
- shared = (H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared);
HDassert(shared);
HDassert(raw);
HDassert(key);
@@ -716,19 +700,15 @@ H5D_btree_decode_key(const H5F_t UNUSED *f, const H5B_t *bt, const uint8_t *raw,
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_btree_encode_key(const H5F_t UNUSED *f, const H5B_t *bt, uint8_t *raw, void *_key)
+H5D_btree_encode_key(const H5B_shared_t *shared, uint8_t *raw, void *_key)
{
H5D_btree_key_t *key = (H5D_btree_key_t *) _key;
- H5B_shared_t *shared; /* Pointer to shared B-tree info */
size_t ndims;
unsigned u;
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_btree_encode_key)
/* check args */
- HDassert(f);
- HDassert(bt);
- shared = (H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared);
HDassert(shared);
HDassert(raw);
HDassert(key);
@@ -759,8 +739,8 @@ H5D_btree_encode_key(const H5F_t UNUSED *f, const H5B_t *bt, uint8_t *raw, void
*/
/* ARGSUSED */
static herr_t
-H5D_btree_debug_key(FILE *stream, H5F_t UNUSED *f, hid_t UNUSED dxpl_id, int indent,
- int fwidth, const void *_key, const void *_udata)
+H5D_btree_debug_key(FILE *stream, int indent, int fwidth, const void *_key,
+ const void *_udata)
{
const H5D_btree_key_t *key = (const H5D_btree_key_t *)_key;
const unsigned *ndims = (const unsigned *)_udata;
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index e77f580..7485717 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -51,6 +51,7 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Dpkg.h" /* Dataset functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free Lists */
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c
index 7c1b87c..6c1fae6 100644
--- a/src/H5Dcontig.c
+++ b/src/H5Dcontig.c
@@ -34,6 +34,7 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Dpkg.h" /* Dataset functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* Files */
diff --git a/src/H5Ddbg.c b/src/H5Ddbg.c
index fa4c54c..2feb773 100644
--- a/src/H5Ddbg.c
+++ b/src/H5Ddbg.c
@@ -27,6 +27,7 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Dpkg.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5Iprivate.h" /* IDs */
diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c
index 637cb70..de7f48a 100644
--- a/src/H5Ddeprec.c
+++ b/src/H5Ddeprec.c
@@ -41,6 +41,7 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Dpkg.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5Iprivate.h" /* IDs */
diff --git a/src/H5Dfill.c b/src/H5Dfill.c
index 2f3f112..19d21d5 100644
--- a/src/H5Dfill.c
+++ b/src/H5Dfill.c
@@ -34,6 +34,7 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Dpkg.h" /* Dataset functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free Lists */
diff --git a/src/H5Dint.c b/src/H5Dint.c
index bfe16f7..5a9c0ea 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -27,8 +27,10 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Dpkg.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
#include "H5FOprivate.h" /* File objects */
#include "H5Iprivate.h" /* IDs */
#include "H5Lprivate.h" /* Links */
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index 73962bb..fd6da0d 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -36,6 +36,7 @@
/* Other private headers needed by this file */
#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5FLprivate.h" /* Free Lists */
#include "H5FOprivate.h" /* File objects */
#include "H5FSprivate.h" /* File free space */
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index 4bd8a29..1df2fe4 100644
--- a/src/H5Gnode.c
+++ b/src/H5Gnode.c
@@ -51,7 +51,6 @@ typedef struct H5G_node_key_t {
size_t offset; /*offset into heap for name */
} H5G_node_key_t;
-
/* Private macros */
#define H5G_NODE_SIZEOF_HDR(F) (H5_SIZEOF_MAGIC + 4)
@@ -63,10 +62,8 @@ static H5RC_t *H5G_node_get_shared(const H5F_t *f, const void *_udata);
static herr_t H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t op, void *_lt_key,
void *_udata, void *_rt_key,
haddr_t *addr_p/*out*/);
-static int H5G_node_cmp2(H5F_t *f, hid_t dxpl_id, void *_lt_key, void *_udata,
- void *_rt_key);
-static int H5G_node_cmp3(H5F_t *f, hid_t dxpl_id, void *_lt_key, void *_udata,
- void *_rt_key);
+static int H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key);
+static int H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key);
static htri_t H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_lt_key,
void *_udata);
static H5B_ins_t H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key,
@@ -77,13 +74,10 @@ static H5B_ins_t H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_l
static H5B_ins_t H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *lt_key,
hbool_t *lt_key_changed, void *udata,
void *rt_key, hbool_t *rt_key_changed);
-static herr_t H5G_node_decode_key(const H5F_t *f, const H5B_t *bt, const uint8_t *raw,
- void *_key);
-static herr_t H5G_node_encode_key(const H5F_t *f, const H5B_t *bt, uint8_t *raw,
- void *_key);
-static herr_t H5G_node_debug_key(FILE *stream, H5F_t *f, hid_t dxpl_id,
- int indent, int fwidth, const void *key,
- const void *udata);
+static herr_t H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key);
+static herr_t H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key);
+static herr_t H5G_node_debug_key(FILE *stream, int indent, int fwidth,
+ const void *key, const void *udata);
/* H5G inherits B-tree like properties from H5B */
H5B_class_t H5B_SNODE[1] = {{
@@ -131,18 +125,12 @@ H5FL_SEQ_DEFINE(H5G_entry_t);
static H5RC_t *
H5G_node_get_shared(const H5F_t *f, const void UNUSED *_udata)
{
- H5RC_t *rc;
-
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_get_shared)
HDassert(f);
- /* Increment reference count on shared B-tree node */
- rc = H5F_GRP_BTREE_SHARED(f);
- H5RC_INC(rc);
-
/* Return the pointer to the ref-count object */
- FUNC_LEAVE_NOAPI(rc)
+ FUNC_LEAVE_NOAPI(H5F_GRP_BTREE_SHARED(f))
} /* end H5G_node_get_shared() */
@@ -160,17 +148,17 @@ H5G_node_get_shared(const H5F_t *f, const void UNUSED *_udata)
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_node_decode_key(const H5F_t *f, const H5B_t UNUSED *bt, const uint8_t *raw, void *_key)
+H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key)
{
H5G_node_key_t *key = (H5G_node_key_t *) _key;
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_decode_key)
- HDassert(f);
+ HDassert(shared);
HDassert(raw);
HDassert(key);
- H5F_DECODE_LENGTH(f, raw, key->offset);
+ H5F_DECODE_LENGTH_LEN(raw, key->offset, shared->sizeof_len);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5G_node_decode_key() */
@@ -190,17 +178,17 @@ H5G_node_decode_key(const H5F_t *f, const H5B_t UNUSED *bt, const uint8_t *raw,
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_node_encode_key(const H5F_t *f, const H5B_t UNUSED *bt, uint8_t *raw, void *_key)
+H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key)
{
- H5G_node_key_t *key = (H5G_node_key_t *) _key;
+ const H5G_node_key_t *key = (const H5G_node_key_t *) _key;
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_encode_key)
- HDassert(f);
+ HDassert(shared);
HDassert(raw);
HDassert(key);
- H5F_ENCODE_LENGTH(f, raw, key->offset);
+ H5F_ENCODE_LENGTH_LEN(raw, key->offset, shared->sizeof_len);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5G_node_encode_key() */
@@ -219,8 +207,8 @@ H5G_node_encode_key(const H5F_t *f, const H5B_t UNUSED *bt, uint8_t *raw, void *
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_node_debug_key(FILE *stream, H5F_t UNUSED *f, hid_t UNUSED dxpl_id,
- int indent, int fwidth, const void *_key, const void *_udata)
+H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key,
+ const void *_udata)
{
const H5G_node_key_t *key = (const H5G_node_key_t *) _key;
const H5G_bt_common_t *udata = (const H5G_bt_common_t *) _udata;
@@ -368,8 +356,7 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5G_node_cmp2(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_udata,
- void *_rt_key)
+H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key)
{
H5G_bt_common_t *udata = (H5G_bt_common_t *) _udata;
H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key;
@@ -428,8 +415,7 @@ H5G_node_cmp2(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_udata
*-------------------------------------------------------------------------
*/
static int
-H5G_node_cmp3(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_udata,
- void *_rt_key)
+H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key)
{
H5G_bt_common_t *udata = (H5G_bt_common_t *) _udata;
H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key;
diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h
index f465d1e..b80b1b1 100644
--- a/src/H5Gpkg.h
+++ b/src/H5Gpkg.h
@@ -34,6 +34,7 @@
/* Other private headers needed by this file */
#include "H5ACprivate.h" /* Metadata cache */
#include "H5B2private.h" /* v2 B-trees */
+#include "H5FLprivate.h" /* Free Lists */
#include "H5HFprivate.h" /* Fractal heaps */
#include "H5HLprivate.h" /* Local Heaps */
#include "H5Oprivate.h" /* Object headers */
diff --git a/src/H5I.c b/src/H5I.c
index db3cf6c..25770ff 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -42,6 +42,7 @@
#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free Lists */
#include "H5Ipkg.h" /* IDs */
diff --git a/src/H5Opkg.h b/src/H5Opkg.h
index 262386a..7e1811d 100644
--- a/src/H5Opkg.h
+++ b/src/H5Opkg.h
@@ -25,6 +25,7 @@
/* Other private headers needed by this file */
#include "H5ACprivate.h" /* Metadata cache */
+#include "H5FLprivate.h" /* Free Lists */
/* Object header macros */
#define H5O_NMESGS 8 /*initial number of messages */
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index ba1bb50..4b3e0a8 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -35,8 +35,10 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Dprivate.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
#include "H5Ppkg.h" /* Property lists */
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 6ff3b73..07b66e7 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -34,6 +34,7 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Dprivate.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* Files */
diff --git a/src/H5R.c b/src/H5R.c
index 933f983..36391a8 100644
--- a/src/H5R.c
+++ b/src/H5R.c
@@ -20,6 +20,7 @@
#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Dprivate.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5Gprivate.h" /* Groups */
diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c
index 9dcfa45..0e2acc8 100644
--- a/src/H5Rdeprec.c
+++ b/src/H5Rdeprec.c
@@ -41,6 +41,7 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Eprivate.h" /* Error handling */
#include "H5Gprivate.h" /* Groups */
#include "H5Oprivate.h" /* Object headers */
diff --git a/src/H5T.c b/src/H5T.c
index 790c5a8..8ecbd68 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -34,6 +34,7 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Dprivate.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* Files */
diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c
index 46a1ac8..2320b28 100644
--- a/src/H5Tcommit.c
+++ b/src/H5Tcommit.c
@@ -32,6 +32,7 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Eprivate.h" /* Error handling */
#include "H5FOprivate.h" /* File objects */
#include "H5Iprivate.h" /* IDs */
diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c
index 9d9ad36..07d3865 100644
--- a/src/H5Tdeprec.c
+++ b/src/H5Tdeprec.c
@@ -41,6 +41,7 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Eprivate.h" /* Error handling */
#include "H5FOprivate.h" /* File objects */
#include "H5Iprivate.h" /* IDs */
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index 8e32ab7..5927713 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -16,6 +16,7 @@
#define H5Z_PACKAGE /*suppress error about including H5Zpkg */
#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
#include "H5Eprivate.h" /* Error handling */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */