summaryrefslogtreecommitdiffstats
path: root/src/H5Fsuper.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2007-02-07 17:04:21 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2007-02-07 17:04:21 (GMT)
commit5dd40af99f77add84e87b6a725de60ac7fce14c0 (patch)
tree1ad5dc007198885253732c93338811278f02fd79 /src/H5Fsuper.c
parented7d456e512d9f2319d8ebe67feb44d842be8c07 (diff)
downloadhdf5-5dd40af99f77add84e87b6a725de60ac7fce14c0.zip
hdf5-5dd40af99f77add84e87b6a725de60ac7fce14c0.tar.gz
hdf5-5dd40af99f77add84e87b6a725de60ac7fce14c0.tar.bz2
[svn-r13254] Cleaned up superblock extension code and added some more helpful comments.
Tested on Windows, smirom, and kagiso.
Diffstat (limited to 'src/H5Fsuper.c')
-rw-r--r--src/H5Fsuper.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 034eaac..dc31a97 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -245,15 +245,6 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc, haddr_t addr,
H5F_addr_decode(f, (const uint8_t **)&p, &shared->base_addr/*out*/);
H5F_addr_decode(f, (const uint8_t **)&p, &(shared->extension_addr)/*out*/);
- /* If the superblock version is greater than 1, read in the shared OH message table information */
-#ifdef JAMES
- if(super_vers >= HDF5_SUPERBLOCK_VERSION_2) {
- H5F_addr_decode(f, (const uint8_t **)&p, &shared->sohm_addr/*out*/);
- shared->sohm_vers = *p++;
- shared->sohm_nindexes = *p++;
- }
-#endif /* JAMES */
-
H5F_addr_decode(f, (const uint8_t **)&p, &stored_eoa/*out*/);
H5F_addr_decode(f, (const uint8_t **)&p, &shared->driver_addr/*out*/);
if(H5G_obj_ent_decode(f, (const uint8_t **)&p, root_loc->oloc/*out*/) < 0)
@@ -396,17 +387,16 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc, haddr_t addr,
/* Read the file's superblock extension, if there is one. */
if(shared->extension_addr != HADDR_UNDEF && super_vers >= HDF5_SUPERBLOCK_VERSION_2) {
H5O_loc_t ext_loc;
-/* JAMES H5O_shmesg_table_t sohm_table; */
H5O_loc_reset(&ext_loc);
ext_loc.file = f;
ext_loc.addr = shared->extension_addr;
- /* JAMES: bump the number of open objects to avoid closing the file here */
- f->nopen_objs++;
+ /* Open the superblock extension */
if(H5O_open(&ext_loc) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENFILE, FAIL, "unable to open superblock extension")
+ /* Read in shared message information, if it exists */
if(NULL == H5O_msg_read(&ext_loc, H5O_SHMESG_ID, &shared->sohm_table, dxpl_id)) {
H5E_clear_stack(NULL);
shared->sohm_addr = HADDR_UNDEF;
@@ -417,11 +407,11 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc, haddr_t addr,
shared->sohm_vers = shared->sohm_table.version;
shared->sohm_nindexes = shared->sohm_table.nindexes;
}
- /* JAMES
- HDassert(sohm_table.addr == shared->sohm_addr);
- HDassert(sohm_table.version == shared->sohm_vers);
- HDassert(sohm_table.nindexes == shared->sohm_nindexes);
-*/
+
+ /* Close the extension. Bump the version number to avoid closing the
+ * file (since this will be the only open object).
+ */
+ f->nopen_objs++;
if(H5O_close(&ext_loc) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENFILE, FAIL, "unable to close superblock extension")
f->nopen_objs--;
@@ -662,14 +652,6 @@ H5F_write_superblock(H5F_t *f, hid_t dxpl_id)
H5F_addr_encode(f, &p, f->shared->base_addr);
H5F_addr_encode(f, &p, f->shared->extension_addr);
-#ifdef JAMES
- if(super_vers >= HDF5_SUPERBLOCK_VERSION_2) {
- H5F_addr_encode(f, &p, f->shared->sohm_addr);
- *p++ = f->shared->sohm_vers;
- *p++ = f->shared->sohm_nindexes;
- }
-#endif /* JAMES */
-
H5F_addr_encode(f, &p, H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER));
H5F_addr_encode(f, &p, f->shared->driver_addr);
if(H5G_obj_ent_encode(f, &p, H5G_oloc(f->shared->root_grp))<0)