2005-11-07 11:13:53 +08:00
|
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
|
* Copyright by The HDF Group. *
|
2005-11-07 11:13:53 +08:00
|
|
|
|
* Copyright by the Board of Trustees of the University of Illinois. *
|
|
|
|
|
* All rights reserved. *
|
|
|
|
|
* *
|
|
|
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
|
|
|
* terms governing use, modification, and redistribution, is contained in *
|
|
|
|
|
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
|
|
|
|
* of the source code distribution tree; Copyright.html can be found at the *
|
|
|
|
|
* root level of an installed copy of the electronic HDF5 document set and *
|
|
|
|
|
* is linked from the top-level documents page. It can also be found at *
|
2007-02-07 22:56:24 +08:00
|
|
|
|
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
|
|
|
|
* access to either file, you may request a copy from help@hdfgroup.org. *
|
2005-11-07 11:13:53 +08:00
|
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
*
|
|
|
|
|
* Created: H5Bcache.c
|
|
|
|
|
* Oct 31 2005
|
|
|
|
|
* Quincey Koziol <koziol@ncsa.uiuc.edu>
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Implement B-tree metadata cache methods.
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/****************/
|
|
|
|
|
/* Module Setup */
|
|
|
|
|
/****************/
|
|
|
|
|
|
2015-09-14 11:58:59 +08:00
|
|
|
|
#include "H5Bmodule.h" /* This source code file is part of the H5B module */
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***********/
|
|
|
|
|
/* Headers */
|
|
|
|
|
/***********/
|
|
|
|
|
#include "H5private.h" /* Generic Functions */
|
|
|
|
|
#include "H5Bpkg.h" /* B-link trees */
|
|
|
|
|
#include "H5Eprivate.h" /* Error handling */
|
|
|
|
|
|
[svn-r18030] Description:
Bring "brush clearing" changes (whitespace & style issues, mostly) from
metadata_journaling branch to the "merging" branch, to converge the trunk and
the metadata_journaling branch.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-17 23:07:35 +08:00
|
|
|
|
|
2005-11-07 11:13:53 +08:00
|
|
|
|
/****************/
|
|
|
|
|
/* Local Macros */
|
|
|
|
|
/****************/
|
|
|
|
|
|
[svn-r18030] Description:
Bring "brush clearing" changes (whitespace & style issues, mostly) from
metadata_journaling branch to the "merging" branch, to converge the trunk and
the metadata_journaling branch.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-17 23:07:35 +08:00
|
|
|
|
|
2005-11-07 11:13:53 +08:00
|
|
|
|
/******************/
|
|
|
|
|
/* Local Typedefs */
|
|
|
|
|
/******************/
|
|
|
|
|
|
[svn-r18030] Description:
Bring "brush clearing" changes (whitespace & style issues, mostly) from
metadata_journaling branch to the "merging" branch, to converge the trunk and
the metadata_journaling branch.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-17 23:07:35 +08:00
|
|
|
|
|
2005-11-07 11:13:53 +08:00
|
|
|
|
/********************/
|
|
|
|
|
/* Local Prototypes */
|
|
|
|
|
/********************/
|
|
|
|
|
|
|
|
|
|
/* Metadata cache callbacks */
|
2015-06-18 08:58:49 +08:00
|
|
|
|
static herr_t H5B__get_load_size(const void *udata, size_t *image_len);
|
|
|
|
|
static void *H5B__deserialize(const void *image, size_t len, void *udata,
|
|
|
|
|
hbool_t *dirty);
|
|
|
|
|
static herr_t H5B__image_len(const void *thing, size_t *image_len,
|
|
|
|
|
hbool_t *compressed_ptr, size_t *compressed_image_len_ptr);
|
|
|
|
|
static herr_t H5B__serialize(const H5F_t *f, void *image, size_t len,
|
|
|
|
|
void *thing);
|
|
|
|
|
static herr_t H5B__free_icr(void *thing);
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
[svn-r18030] Description:
Bring "brush clearing" changes (whitespace & style issues, mostly) from
metadata_journaling branch to the "merging" branch, to converge the trunk and
the metadata_journaling branch.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-17 23:07:35 +08:00
|
|
|
|
|
2005-11-07 11:13:53 +08:00
|
|
|
|
/*********************/
|
|
|
|
|
/* Package Variables */
|
|
|
|
|
/*********************/
|
|
|
|
|
|
|
|
|
|
/* H5B inherits cache-like properties from H5AC */
|
|
|
|
|
const H5AC_class_t H5AC_BT[1] = {{
|
2015-06-18 08:58:49 +08:00
|
|
|
|
H5AC_BT_ID, /* Metadata client ID */
|
|
|
|
|
"v1 B-tree", /* Metadata client name (for debugging) */
|
|
|
|
|
H5FD_MEM_BTREE, /* File space memory type for client */
|
|
|
|
|
H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */
|
|
|
|
|
H5B__get_load_size, /* 'get_load_size' callback */
|
|
|
|
|
H5B__deserialize, /* 'deserialize' callback */
|
|
|
|
|
H5B__image_len, /* 'image_len' callback */
|
|
|
|
|
NULL, /* 'pre_serialize' callback */
|
|
|
|
|
H5B__serialize, /* 'serialize' callback */
|
|
|
|
|
NULL, /* 'notify' callback */
|
|
|
|
|
H5B__free_icr, /* 'free_icr' callback */
|
|
|
|
|
NULL, /* 'clear" callback */
|
|
|
|
|
NULL, /* 'fsf_size' callback */
|
2005-11-07 11:13:53 +08:00
|
|
|
|
}};
|
|
|
|
|
|
|
|
|
|
/*******************/
|
|
|
|
|
/* Local Variables */
|
|
|
|
|
/*******************/
|
|
|
|
|
|
[svn-r18030] Description:
Bring "brush clearing" changes (whitespace & style issues, mostly) from
metadata_journaling branch to the "merging" branch, to converge the trunk and
the metadata_journaling branch.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-17 23:07:35 +08:00
|
|
|
|
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2015-06-18 08:58:49 +08:00
|
|
|
|
* Function: H5B__get_load_size
|
2005-11-07 11:13:53 +08:00
|
|
|
|
*
|
2015-06-18 08:58:49 +08:00
|
|
|
|
* Purpose: Compute the size of the data structure on disk.
|
|
|
|
|
*
|
|
|
|
|
* Return: Non-negative on success/Negative on failure
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* koziol@hdfgroup.org
|
|
|
|
|
* May 18, 2010
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
|
|
|
|
H5B__get_load_size(const void *_udata, size_t *image_len)
|
|
|
|
|
{
|
|
|
|
|
const H5B_cache_ud_t *udata = (const H5B_cache_ud_t *)_udata; /* User data for callback */
|
|
|
|
|
H5B_shared_t *shared; /* Pointer to shared B-tree info */
|
|
|
|
|
|
|
|
|
|
FUNC_ENTER_STATIC_NOERR
|
|
|
|
|
|
|
|
|
|
/* Check arguments */
|
|
|
|
|
HDassert(udata);
|
|
|
|
|
HDassert(image_len);
|
|
|
|
|
|
|
|
|
|
/* Get shared info for B-tree */
|
|
|
|
|
shared = (H5B_shared_t *)H5UC_GET_OBJ(udata->rc_shared);
|
|
|
|
|
HDassert(shared);
|
|
|
|
|
|
|
|
|
|
/* Set the image length size */
|
|
|
|
|
*image_len = shared->sizeof_rnode;
|
|
|
|
|
|
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED)
|
|
|
|
|
} /* end H5B__get_load_size() */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: H5B__deserialize
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Deserialize the data structure from disk.
|
2005-11-07 11:13:53 +08:00
|
|
|
|
*
|
|
|
|
|
* Return: Success: Pointer to a new B-tree node.
|
|
|
|
|
* Failure: NULL
|
|
|
|
|
*
|
2015-06-18 08:58:49 +08:00
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* koziol@hdfgroup.org
|
|
|
|
|
* Mar 24, 2008
|
2005-11-07 11:13:53 +08:00
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2015-06-18 08:58:49 +08:00
|
|
|
|
static void *
|
|
|
|
|
H5B__deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void *_udata,
|
|
|
|
|
hbool_t H5_ATTR_UNUSED *dirty)
|
2005-11-07 11:13:53 +08:00
|
|
|
|
{
|
[svn-r18702] Description:
Bring r18672 from metadata journaling "merging" branch to trunk:
Mostly changes to move to only using one 'user data' parameter for
calls to H5AC_protect(), along with some minor reformatting code cleanups.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.3 (amazon) in debug mode
Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2010-05-05 21:39:56 +08:00
|
|
|
|
H5B_t *bt = NULL; /* Pointer to the deserialized B-tree node */
|
|
|
|
|
H5B_cache_ud_t *udata = (H5B_cache_ud_t *)_udata; /* User data for callback */
|
[svn-r18030] Description:
Bring "brush clearing" changes (whitespace & style issues, mostly) from
metadata_journaling branch to the "merging" branch, to converge the trunk and
the metadata_journaling branch.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-17 23:07:35 +08:00
|
|
|
|
H5B_shared_t *shared; /* Pointer to shared B-tree info */
|
2015-06-18 08:58:49 +08:00
|
|
|
|
const uint8_t *image = (const uint8_t *)_image; /* Pointer into image buffer */
|
[svn-r18030] Description:
Bring "brush clearing" changes (whitespace & style issues, mostly) from
metadata_journaling branch to the "merging" branch, to converge the trunk and
the metadata_journaling branch.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-17 23:07:35 +08:00
|
|
|
|
uint8_t *native; /* Pointer to native keys */
|
|
|
|
|
unsigned u; /* Local index variable */
|
2015-09-14 11:58:59 +08:00
|
|
|
|
H5B_t *ret_value = NULL; /* Return value */
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
2013-08-10 05:59:14 +08:00
|
|
|
|
FUNC_ENTER_STATIC
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
2015-06-18 08:58:49 +08:00
|
|
|
|
/* check arguments */
|
|
|
|
|
HDassert(image);
|
[svn-r18702] Description:
Bring r18672 from metadata journaling "merging" branch to trunk:
Mostly changes to move to only using one 'user data' parameter for
calls to H5AC_protect(), along with some minor reformatting code cleanups.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.3 (amazon) in debug mode
Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2010-05-05 21:39:56 +08:00
|
|
|
|
HDassert(udata);
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
2015-05-15 09:38:35 +08:00
|
|
|
|
/* Allocate the B-tree node in memory */
|
[svn-r17313] Description:
Bring back various minor code cleanups from the file free space branch
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-11 01:08:27 +08:00
|
|
|
|
if(NULL == (bt = H5FL_MALLOC(H5B_t)))
|
[svn-r18031] Description:
Bring r18030 from merge_metadata_journaling branch to trunk:
Bring "brush clearing" changes (whitespace & style issues, mostly) from
metadata_journaling branch to the "merging" branch, to converge the trunk and
the metadata_journaling branch.
Also, some other minor cleanups along the way.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-18 06:21:08 +08:00
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "can't allocate B-tree struct")
|
[svn-r18030] Description:
Bring "brush clearing" changes (whitespace & style issues, mostly) from
metadata_journaling branch to the "merging" branch, to converge the trunk and
the metadata_journaling branch.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-17 23:07:35 +08:00
|
|
|
|
HDmemset(&bt->cache_info, 0, sizeof(H5AC_info_t));
|
|
|
|
|
|
[svn-r18357] Description:
Bring r18356 from metadata journaling merge branch to trunk:
Converge metadata journaling branch with trunk with a bunch of v1 B-tree
changes:
- Remove H5ACprivate.h header from H5Bprivate.h header
- Revise v1 B-tree client callbacks
- Get rid of H5B_serialize() by bringing it into H5B_flush()
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2010-03-03 04:07:10 +08:00
|
|
|
|
/* Set & increment the ref-counted "shared" B-tree information for the node */
|
[svn-r18702] Description:
Bring r18672 from metadata journaling "merging" branch to trunk:
Mostly changes to move to only using one 'user data' parameter for
calls to H5AC_protect(), along with some minor reformatting code cleanups.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.3 (amazon) in debug mode
Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2010-05-05 21:39:56 +08:00
|
|
|
|
bt->rc_shared = udata->rc_shared;
|
2013-08-31 01:05:42 +08:00
|
|
|
|
H5UC_INC(bt->rc_shared);
|
[svn-r18357] Description:
Bring r18356 from metadata journaling merge branch to trunk:
Converge metadata journaling branch with trunk with a bunch of v1 B-tree
changes:
- Remove H5ACprivate.h header from H5Bprivate.h header
- Revise v1 B-tree client callbacks
- Get rid of H5B_serialize() by bringing it into H5B_flush()
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2010-03-03 04:07:10 +08:00
|
|
|
|
|
|
|
|
|
/* Get a pointer to the shared info, for convenience */
|
2013-08-31 01:05:42 +08:00
|
|
|
|
shared = (H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared);
|
2005-11-07 11:13:53 +08:00
|
|
|
|
HDassert(shared);
|
|
|
|
|
|
[svn-r18030] Description:
Bring "brush clearing" changes (whitespace & style issues, mostly) from
metadata_journaling branch to the "merging" branch, to converge the trunk and
the metadata_journaling branch.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-17 23:07:35 +08:00
|
|
|
|
/* Allocate space for the native keys and child addresses */
|
|
|
|
|
if(NULL == (bt->native = H5FL_BLK_MALLOC(native_block, shared->sizeof_keys)))
|
[svn-r18031] Description:
Bring r18030 from merge_metadata_journaling branch to trunk:
Bring "brush clearing" changes (whitespace & style issues, mostly) from
metadata_journaling branch to the "merging" branch, to converge the trunk and
the metadata_journaling branch.
Also, some other minor cleanups along the way.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-18 06:21:08 +08:00
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "can't allocate buffer for native keys")
|
[svn-r18030] Description:
Bring "brush clearing" changes (whitespace & style issues, mostly) from
metadata_journaling branch to the "merging" branch, to converge the trunk and
the metadata_journaling branch.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-17 23:07:35 +08:00
|
|
|
|
if(NULL == (bt->child = H5FL_SEQ_MALLOC(haddr_t, (size_t)shared->two_k)))
|
[svn-r18031] Description:
Bring r18030 from merge_metadata_journaling branch to trunk:
Bring "brush clearing" changes (whitespace & style issues, mostly) from
metadata_journaling branch to the "merging" branch, to converge the trunk and
the metadata_journaling branch.
Also, some other minor cleanups along the way.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-18 06:21:08 +08:00
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "can't allocate buffer for child addresses")
|
[svn-r18030] Description:
Bring "brush clearing" changes (whitespace & style issues, mostly) from
metadata_journaling branch to the "merging" branch, to converge the trunk and
the metadata_journaling branch.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-17 23:07:35 +08:00
|
|
|
|
|
2005-11-07 11:13:53 +08:00
|
|
|
|
/* magic number */
|
2015-06-18 08:58:49 +08:00
|
|
|
|
if(HDmemcmp(image, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC))
|
2015-05-15 09:38:35 +08:00
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree signature")
|
2015-06-18 08:58:49 +08:00
|
|
|
|
image += H5_SIZEOF_MAGIC;
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
|
|
|
|
/* node type and level */
|
2015-06-18 08:58:49 +08:00
|
|
|
|
if(*image++ != (uint8_t)udata->type->id)
|
2005-11-07 11:13:53 +08:00
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "incorrect B-tree node type")
|
2015-06-18 08:58:49 +08:00
|
|
|
|
bt->level = *image++;
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
|
|
|
|
/* entries used */
|
2015-06-18 08:58:49 +08:00
|
|
|
|
UINT16DECODE(image, bt->nchildren);
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
2012-03-25 11:18:31 +08:00
|
|
|
|
/* Check if bt->nchildren is greater than two_k */
|
|
|
|
|
if(bt->nchildren > shared->two_k)
|
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "number of children is greater than maximum")
|
|
|
|
|
|
2005-11-07 11:13:53 +08:00
|
|
|
|
/* sibling pointers */
|
2015-06-18 08:58:49 +08:00
|
|
|
|
H5F_addr_decode(udata->f, (const uint8_t **)&image, &(bt->left));
|
|
|
|
|
H5F_addr_decode(udata->f, (const uint8_t **)&image, &(bt->right));
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
|
|
|
|
/* the child/key pairs */
|
[svn-r17313] Description:
Bring back various minor code cleanups from the file free space branch
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-11 01:08:27 +08:00
|
|
|
|
native = bt->native;
|
|
|
|
|
for(u = 0; u < bt->nchildren; u++) {
|
2005-11-07 11:13:53 +08:00
|
|
|
|
/* Decode native key value */
|
2015-06-18 08:58:49 +08:00
|
|
|
|
if((udata->type->decode)(shared, image, native) < 0)
|
2005-11-07 11:13:53 +08:00
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTDECODE, NULL, "unable to decode key")
|
2015-06-18 08:58:49 +08:00
|
|
|
|
image += shared->sizeof_rkey;
|
[svn-r18702] Description:
Bring r18672 from metadata journaling "merging" branch to trunk:
Mostly changes to move to only using one 'user data' parameter for
calls to H5AC_protect(), along with some minor reformatting code cleanups.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.3 (amazon) in debug mode
Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2010-05-05 21:39:56 +08:00
|
|
|
|
native += udata->type->sizeof_nkey;
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
|
|
|
|
/* Decode address value */
|
2015-06-18 08:58:49 +08:00
|
|
|
|
H5F_addr_decode(udata->f, (const uint8_t **)&image, bt->child + u);
|
[svn-r17313] Description:
Bring back various minor code cleanups from the file free space branch
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-11 01:08:27 +08:00
|
|
|
|
} /* end for */
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
|
|
|
|
/* Decode final key */
|
[svn-r17313] Description:
Bring back various minor code cleanups from the file free space branch
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-11 01:08:27 +08:00
|
|
|
|
if(bt->nchildren > 0) {
|
2005-11-07 11:13:53 +08:00
|
|
|
|
/* Decode native key value */
|
2015-06-18 08:58:49 +08:00
|
|
|
|
if((udata->type->decode)(shared, image, native) < 0)
|
2005-11-07 11:13:53 +08:00
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTDECODE, NULL, "unable to decode key")
|
|
|
|
|
} /* end if */
|
|
|
|
|
|
2015-06-18 08:58:49 +08:00
|
|
|
|
/* Sanity check */
|
|
|
|
|
HDassert((size_t)((const uint8_t *)image - (const uint8_t *)_image) <= len);
|
|
|
|
|
|
2005-11-07 11:13:53 +08:00
|
|
|
|
/* Set return value */
|
|
|
|
|
ret_value = bt;
|
|
|
|
|
|
|
|
|
|
done:
|
[svn-r17313] Description:
Bring back various minor code cleanups from the file free space branch
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-11 01:08:27 +08:00
|
|
|
|
if(!ret_value && bt)
|
2015-05-15 09:38:35 +08:00
|
|
|
|
if(H5B__node_dest(bt) < 0)
|
[svn-r18494] Description:
Bring r18491 from metadata journaling "merging" branch to trunk:
Extract data structure 'destroy' routines from metadata cache client
'destroy' callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.3 (amazon) in debug mode
Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2010-04-02 09:38:53 +08:00
|
|
|
|
HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, NULL, "unable to destroy B-tree node")
|
[svn-r18030] Description:
Bring "brush clearing" changes (whitespace & style issues, mostly) from
metadata_journaling branch to the "merging" branch, to converge the trunk and
the metadata_journaling branch.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-17 23:07:35 +08:00
|
|
|
|
|
2005-11-07 11:13:53 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value)
|
2015-06-18 08:58:49 +08:00
|
|
|
|
} /* end H5B__deserialize() */
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2015-06-18 08:58:49 +08:00
|
|
|
|
* Function: H5B__image_len
|
2005-11-07 11:13:53 +08:00
|
|
|
|
*
|
2015-06-18 08:58:49 +08:00
|
|
|
|
* Purpose: Compute the size of the data structure on disk.
|
2005-11-07 11:13:53 +08:00
|
|
|
|
*
|
[svn-r18030] Description:
Bring "brush clearing" changes (whitespace & style issues, mostly) from
metadata_journaling branch to the "merging" branch, to converge the trunk and
the metadata_journaling branch.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-17 23:07:35 +08:00
|
|
|
|
* Return: Non-negative on success/Negative on failure
|
2005-11-07 11:13:53 +08:00
|
|
|
|
*
|
2015-06-18 08:58:49 +08:00
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* koziol@hdfgroup.org
|
|
|
|
|
* May 20, 2010
|
2005-11-07 11:13:53 +08:00
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
2015-06-18 08:58:49 +08:00
|
|
|
|
H5B__image_len(const void *_thing, size_t *image_len,
|
|
|
|
|
hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
|
2005-11-07 11:13:53 +08:00
|
|
|
|
{
|
2015-06-18 08:58:49 +08:00
|
|
|
|
const H5B_t *bt = (const H5B_t *)_thing; /* Pointer to the B-tree node */
|
2009-12-19 12:28:42 +08:00
|
|
|
|
H5B_shared_t *shared; /* Pointer to shared B-tree info */
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
2015-06-18 08:58:49 +08:00
|
|
|
|
FUNC_ENTER_STATIC_NOERR
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
2015-06-18 08:58:49 +08:00
|
|
|
|
/* Check arguments */
|
2005-11-07 11:13:53 +08:00
|
|
|
|
HDassert(bt);
|
2015-06-18 08:58:49 +08:00
|
|
|
|
HDassert(image_len);
|
|
|
|
|
|
|
|
|
|
/* Get shared info for B-tree */
|
2013-08-31 01:05:42 +08:00
|
|
|
|
shared = (H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared);
|
2005-11-07 11:13:53 +08:00
|
|
|
|
HDassert(shared);
|
|
|
|
|
|
2015-06-18 08:58:49 +08:00
|
|
|
|
/* Set the image length size */
|
|
|
|
|
*image_len = shared->sizeof_rnode;
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
2015-06-18 08:58:49 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(SUCCEED)
|
|
|
|
|
} /* end H5B__image_len() */
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2015-06-18 08:58:49 +08:00
|
|
|
|
* Function: H5B__serialize
|
2005-11-07 11:13:53 +08:00
|
|
|
|
*
|
2015-06-18 08:58:49 +08:00
|
|
|
|
* Purpose: Serialize the data structure for writing to disk.
|
2005-11-07 11:13:53 +08:00
|
|
|
|
*
|
2015-06-18 08:58:49 +08:00
|
|
|
|
* Return: Non-negative on success/Negative on failure
|
2005-11-07 11:13:53 +08:00
|
|
|
|
*
|
2015-06-18 08:58:49 +08:00
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* koziol@hdfgroup.org
|
|
|
|
|
* Mar 24, 2008
|
2005-11-07 11:13:53 +08:00
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
[svn-r18494] Description:
Bring r18491 from metadata journaling "merging" branch to trunk:
Extract data structure 'destroy' routines from metadata cache client
'destroy' callbacks.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.3 (amazon) in debug mode
Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2010-04-02 09:38:53 +08:00
|
|
|
|
static herr_t
|
2015-06-18 08:58:49 +08:00
|
|
|
|
H5B__serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len,
|
|
|
|
|
void *_thing)
|
2005-11-07 11:13:53 +08:00
|
|
|
|
{
|
2015-06-18 08:58:49 +08:00
|
|
|
|
H5B_t *bt = (H5B_t *)_thing; /* Pointer to the B-tree node */
|
|
|
|
|
H5B_shared_t *shared; /* Pointer to shared B-tree info */
|
|
|
|
|
uint8_t *image = (uint8_t *)_image; /* Pointer into image buffer */
|
|
|
|
|
uint8_t *native; /* Pointer to native keys */
|
|
|
|
|
unsigned u; /* Local index counter */
|
|
|
|
|
herr_t ret_value = SUCCEED; /* Return value */
|
[svn-r15800] Description:
Bring file free space branch changes through r15795 into trunk, which
includes a fair bit of code cleanup & rearrangement along with a couple of
bug fixes also.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-07 12:17:35 +08:00
|
|
|
|
|
2013-08-10 05:59:14 +08:00
|
|
|
|
FUNC_ENTER_STATIC
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
2015-06-18 08:58:49 +08:00
|
|
|
|
/* check arguments */
|
|
|
|
|
HDassert(image);
|
2005-11-07 11:13:53 +08:00
|
|
|
|
HDassert(bt);
|
|
|
|
|
HDassert(bt->rc_shared);
|
2015-06-18 08:58:49 +08:00
|
|
|
|
shared = (H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared);
|
|
|
|
|
HDassert(shared);
|
|
|
|
|
HDassert(shared->type);
|
|
|
|
|
HDassert(shared->type->encode);
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
2015-06-18 08:58:49 +08:00
|
|
|
|
/* magic number */
|
|
|
|
|
HDmemcpy(image, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC);
|
|
|
|
|
image += 4;
|
[svn-r15800] Description:
Bring file free space branch changes through r15795 into trunk, which
includes a fair bit of code cleanup & rearrangement along with a couple of
bug fixes also.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-07 12:17:35 +08:00
|
|
|
|
|
2015-06-18 08:58:49 +08:00
|
|
|
|
/* node type and level */
|
|
|
|
|
*image++ = (uint8_t)shared->type->id;
|
2016-05-29 18:57:47 +08:00
|
|
|
|
|
|
|
|
|
/* 2^8 limit: only 1 byte is used to store node level */
|
|
|
|
|
if(bt->level >= HDpow(2, LEVEL_BITS))
|
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode node level")
|
|
|
|
|
|
2015-06-18 08:58:49 +08:00
|
|
|
|
H5_CHECK_OVERFLOW(bt->level, unsigned, uint8_t);
|
|
|
|
|
*image++ = (uint8_t)bt->level;
|
[svn-r15800] Description:
Bring file free space branch changes through r15795 into trunk, which
includes a fair bit of code cleanup & rearrangement along with a couple of
bug fixes also.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-07 12:17:35 +08:00
|
|
|
|
|
2015-06-18 08:58:49 +08:00
|
|
|
|
/* entries used */
|
|
|
|
|
UINT16ENCODE(image, bt->nchildren);
|
|
|
|
|
|
|
|
|
|
/* sibling pointers */
|
|
|
|
|
H5F_addr_encode(f, &image, bt->left);
|
|
|
|
|
H5F_addr_encode(f, &image, bt->right);
|
[svn-r15800] Description:
Bring file free space branch changes through r15795 into trunk, which
includes a fair bit of code cleanup & rearrangement along with a couple of
bug fixes also.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-07 12:17:35 +08:00
|
|
|
|
|
2015-06-18 08:58:49 +08:00
|
|
|
|
/* child keys and pointers */
|
|
|
|
|
native = bt->native;
|
|
|
|
|
for(u = 0; u < bt->nchildren; ++u) {
|
|
|
|
|
/* encode the key */
|
|
|
|
|
if(shared->type->encode(shared, image, native) < 0)
|
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key")
|
|
|
|
|
image += shared->sizeof_rkey;
|
|
|
|
|
native += shared->type->sizeof_nkey;
|
|
|
|
|
|
|
|
|
|
/* encode the child address */
|
|
|
|
|
H5F_addr_encode(f, &image, bt->child[u]);
|
|
|
|
|
} /* end for */
|
|
|
|
|
if(bt->nchildren > 0) {
|
|
|
|
|
/* Encode the final key */
|
|
|
|
|
if(shared->type->encode(shared, image, native) < 0)
|
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key")
|
2015-07-02 06:08:11 +08:00
|
|
|
|
image += shared->sizeof_rkey;
|
[svn-r15800] Description:
Bring file free space branch changes through r15795 into trunk, which
includes a fair bit of code cleanup & rearrangement along with a couple of
bug fixes also.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-07 12:17:35 +08:00
|
|
|
|
} /* end if */
|
|
|
|
|
|
2015-06-18 08:58:49 +08:00
|
|
|
|
/* Sanity check */
|
2015-07-02 06:08:11 +08:00
|
|
|
|
HDassert((size_t)(image - (uint8_t *)_image) <= len);
|
|
|
|
|
|
|
|
|
|
/* Clear rest of node */
|
|
|
|
|
HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image));
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
[svn-r15800] Description:
Bring file free space branch changes through r15795 into trunk, which
includes a fair bit of code cleanup & rearrangement along with a couple of
bug fixes also.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-07 12:17:35 +08:00
|
|
|
|
done:
|
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value)
|
2015-06-18 08:58:49 +08:00
|
|
|
|
} /* end H5B__serialize() */
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2015-06-18 08:58:49 +08:00
|
|
|
|
* Function: H5B__free_icr
|
2005-11-07 11:13:53 +08:00
|
|
|
|
*
|
2015-06-18 08:58:49 +08:00
|
|
|
|
* Purpose: Destroy/release an "in core representation" of a data structure
|
2005-11-07 11:13:53 +08:00
|
|
|
|
*
|
2015-06-18 08:58:49 +08:00
|
|
|
|
* Return: Non-negative on success/Negative on failure
|
2005-11-07 11:13:53 +08:00
|
|
|
|
*
|
2015-06-18 08:58:49 +08:00
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
|
* koziol@hdfgroup.org
|
|
|
|
|
* Mar 26, 2008
|
2005-11-07 11:13:53 +08:00
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static herr_t
|
2015-06-18 08:58:49 +08:00
|
|
|
|
H5B__free_icr(void *thing)
|
2005-11-07 11:13:53 +08:00
|
|
|
|
{
|
2015-06-18 08:58:49 +08:00
|
|
|
|
herr_t ret_value = SUCCEED; /* Return value */
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
2013-08-10 05:59:14 +08:00
|
|
|
|
FUNC_ENTER_STATIC
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
2015-06-18 08:58:49 +08:00
|
|
|
|
/* Check arguments */
|
|
|
|
|
HDassert(thing);
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
2015-06-18 08:58:49 +08:00
|
|
|
|
/* Destroy B-tree node */
|
|
|
|
|
if(H5B__node_dest((H5B_t *)thing) < 0)
|
|
|
|
|
HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node")
|
2005-11-07 11:13:53 +08:00
|
|
|
|
|
|
|
|
|
done:
|
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value)
|
2015-06-18 08:58:49 +08:00
|
|
|
|
} /* end H5B__free_icr() */
|
[svn-r17313] Description:
Bring back various minor code cleanups from the file free space branch
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-11 01:08:27 +08:00
|
|
|
|
|