summaryrefslogtreecommitdiffstats
path: root/src/H5Osdspace.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2006-11-13 20:41:36 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2006-11-13 20:41:36 (GMT)
commitb6c317f27cd150aa7bfc4e9cf275629570c9a319 (patch)
tree3413a54aec3bbebb821088a473f6ff425c3d39be /src/H5Osdspace.c
parent77c265f26746359cf348437702c93c162f7022f6 (diff)
downloadhdf5-b6c317f27cd150aa7bfc4e9cf275629570c9a319.zip
hdf5-b6c317f27cd150aa7bfc4e9cf275629570c9a319.tar.gz
hdf5-b6c317f27cd150aa7bfc4e9cf275629570c9a319.tar.bz2
[svn-r12902] Checkin of Shared Object Header Message work.
This feature is still in progress; Shared Object Header Messages are not complete as a feature and are not thoroughly tested. There are still "TODO" comments in the code (comments with the word "JAMES" in them, so as not to be confused with other TODO comments). Hopefully this checkin will reduce the liklihood of conflicts as I finish implementing this feature. All current tests pass on juniper, copper (parallel), heping, kagiso, and mir.
Diffstat (limited to 'src/H5Osdspace.c')
-rw-r--r--src/H5Osdspace.c110
1 files changed, 108 insertions, 2 deletions
diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c
index f1f5d36..9c19675 100644
--- a/src/H5Osdspace.c
+++ b/src/H5Osdspace.c
@@ -31,6 +31,11 @@ static void *H5O_sdspace_copy(const void *_mesg, void *_dest, unsigned update_fl
static size_t H5O_sdspace_size(const H5F_t *f, const void *_mesg);
static herr_t H5O_sdspace_reset(void *_mesg);
static herr_t H5O_sdspace_free (void *_mesg);
+static herr_t H5O_sdspace_get_share (H5F_t *f, const void *_mesg,
+ H5O_shared_t *sh);
+static herr_t H5O_sdspace_set_share (H5F_t *f, void *_mesg,
+ const H5O_shared_t *sh);
+static htri_t H5O_sdspace_is_shared (const void *_mesg);
static herr_t H5O_sdspace_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg,
FILE * stream, int indent, int fwidth);
@@ -47,8 +52,9 @@ const H5O_msg_class_t H5O_MSG_SDSPACE[1] = {{
H5O_sdspace_free, /* free method */
NULL, /* file delete method */
NULL, /* link method */
- NULL, /* get share method */
- NULL, /* set share method */
+ H5O_sdspace_get_share, /* get share method */
+ H5O_sdspace_set_share, /* set share method */
+ H5O_sdspace_is_shared, /* is shared method */
NULL, /* pre copy native value to file */
NULL, /* copy native value to file */
NULL, /* post copy native value to file */
@@ -441,6 +447,106 @@ H5O_sdspace_free (void *mesg)
}
+/*-------------------------------------------------------------------------
+ * Function: H5O_sdspace_get_share
+ *
+ * Purpose: Gets sharing information from the message
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: James Laird
+ * Tuesday, October 10, 2006
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5O_sdspace_get_share(H5F_t UNUSED *f, const void *_mesg,
+ H5O_shared_t *sh /*out*/)
+{
+ H5S_extent_t *mesg = (H5S_extent_t *)_mesg;
+ herr_t ret_value = SUCCEED;
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_get_share);
+
+ HDassert (mesg);
+ HDassert (sh);
+
+
+ if(NULL == H5O_copy(H5O_SHARED_ID, &(mesg->sh_loc), sh))
+ ret_value = FAIL;
+
+ FUNC_LEAVE_NOAPI(ret_value);
+}
+
+/*-------------------------------------------------------------------------
+ * Function: H5O_sdspace_set_share
+ *
+ * Purpose: Sets sharing information for the message
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: James Laird
+ * Tuesday, October 10, 2006
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5O_sdspace_set_share(H5F_t UNUSED *f, void *_mesg/*in,out*/,
+ const H5O_shared_t *sh)
+{
+ H5S_extent_t *mesg = (H5S_extent_t *)_mesg;
+ herr_t ret_value = SUCCEED;
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_set_share);
+
+ HDassert (mesg);
+ HDassert (sh);
+
+ if(NULL == H5O_copy(H5O_SHARED_ID, sh, &(mesg->sh_loc)))
+ ret_value = FAIL;
+
+ FUNC_LEAVE_NOAPI(ret_value);
+}
+
+/*-------------------------------------------------------------------------
+ * Function: H5O_sdspace_is_shared
+ *
+ * Purpose: Determines if this dataspace is shared (committed or a SOHM)
+ * or not.
+ *
+ * Return: TRUE if dataspace is shared
+ * FALSE if dataspace is not shared
+ * Negative on failure
+ *
+ * Programmer: James Laird
+ * Monday, October 16, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+static htri_t
+H5O_sdspace_is_shared (const void *_mesg)
+{
+ H5S_extent_t *mesg = (H5S_extent_t *)_mesg;
+ htri_t ret_value;
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_is_shared)
+
+ HDassert(mesg);
+
+ /* Dataspaces can't currently be committed, but this should let the
+ * library read a "committed dataspace" if we ever create one in
+ * the future.
+ */
+ if(mesg->sh_loc.flags & (H5O_COMMITTED_FLAG | H5O_SHARED_IN_HEAP_FLAG))
+ ret_value = TRUE;
+ else
+ ret_value = FALSE;
+
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* end H5O_sdspace_is_shared */
+
/*--------------------------------------------------------------------------
NAME
H5O_sdspace_debug