summaryrefslogtreecommitdiffstats
path: root/src/H5Dcontig.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-01-27 14:47:26 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-01-27 14:47:26 (GMT)
commit661734d541d076c26901190be44e687ad87ef576 (patch)
treed4aa2ac60e7c3af1ca29b5c20eb9c4202fc31030 /src/H5Dcontig.c
parent92f5db9daf63a4533db475745782f8898b53c489 (diff)
downloadhdf5-661734d541d076c26901190be44e687ad87ef576.zip
hdf5-661734d541d076c26901190be44e687ad87ef576.tar.gz
hdf5-661734d541d076c26901190be44e687ad87ef576.tar.bz2
[svn-r16356] Description:
Bring r16354 back from trunk: Refactor internal layout information, making it easier to add another type of chunk index. Tested on: FreeBSD/32 (duty) (other configurations tested with original change)
Diffstat (limited to 'src/H5Dcontig.c')
-rw-r--r--src/H5Dcontig.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c
index 4b7a5df..112eea5 100644
--- a/src/H5Dcontig.c
+++ b/src/H5Dcontig.c
@@ -63,6 +63,7 @@
/* Layout operation callbacks */
static herr_t H5D_contig_new(H5F_t *f, hid_t dapl_id, hid_t dxpl_id, H5D_t *dset,
const H5P_genplist_t *dc_plist);
+static hbool_t H5D_contig_is_space_alloc(const H5O_layout_t *layout);
static herr_t H5D_contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space,
H5D_chunk_map_t *cm);
@@ -79,6 +80,7 @@ static herr_t H5D_contig_write_one(H5D_io_info_t *io_info, hsize_t offset,
/* Contiguous storage layout I/O ops */
const H5D_layout_ops_t H5D_LOPS_CONTIG[1] = {{
H5D_contig_new,
+ H5D_contig_is_space_alloc,
H5D_contig_io_init,
H5D_contig_read,
H5D_contig_write,
@@ -413,6 +415,35 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5D_contig_is_space_alloc
+ *
+ * Purpose: Query if space is allocated for layout
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * Thursday, January 15, 2009
+ *
+ *-------------------------------------------------------------------------
+ */
+static hbool_t
+H5D_contig_is_space_alloc(const H5O_layout_t *layout)
+{
+ hbool_t ret_value; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_contig_is_space_alloc)
+
+ /* Sanity checks */
+ HDassert(layout);
+
+ /* Set return value */
+ ret_value = (hbool_t)H5F_addr_defined(layout->u.contig.addr);
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5D_contig_is_space_alloc() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5D_contig_io_init
*
* Purpose: Performs initialization before any sort of I/O on the raw data