summaryrefslogtreecommitdiffstats
path: root/src/H5Bpkg.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-04-05 03:21:41 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-04-05 03:21:41 (GMT)
commit1c425ac9d2dead1c028370a068ac7add6634ed85 (patch)
tree6c10d9fb596929e980714f6aa571fb40a95a56ad /src/H5Bpkg.h
parente023ad625fbfa97ed0cfcd05861f626e55b4b262 (diff)
downloadhdf5-1c425ac9d2dead1c028370a068ac7add6634ed85.zip
hdf5-1c425ac9d2dead1c028370a068ac7add6634ed85.tar.gz
hdf5-1c425ac9d2dead1c028370a068ac7add6634ed85.tar.bz2
[svn-r14796] Description:
Switch v1 B-tree nodes from using previous cache to use the new journaling cache code. This is a major switch for the cache callbacks. Switched the metadata caching code from having a pointer to the file it's in to receiving a pointer to the file, when needed. This was necessary in order to avoid crashing when two files IDs were open on the same underlying file and one of those files was closed with cache entries using the file pointers. Also took out the check in the caching code for reading off the end of the file, which didn't play nicely with the multi-file VFD. Switching the cache from having a pointer internally to requiring one externally meant tweaking almost all the test code. :-/ Added correct exit codes to cache2 tests that didn't have them already, so the 'make check' will stop when they fail. Use the path to the h5diff in this build in the tools/h5recover testing script, since we can't guarantee a user has HDF5 already installed. Assorted minor tweaks to get everything to compile more cleanly and pass all the tests (on my Mac :-). Tested on: Mac OS X (10.5.2) w/C++ (more testing coming up shortly, I just didn't have my "rsync testbed" set up for this branch when I started making changes to the code)
Diffstat (limited to 'src/H5Bpkg.h')
-rw-r--r--src/H5Bpkg.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h
index cd79cf7..ed03b99 100644
--- a/src/H5Bpkg.h
+++ b/src/H5Bpkg.h
@@ -32,20 +32,22 @@
#include "H5Bprivate.h"
/* Other private headers needed by this file */
-#include "H5RCprivate.h" /* Reference counted objects */
+#include "H5AC2private.h" /* Metadata cache #2 */
+
/**************************/
/* Package Private Macros */
/**************************/
+
/****************************/
/* Package Private Typedefs */
/****************************/
/* 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 {
+ H5AC2_info_t cache_info; /* Information for H5AC2 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 */
@@ -53,14 +55,21 @@ 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;
+
+/* Callback info for loading a B-tree node into the cache */
+typedef struct H5B_cache_ud_t {
+ H5F_t *f; /* File that B-tree node is within */
+ const struct H5B_class_t *type; /* Type of tree */
+ H5RC_t *rc_shared; /* Ref-counted shared info */
+} H5B_cache_ud_t;
/*****************************/
/* Package Private Variables */
/*****************************/
-/* H5B header inherits cache-like properties from H5AC */
-H5_DLLVAR const H5AC_class_t H5AC_BT[1];
+/* H5B header inherits cache-like properties from H5AC2 */
+H5_DLLVAR const H5AC2_class_t H5AC2_BT[1];
/* Declare a free list to manage the haddr_t sequence information */
H5FL_SEQ_EXTERN(haddr_t);
@@ -71,9 +80,11 @@ H5FL_BLK_EXTERN(native_block);
/* Declare a free list to manage the H5B_t struct */
H5FL_EXTERN(H5B_t);
+
/******************************/
/* Package Private Prototypes */
/******************************/
-herr_t H5B_dest(H5F_t *f, H5B_t *b);
+herr_t H5B_dest(H5B_t *bt);
#endif /*_H5Bpkg_H*/
+