diff options
-rw-r--r-- | src/H5Atest.c | 1 | ||||
-rw-r--r-- | src/H5B.c | 17 | ||||
-rw-r--r-- | src/H5Bcache.c | 127 | ||||
-rw-r--r-- | src/H5Bpkg.h | 10 | ||||
-rw-r--r-- | src/H5Bprivate.h | 17 | ||||
-rw-r--r-- | src/H5D.c | 1 | ||||
-rw-r--r-- | src/H5Dchunk.c | 1 | ||||
-rw-r--r-- | src/H5Dcontig.c | 1 | ||||
-rw-r--r-- | src/H5Ddbg.c | 1 | ||||
-rw-r--r-- | src/H5Ddeprec.c | 1 | ||||
-rw-r--r-- | src/H5Dfill.c | 1 | ||||
-rw-r--r-- | src/H5Dint.c | 2 | ||||
-rw-r--r-- | src/H5Distore.c | 50 | ||||
-rw-r--r-- | src/H5Fpkg.h | 1 | ||||
-rw-r--r-- | src/H5Gnode.c | 53 | ||||
-rw-r--r-- | src/H5I.c | 1 | ||||
-rw-r--r-- | src/H5Opkg.h | 1 | ||||
-rw-r--r-- | src/H5Pdcpl.c | 2 | ||||
-rw-r--r-- | src/H5Pfapl.c | 1 | ||||
-rw-r--r-- | src/H5R.c | 1 | ||||
-rw-r--r-- | src/H5Rdeprec.c | 1 | ||||
-rw-r--r-- | src/H5T.c | 1 | ||||
-rw-r--r-- | src/H5Tcommit.c | 1 | ||||
-rw-r--r-- | src/H5Tdeprec.c | 1 | ||||
-rw-r--r-- | src/H5Zscaleoffset.c | 1 |
25 files changed, 126 insertions, 169 deletions
diff --git a/src/H5Atest.c b/src/H5Atest.c index de03a25..1fbaa42 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 */ @@ -237,6 +237,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)) || @@ -325,7 +326,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; @@ -849,7 +850,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; @@ -1039,7 +1040,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 @@ -1297,7 +1298,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; @@ -1682,6 +1683,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; @@ -2051,14 +2054,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 */ @@ -2164,7 +2167,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, + cmp = (type->cmp2)(H5B_NKEY(bt, shared, i), udata, H5B_NKEY(bt, shared, i + 1)); HDassert(cmp < 0); } /* end for */ diff --git a/src/H5Bcache.c b/src/H5Bcache.c index 01dc737..f6a228a 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -35,6 +35,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Bpkg.h" /* B-link trees */ #include "H5Eprivate.h" /* Error handling */ @@ -53,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); @@ -84,78 +82,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)H5B_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. @@ -193,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_NOSPACE, 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_RESOURCE, H5E_NOSPACE, 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); @@ -231,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; @@ -243,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 */ @@ -289,15 +219,52 @@ 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)H5B_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 * bother writing data for the child entries that don't exist or * for the final unchanged children. */ - if (H5F_block_write(f, H5FD_MEM_BTREE, addr, shared->sizeof_rnode, dxpl_id, shared->page) < 0) + if(H5F_block_write(f, H5FD_MEM_BTREE, addr, shared->sizeof_rnode, dxpl_id, shared->page) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to save B-tree node to disk") bt->cache_info.is_dirty = FALSE; diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h index f70ecc2..7645fc5 100644 --- a/src/H5Bpkg.h +++ b/src/H5Bpkg.h @@ -32,6 +32,7 @@ #include "H5Bprivate.h" /* Other private headers needed by this file */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5RCprivate.h" /* Reference counted objects */ @@ -45,9 +46,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 */ @@ -55,7 +56,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 */ @@ -73,6 +74,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 18a2c71..085b79e 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 */ /**************************/ @@ -73,9 +71,6 @@ typedef enum H5B_ins_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. */ @@ -85,6 +80,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; @@ -102,8 +99,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 */ herr_t (*found)(H5F_t*, hid_t, haddr_t, const void*, void*); /* insert new data */ @@ -119,9 +116,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 */ @@ -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/H5Dchunk.c b/src/H5Dchunk.c index f12ebc6..0df7f0f 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -24,6 +24,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 4e580e4..779071f 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 714c2e3..7abfc81 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 a07c86f..340f4a0 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 88aee5c..da6f2c2 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 0dd1333..691d306 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 "H5HLprivate.h" /* Local heaps */ #include "H5Iprivate.h" /* IDs */ diff --git a/src/H5Distore.c b/src/H5Distore.c index f12364e..4da3db8 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -45,7 +45,6 @@ /* Module Setup */ /****************/ -#define H5B_PACKAGE /*suppress error about including H5Bpkg */ #define H5D_PACKAGE /*suppress error about including H5Dpkg */ @@ -53,7 +52,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 */ @@ -61,11 +61,7 @@ #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 */ /****************/ @@ -135,10 +131,8 @@ static H5RC_t *H5D_istore_get_shared(const H5F_t *f, const void *_udata); static herr_t H5D_istore_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_istore_cmp2(H5F_t *f, hid_t dxpl_id, void *_lt_key, void *_udata, - void *_rt_key); -static int H5D_istore_cmp3(H5F_t *f, hid_t dxpl_id, void *_lt_key, void *_udata, - void *_rt_key); +static int H5D_istore_cmp2(void *_lt_key, void *_udata, void *_rt_key); +static int H5D_istore_cmp3(void *_lt_key, void *_udata, void *_rt_key); static herr_t H5D_istore_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_lt_key, void *_udata); static H5B_ins_t H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, @@ -149,13 +143,10 @@ static H5B_ins_t H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void * static H5B_ins_t H5D_istore_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_istore_decode_key(const H5F_t *f, const H5B_t *bt, const uint8_t *raw, - void *_key); -static herr_t H5D_istore_encode_key(const H5F_t *f, const H5B_t *bt, uint8_t *raw, - void *_key); -static herr_t H5D_istore_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_istore_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key); +static herr_t H5D_istore_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key); +static herr_t H5D_istore_debug_key(FILE *stream, int indent, int fwidth, + const void *key, const void *udata); /* Chunked layout indexing callbacks */ static herr_t H5D_istore_idx_init(const H5D_chk_idx_info_t *idx_info); @@ -252,9 +243,6 @@ H5D_istore_get_shared(const H5F_t UNUSED *f, const void *_udata) HDassert(udata->mesg); HDassert(udata->mesg->u.chunk.btree_shared); - /* Increment reference count on B-tree info */ - H5RC_INC(udata->mesg->u.chunk.btree_shared); - /* Return the pointer to the ref-count object */ FUNC_LEAVE_NOAPI(udata->mesg->u.chunk.btree_shared) } /* end H5D_istore_get_shared() */ @@ -273,19 +261,15 @@ H5D_istore_get_shared(const H5F_t UNUSED *f, const void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5D_istore_decode_key(const H5F_t UNUSED *f, const H5B_t *bt, const uint8_t *raw, void *_key) +H5D_istore_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) { H5D_istore_key_t *key = (H5D_istore_key_t *) _key; - H5B_shared_t *shared; /* Pointer to shared B-tree info */ size_t ndims; unsigned u; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_decode_key) /* check args */ - HDassert(f); - HDassert(bt); - shared = (H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); HDassert(raw); HDassert(key); @@ -315,19 +299,15 @@ H5D_istore_decode_key(const H5F_t UNUSED *f, const H5B_t *bt, const uint8_t *raw *------------------------------------------------------------------------- */ static herr_t -H5D_istore_encode_key(const H5F_t UNUSED *f, const H5B_t *bt, uint8_t *raw, void *_key) +H5D_istore_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) { - H5D_istore_key_t *key = (H5D_istore_key_t *) _key; - H5B_shared_t *shared; /* Pointer to shared B-tree info */ + const H5D_istore_key_t *key = (const H5D_istore_key_t *) _key; size_t ndims; unsigned u; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_encode_key) /* check args */ - HDassert(f); - HDassert(bt); - shared = (H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); HDassert(raw); HDassert(key); @@ -358,7 +338,7 @@ H5D_istore_encode_key(const H5F_t UNUSED *f, const H5B_t *bt, uint8_t *raw, void */ /* ARGSUSED */ static herr_t -H5D_istore_debug_key(FILE *stream, H5F_t UNUSED *f, hid_t UNUSED dxpl_id, int indent, int fwidth, const void *_key, +H5D_istore_debug_key(FILE *stream, int indent, int fwidth, const void *_key, const void *_udata) { const H5D_istore_key_t *key = (const H5D_istore_key_t *)_key; @@ -401,7 +381,7 @@ H5D_istore_debug_key(FILE *stream, H5F_t UNUSED *f, hid_t UNUSED dxpl_id, int in */ /* ARGSUSED */ static int -H5D_istore_cmp2(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_udata, void *_rt_key) +H5D_istore_cmp2(void *_lt_key, void *_udata, void *_rt_key) { H5D_istore_key_t *lt_key = (H5D_istore_key_t *) _lt_key; H5D_istore_key_t *rt_key = (H5D_istore_key_t *) _rt_key; @@ -451,7 +431,7 @@ H5D_istore_cmp2(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_uda */ /* ARGSUSED */ static int -H5D_istore_cmp3(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_udata, void *_rt_key) +H5D_istore_cmp3(void *_lt_key, void *_udata, void *_rt_key) { H5D_istore_key_t *lt_key = (H5D_istore_key_t *) _lt_key; H5D_istore_key_t *rt_key = (H5D_istore_key_t *) _rt_key; @@ -679,7 +659,7 @@ H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, HDassert(rt_key); HDassert(new_node_p); - cmp = H5D_istore_cmp3(f, dxpl_id, lt_key, udata, rt_key); + cmp = H5D_istore_cmp3(lt_key, udata, rt_key); HDassert(cmp <= 0); if(cmp < 0) { diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 594ed50..b0d89f9 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 "H5Gprivate.h" /* Groups */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 4d96389..97af021 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -60,8 +60,8 @@ typedef struct H5G_node_key_t { typedef struct H5G_node_t { H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */ /* first field in structure */ - unsigned nsyms; /*number of symbols */ - H5G_entry_t *entry; /*array of symbol table entries */ + unsigned nsyms; /*number of symbols */ + H5G_entry_t *entry; /*array of symbol table entries */ } H5G_node_t; @@ -90,10 +90,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 herr_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, @@ -104,13 +102,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 cache-like properties from H5AC */ const H5AC_class_t H5AC_SNODE[1] = {{ @@ -167,18 +162,12 @@ H5FL_SEQ_DEFINE_STATIC(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() */ @@ -196,17 +185,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() */ @@ -226,17 +215,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() */ @@ -255,8 +244,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; @@ -753,8 +742,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; @@ -813,8 +801,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; @@ -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 6b4414a..f245023 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 6e507d3..bd59bd2 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 a988658..fae421b 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 */ @@ -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 */ @@ -27,6 +27,7 @@ #include "H5private.h" /*generic functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Dprivate.h" /*datasets (for H5Tcopy) */ #include "H5Eprivate.h" /*error handling */ #include "H5Fprivate.h" /* Files */ diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index bcb9962..1e52325 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -25,6 +25,7 @@ #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 64386b1..56ca889 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 84d404e..5ef3e7a 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 */ |