diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-08-19 02:38:03 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-08-19 02:38:03 (GMT) |
commit | c83c6dd945d44cdf9de44087c4063876ab378ac1 (patch) | |
tree | 08c89f8509a316c55e1a9128850dd029654a90cc /src/H5FSsection.c | |
parent | 75d22ed839a6b7a5e048ac52708d04eb4ad590d3 (diff) | |
download | hdf5-c83c6dd945d44cdf9de44087c4063876ab378ac1.zip hdf5-c83c6dd945d44cdf9de44087c4063876ab378ac1.tar.gz hdf5-c83c6dd945d44cdf9de44087c4063876ab378ac1.tar.bz2 |
[svn-r12597] Description:
Take advantage of the new feature in the metadata cache to insert pinned
entries into the metadata cache directly, instead of insterting them,
protecting them, pinning them and unprotecting them.
Tested On:
FreeBSD/32 4.11 (sleipnir)
Linux/64 2.4 (mir)
Solaris/64 2.9 (shanti)
Diffstat (limited to 'src/H5FSsection.c')
-rw-r--r-- | src/H5FSsection.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 21a1027..d7b8fef 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -208,27 +208,27 @@ H5FS_sinfo_pin(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace) if(HADDR_UNDEF == (fspace->sect_addr = H5MF_alloc(f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->alloc_sect_size))) HGOTO_ERROR(H5E_STORAGE, H5E_NOSPACE, NULL, "file allocation failed for free space sections") - /* Cache the new free space section info */ - if(H5AC_set(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, sinfo, H5AC__NO_FLAGS_SET) < 0) + /* Cache the new free space section info (pinned) */ + if(H5AC_set(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, sinfo, H5AC__PIN_ENTRY_FLAG) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, NULL, "can't add free space sections to cache") - sinfo = NULL; /* Mark free space header as dirty */ if(H5AC_mark_pinned_or_protected_entry_dirty(f, fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, NULL, "unable to mark free space header as dirty") } /* end if */ + else { + /* Protect the free space sections */ + if(NULL == (sinfo = H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, NULL, fspace, H5AC_WRITE))) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, NULL, "unable to load free space sections") - /* Protect the free space sections */ - if(NULL == (sinfo = H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, NULL, fspace, H5AC_WRITE))) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, NULL, "unable to load free space sections") - - /* Pin them in the cache */ - if(H5AC_pin_protected_entry(f, sinfo) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTPIN, NULL, "unable to pin free space sections") + /* Pin them in the cache */ + if(H5AC_pin_protected_entry(f, sinfo) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTPIN, NULL, "unable to pin free space sections") - /* Unlock free space sections, now pinned */ - if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, sinfo, H5AC__NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, NULL, "unable to release free space sections") + /* Unlock free space sections, now pinned */ + if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, sinfo, H5AC__NO_FLAGS_SET) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, NULL, "unable to release free space sections") + } /* end else */ /* Update pointer to free space header for section info */ sinfo->fspace = fspace; |