summaryrefslogtreecommitdiffstats
path: root/src/H5Fsuper.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2006-11-17 19:39:14 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2006-11-17 19:39:14 (GMT)
commite215d22a79d497518040d74c1d1bd3fce34780cb (patch)
treeb311e41efd3ee0d23dae8558f94b4530b4f7db44 /src/H5Fsuper.c
parent5660250f25e8e4cb8f05a838d8d2a6f8466ef55c (diff)
downloadhdf5-e215d22a79d497518040d74c1d1bd3fce34780cb.zip
hdf5-e215d22a79d497518040d74c1d1bd3fce34780cb.tar.gz
hdf5-e215d22a79d497518040d74c1d1bd3fce34780cb.tar.bz2
[svn-r12935] Added list-to-btree conversion, changed SOHM apis, and pushed SOHM table
version and size information into the superblock to eliminate a read when loading it. This is a file format change, and hopefully the last one (knock on wood). Tested on kagiso and Windows (mostly just a SOHM change).
Diffstat (limited to 'src/H5Fsuper.c')
-rw-r--r--src/H5Fsuper.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 234c08d..a77030c 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -240,9 +240,11 @@ 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->freespace_addr/*out*/);
- /* If the superblock version is greater than 1, read in the shared OH message table address */
+ /* If the superblock version is greater than 1, read in the shared OH message table information */
if(super_vers > 1) {
H5F_addr_decode(f, (const uint8_t **)&p, &shared->sohm_addr/*out*/);
+ shared->sohm_vers = *p++;
+ shared->sohm_nindexes = *p++;
}
H5F_addr_decode(f, (const uint8_t **)&p, &stored_eoa/*out*/);
H5F_addr_decode(f, (const uint8_t **)&p, &shared->driver_addr/*out*/);
@@ -374,27 +376,27 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc, haddr_t addr,
size_t sohm_l2b; /* SOHM list-to-btree cutoff */
size_t sohm_b2l; /* SOHM btree-to-list cutoff */
+ HDassert(shared->sohm_nindexes > 0 && shared->sohm_nindexes <= H5SM_MAX_NUM_INDEXES);
+
/* Read in the shared OH message information if there is any */
- if(H5SM_get_info(f, shared->sohm_addr, &nindexes, index_flags, &sohm_l2b, &sohm_b2l, dxpl_id) < 0)
+ if(H5SM_get_info(f, index_flags, &sohm_l2b, &sohm_b2l, dxpl_id) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to read SOHM table information")
- HDassert(nindexes > 0 && nindexes <= H5SM_MAX_NUM_INDEXES);
-
/* Set values in the property list */
- if(H5P_set(c_plist, H5F_CRT_SOHM_NINDEXES_NAME, &nindexes) < 0)
+ if(H5P_set(c_plist, H5F_CRT_SHMSG_NINDEXES_NAME, &(shared->sohm_nindexes)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set number of SOHM indexes");
- if(H5P_set(c_plist, H5F_CRT_INDEX_TYPES_NAME, index_flags) < 0)
+ if(H5P_set(c_plist, H5F_CRT_SHMSG_INDEX_TYPES_NAME, index_flags) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set type flags for indexes");
- if(H5P_set(c_plist, H5F_CRT_SOHM_L2B_NAME, &sohm_l2b) < 0)
+ if(H5P_set(c_plist, H5F_CRT_SHMSG_LIST_MAX_NAME, &sohm_l2b) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set SOHM cutoff in property list");
- if(H5P_set(c_plist, H5F_CRT_SOHM_B2L_NAME, &sohm_b2l) < 0)
+ if(H5P_set(c_plist, H5F_CRT_SHMSG_BTREE_MIN_NAME, &sohm_b2l) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set SOHM cutoff in property list");
}
else
{
/* Shared object header messages are disabled */
nindexes = 0;
- if(H5P_set(c_plist, H5F_CRT_SOHM_NINDEXES_NAME, &nindexes) < 0)
+ if(H5P_set(c_plist, H5F_CRT_SHMSG_NINDEXES_NAME, &nindexes) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set number of SOHM indexes");
}
@@ -459,7 +461,7 @@ H5F_init_superblock(const H5F_t *f, hid_t dxpl_id)
+ 16 /* Length of required fixed-size portion */
+ ((super_vers>0) ? 4 : 0) /* Version specific fixed-size portion */
+ 4 * H5F_sizeof_addr(f) /* Variable-sized addresses */
- + (super_vers>1 ? H5F_sizeof_addr(f) : 0) + /*SOHM table address*/
+ + (super_vers>1 ? H5F_sizeof_addr(f) + 2: 0) + /*SOHM table info*/
+ H5G_SIZEOF_ENTRY(f); /* Size of root group symbol table entry */
/* Compute the size of the driver information block. */
@@ -587,6 +589,8 @@ H5F_write_superblock(H5F_t *f, hid_t dxpl_id)
H5F_addr_encode(f, &p, f->shared->freespace_addr);
if(super_vers > 1) {
H5F_addr_encode(f, &p, f->shared->sohm_addr);
+ *p++ = f->shared->sohm_vers;
+ *p++ = f->shared->sohm_nindexes;
}
H5F_addr_encode(f, &p, H5FD_get_eoa(f->shared->lf));
H5F_addr_encode(f, &p, f->shared->driver_addr);