summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-06-11 03:28:57 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-06-11 03:28:57 (GMT)
commit19e0ec17dd066748a739ecb9ac4cd584479ea92c (patch)
tree10f1b1e29b98545f0c92965128dab721595b22a7 /src
parent4d2449d3827d2b9fc882b07fcd19243a3355df71 (diff)
downloadhdf5-19e0ec17dd066748a739ecb9ac4cd584479ea92c.zip
hdf5-19e0ec17dd066748a739ecb9ac4cd584479ea92c.tar.gz
hdf5-19e0ec17dd066748a739ecb9ac4cd584479ea92c.tar.bz2
[svn-r17029] Description:
Adjust 'temporary' file space code to always be within the file's address space, even when the file uses 32-bit addresses. (It's not really necessary to be within the file's address space, since objects with temporary addresses can't be written to the file, but it can't really hurt and it makes the testing easier) Tested on: Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode and with 'make check-vfd'
Diffstat (limited to 'src')
-rw-r--r--src/H5F.c2
-rw-r--r--src/H5Fpkg.h1
-rw-r--r--src/H5Ftest.c33
3 files changed, 35 insertions, 1 deletions
diff --git a/src/H5F.c b/src/H5F.c
index d1890b0..3c3f98e 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -894,7 +894,6 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf)
f->shared->accum.loc = HADDR_UNDEF;
f->shared->lf = lf;
f->shared->root_addr = HADDR_UNDEF;
- f->shared->tmp_addr = HADDR_MAX;
/*
* Copy the file creation and file access property lists into the
@@ -950,6 +949,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf)
f->shared->maxaddr = H5FD_get_maxaddr(lf);
if(!H5F_addr_defined(f->shared->maxaddr))
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad maximum address from VFD")
+ f->shared->tmp_addr = f->shared->maxaddr;
if(H5FD_get_feature_flags(lf, &f->shared->feature_flags) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get feature flags from VFD")
if(H5FD_get_fs_type_map(lf, f->shared->fs_type_map) < 0)
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index 59f5109..acc8aaf 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -250,6 +250,7 @@ H5_DLL herr_t H5F_sfile_remove(H5F_file_t *shared);
H5_DLL herr_t H5F_get_sohm_mesg_count_test(hid_t fid, unsigned type_id,
size_t *mesg_count);
H5_DLL herr_t H5F_check_cached_stab_test(hid_t file_id);
+H5_DLL herr_t H5F_get_maxaddr_test(hid_t file_id, haddr_t *maxaddr);
#endif /* H5F_TESTING */
#endif /* _H5Fpkg_H */
diff --git a/src/H5Ftest.c b/src/H5Ftest.c
index 8cbc133..72fee96 100644
--- a/src/H5Ftest.c
+++ b/src/H5Ftest.c
@@ -153,3 +153,36 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_check_cached_stab_test() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5F_get_maxaddr_test
+ *
+ * Purpose: Retrieve the maximum address for a file
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Quincey Koziol
+ * Jun 10, 2009
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5F_get_maxaddr_test(hid_t file_id, haddr_t *maxaddr)
+{
+ H5F_t *file; /* File info */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT(H5F_get_maxaddr_test)
+
+ /* Check arguments */
+ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file")
+
+ /* Retrieve maxaddr for file */
+ *maxaddr = file->shared->maxaddr;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5F_get_maxaddr_test() */
+