diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-03-12 02:38:08 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-03-12 02:38:08 (GMT) |
commit | a64589450e5b41dc55b1c6f2e42e837fb0c72bba (patch) | |
tree | 1171b47d4ac3aadeaa87b1df69a95c9ee3054c9d /src/H5O.c | |
parent | e6b818134e24b1d4d99a612218e0a50ffa08bd28 (diff) | |
download | hdf5-a64589450e5b41dc55b1c6f2e42e837fb0c72bba.zip hdf5-a64589450e5b41dc55b1c6f2e42e837fb0c72bba.tar.gz hdf5-a64589450e5b41dc55b1c6f2e42e837fb0c72bba.tar.bz2 |
[svn-r13498] Description:
Eliminate storing # of links in "link info" message, regenerate it
when the object is opened instead.
Tested on:
FreeBSD/32 6.2 (duty)
Mac OS X/32 10.4.8 (amazon)
Diffstat (limited to 'src/H5O.c')
-rw-r--r-- | src/H5O.c | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -2046,3 +2046,43 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_get_create_plist() */ + +/*------------------------------------------------------------------------- + * Function: H5O_get_nlinks + * + * Purpose: Retrieve the number of link messages read in from the file + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * March 11 2007 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O_get_nlinks(const H5O_loc_t *oloc, hid_t dxpl_id, hsize_t *nlinks) +{ + H5O_t *oh = NULL; /* Object header */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(H5O_get_nlinks, FAIL) + + /* Check args */ + HDassert(oloc); + HDassert(nlinks); + + /* Get the object header */ + if(NULL == (oh = H5AC_protect(oloc->file, dxpl_id, H5AC_OHDR, oloc->addr, NULL, NULL, H5AC_READ))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header") + + /* Retrieve the # of link messages seen when the object header was loaded */ + *nlinks = oh->link_msgs_seen; + +done: + if(oh && H5AC_unprotect(oloc->file, dxpl_id, H5AC_OHDR, oloc->addr, oh, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_get_nlinks() */ + |