summaryrefslogtreecommitdiffstats
path: root/src/H5Fsuper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Fsuper.c')
-rw-r--r--src/H5Fsuper.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 8040554..32541ae 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -32,6 +32,7 @@
#include "H5FDprivate.h" /* File drivers */
#include "H5Iprivate.h" /* IDs */
#include "H5MFprivate.h" /* File memory management */
+#include "H5MMprivate.h" /* Memory management */
#include "H5Pprivate.h" /* Property lists */
#include "H5SMprivate.h" /* Shared Object Header Messages */
@@ -230,7 +231,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc)
+H5F_super_read(H5F_t *f, hid_t dxpl_id)
{
uint8_t sbuf[H5F_MAX_SUPERBLOCK_SIZE]; /* Buffer for superblock */
H5P_genplist_t *c_plist; /* File creation property list */
@@ -383,8 +384,9 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc)
H5F_addr_decode(f, (const uint8_t **)&p, &shared->extension_addr/*out*/);
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*/,
- &shared->root_ent/*out*/) < 0)
+
+ /* Decode the symbol table entry */
+ if(H5G_root_ent_decode(f, (const uint8_t **)&p) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to read root symbol entry")
/*
@@ -468,7 +470,6 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc)
} /* end if */
} /* end if */
else {
- haddr_t root_addr; /* Address of root group */
uint32_t computed_chksum; /* Computed checksum */
uint32_t read_chksum; /* Checksum read from file */
@@ -499,7 +500,7 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc)
H5F_addr_decode(f, (const uint8_t **)&p, &shared->base_addr/*out*/);
H5F_addr_decode(f, (const uint8_t **)&p, &shared->extension_addr/*out*/);
H5F_addr_decode(f, (const uint8_t **)&p, &stored_eoa/*out*/);
- H5F_addr_decode(f, (const uint8_t **)&p, &root_addr/*out*/);
+ H5F_addr_decode(f, (const uint8_t **)&p, &shared->root_addr/*out*/);
/* Compute checksum for superblock */
computed_chksum = H5_checksum_metadata(sbuf, (size_t)(p - sbuf), 0);
@@ -511,11 +512,6 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc)
if(read_chksum != computed_chksum)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "bad checksum on driver information block")
- /* Create root group object location */
- H5O_loc_reset(root_loc->oloc);
- root_loc->oloc->file = f;
- root_loc->oloc->addr = root_addr;
-
/*
* Check if superblock address is different from base address and
* adjust base address and "end of address" address if so.
@@ -930,7 +926,9 @@ H5F_super_write(H5F_t *f, hid_t dxpl_id)
rel_eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER);
H5F_addr_encode(f, &p, (rel_eoa + f->shared->base_addr));
H5F_addr_encode(f, &p, f->shared->driver_addr);
- if(H5G_obj_ent_encode(f, &p, H5G_oloc(f->shared->root_grp)) < 0)
+
+ /* Encode the root group object entry, including the cached stab info */
+ if(H5G_root_ent_encode(f, &p) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to encode root group information")
/* Encode the driver information block. */