summaryrefslogtreecommitdiffstats
path: root/src/H5SM.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2006-12-15 21:28:17 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2006-12-15 21:28:17 (GMT)
commit9236c9a148aaf206294be0554cf78e7ab769bd51 (patch)
treeafa397f1439fd0b6a45592cfc062102ea160d479 /src/H5SM.c
parentaa646b5b43361597e547cea18af1825b43ad8ecb (diff)
downloadhdf5-9236c9a148aaf206294be0554cf78e7ab769bd51.zip
hdf5-9236c9a148aaf206294be0554cf78e7ab769bd51.tar.gz
hdf5-9236c9a148aaf206294be0554cf78e7ab769bd51.tar.bz2
[svn-r13065] Added support for copying shared messages (including turning unshared
messages to shared messages and vice versa). Extended objcopy test to test all "permutations" of shared/unshared and new/old group format. If this proves to take a long time to test, I'll go back and have it run fewer tests when HDF5_TEST_EXPRESS is enabled. Tested on smirom, kagiso, copper, and Windows.
Diffstat (limited to 'src/H5SM.c')
-rwxr-xr-xsrc/H5SM.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/H5SM.c b/src/H5SM.c
index 0e7ba0e..de9bddb 100755
--- a/src/H5SM.c
+++ b/src/H5SM.c
@@ -720,6 +720,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5SM_index_header_t *header,
HGOTO_ERROR(H5E_OHDR, H5E_BADSIZE, FAIL, "can't find message size")
if(NULL == (encoding_buf = H5MM_calloc(buf_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate buffer for encoding")
+
if(H5O_msg_encode(f, type_id, encoding_buf, mesg) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "can't encode message to be shared")
@@ -1153,23 +1154,15 @@ H5SM_get_info(H5F_t *f, unsigned *index_flags, unsigned *minsizes,
FUNC_ENTER_NOAPI(H5SM_get_info, FAIL)
- HDassert(f);
+ HDassert(f && f->shared);
+ HDassert(f->shared->sohm_addr != HADDR_UNDEF);
/* Convenience variables */
table_addr = f->shared->sohm_addr;
- HDassert(table_addr != HADDR_UNDEF);
- HDassert(f->shared->sohm_nindexes > 0);
-
- /* Allocate and initialize the master table structure */
- if(NULL == (table = H5MM_calloc(sizeof(H5SM_master_table_t))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
-
- table->version = f->shared->sohm_vers;
- table->num_indexes = f->shared->sohm_nindexes;
/* Read the rest of the SOHM table information from the cache */
- if (NULL == (table = H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, NULL, table, H5AC_READ)))
+ if (NULL == (table = H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, NULL, NULL, H5AC_READ)))
HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table")
/* Return info */