summaryrefslogtreecommitdiffstats
path: root/src/H5FDint.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2009-03-26 15:29:23 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2009-03-26 15:29:23 (GMT)
commit9863d5aee2dd6b8a862199671640c209191c8c77 (patch)
tree3e84e5b480cc2c0dccd08923838aebd537edd8e3 /src/H5FDint.c
parent2def5e4c85b2fa2cdc992f360a90dc2a103e9e17 (diff)
downloadhdf5-9863d5aee2dd6b8a862199671640c209191c8c77.zip
hdf5-9863d5aee2dd6b8a862199671640c209191c8c77.tar.gz
hdf5-9863d5aee2dd6b8a862199671640c209191c8c77.tar.bz2
[svn-r16616] Purpose: Fix bug 1499
Description: Due to a bug in H5F_super_read, every time a file with a user block was opened it would grow by the size of the user block. The bug has been fixed, and comments have been added to clarify when an eoa address should be relative and when it should be absolute. Tested: jam, linew (h5committest)
Diffstat (limited to 'src/H5FDint.c')
-rw-r--r--src/H5FDint.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/H5FDint.c b/src/H5FDint.c
index aa375e2..74b3bf6 100644
--- a/src/H5FDint.c
+++ b/src/H5FDint.c
@@ -194,6 +194,11 @@ done:
*
* Purpose: Private version of H5FDset_eoa()
*
+ * This function expects the EOA is a RELATIVE address, i.e.
+ * relative to the base address. This is NOT the same as the
+ * EOA stored in the superblock, which is an absolute
+ * address. Object addresses are relative.
+ *
* Return: Success: Non-negative
* Failure: Negative, no side effect
*
@@ -212,7 +217,7 @@ H5FD_set_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr)
HDassert(file && file->cls);
HDassert(H5F_addr_defined(addr) && addr <= file->maxaddr);
- /* Dispatch to driver */
+ /* Dispatch to driver, convert to absolute address */
if((file->cls->set_eoa)(file, type, addr + file->base_addr) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver set_eoa request failed")
@@ -226,6 +231,11 @@ done:
*
* Purpose: Private version of H5FDget_eoa()
*
+ * This function returns the EOA as a RELATIVE address, i.e.
+ * relative to the base address. This is NOT the same as the
+ * EOA stored in the superblock, which is an absolute
+ * address. Object addresses are relative.
+ *
* Return: Success: First byte after allocated memory.
* Failure: HADDR_UNDEF
*
@@ -247,7 +257,7 @@ H5FD_get_eoa(const H5FD_t *file, H5FD_mem_t type)
if(HADDR_UNDEF == (ret_value = (file->cls->get_eoa)(file, type)))
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eoa request failed")
- /* Adjust for base address in file */
+ /* Adjust for base address in file (convert to relative address) */
ret_value -= file->base_addr;
done:
@@ -260,6 +270,11 @@ done:
*
* Purpose: Private version of H5FDget_eof()
*
+ * This function returns the EOF as a RELATIVE address, i.e.
+ * relative to the base address. This will be different
+ * from the end of the physical file if there is a user
+ * block.
+ *
* Return: Success: The EOF address.
*
* Failure: HADDR_UNDEF
@@ -288,7 +303,7 @@ H5FD_get_eof(const H5FD_t *file)
else
ret_value = file->maxaddr;
- /* Adjust for base address in file */
+ /* Adjust for base address in file (convert to relative address) */
ret_value -= file->base_addr;
done: