diff options
author | James Laird <jlaird@hdfgroup.org> | 2006-09-28 19:36:25 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2006-09-28 19:36:25 (GMT) |
commit | 71ba8671b3c48722c09fed8721e73b9322d14a5c (patch) | |
tree | bce6912afc6d7b4933d141b751175177b6ade45a | |
parent | 3289dc5a18474cfe39211cb006d01a84a4f0a27c (diff) | |
download | hdf5-71ba8671b3c48722c09fed8721e73b9322d14a5c.zip hdf5-71ba8671b3c48722c09fed8721e73b9322d14a5c.tar.gz hdf5-71ba8671b3c48722c09fed8721e73b9322d14a5c.tar.bz2 |
[svn-r12692] Removed code that was used to support lazy allocation of file space
since HDF5 no longer allocates file space lazily.
Tested on mir; should be only a cleanup, since the code isn't called from
anywhere.
-rw-r--r-- | src/H5FD.c | 1 | ||||
-rw-r--r-- | src/H5FDpublic.h | 1 | ||||
-rw-r--r-- | src/H5MF.c | 87 | ||||
-rw-r--r-- | src/H5MFprivate.h | 2 |
4 files changed, 2 insertions, 89 deletions
@@ -1048,7 +1048,6 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) HGOTO_ERROR(H5E_VFL, H5E_CANTINC, NULL, "unable to increment ref count on VFL driver") file->cls = driver; file->maxaddr = maxaddr; - file->reserved_alloc = 0; HDmemset(file->fl, 0, sizeof(file->fl)); if(H5P_get(plist, H5F_ACS_META_BLOCK_SIZE_NAME, &(meta_block_size)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get meta data block size") diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 4a1e084..16ec733 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -219,7 +219,6 @@ struct H5FD_t { unsigned long feature_flags; /* VFL Driver feature Flags */ hsize_t threshold; /* Threshold for alignment */ hsize_t alignment; /* Allocation alignment */ - hsize_t reserved_alloc; /* Space reserved for later alloc calls */ /* Metadata aggregation fields */ hsize_t def_meta_block_size; /* Metadata allocation @@ -215,81 +215,6 @@ done: } /*------------------------------------------------------------------------- - * Function: H5MF_reserve - * - * Purpose: Sets aside file space that has not yet been allocated, but will - * be (or might be in the worst case). This number is used to - * ensure that there is room in the file when it is flushed to disk. - * - * Nothing changes (and no error is generated) if the file is opened - * as read-only. - * - * Return: Success: 0 - * - * Failure: negative - * - * Programmer: James Laird - * Nat Furrer - * Thursday, May 27, 2004 - * - * Modifications: - *------------------------------------------------------------------------- - */ -herr_t -H5MF_reserve(H5F_t *f, hsize_t size) -{ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI(H5MF_reserve, FAIL); - - /* Check arguments */ - assert(f); - - /* Check that there is room in the file to reserve this space */ - if( H5MF_alloc_overflow( f, size ) ) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "not enough address space in file"); - - f->shared->lf->reserved_alloc += size; - -done: - FUNC_LEAVE_NOAPI(ret_value); -} - -/*------------------------------------------------------------------------- - * Function: H5MF_free_reserved - * - * Purpose: Releases the file space set aside by H5MF_reserve. This should - * be called immediately before allocating the file space for which - * the space was reserved. - * - * Return: None - * - * Programmer: James Laird - * Nat Furrer - * Thursday, May 27, 2004 - * - * Modifications: - *------------------------------------------------------------------------- - */ -herr_t -H5MF_free_reserved(H5F_t *f, hsize_t size) -{ - FUNC_ENTER_NOAPI_NOFUNC(H5MF_free_reserved) - - /* Check arguments */ - assert(f); - - /* If this assert breaks, it means that HDF5 is trying to free file space - * that was never reserved. - */ - assert(size <= f->shared->lf->reserved_alloc); - - f->shared->lf->reserved_alloc -= size; - - FUNC_LEAVE_NOAPI(SUCCEED) -} - -/*------------------------------------------------------------------------- * Function: H5MF_alloc_overflow * * Purpose: Checks if an allocation of file space would cause an overflow. @@ -329,19 +254,11 @@ H5MF_alloc_overflow(H5F_t *f, hsize_t size) /* Add the amount of space requested for this allocation */ space_needed += size; - /* Also add space that is "reserved" for data to be flushed - * to disk (e.g., for object headers and the heap). - * This is the total amount of file space that will be - * allocated. - */ - space_needed += f->shared->lf->reserved_alloc; - /* Ensure that this final number is less than the file's * address space. We do this by shifting in multiples * of 16 bits because some systems will do nothing if - * we shift by the size of a long long (64 bits) all at - * once (<cough> Linux <cough>). Thus, we break one shift - * into several smaller shifts. + * we shift by 64 bits all at once (<cough> Linux <cough>). + * Thus, we break one shift into several smaller shifts. */ for(c=0; c < H5F_SIZEOF_ADDR(f); c += 2) space_needed = space_needed >> 16; diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h index 01b8204..e03f267 100644 --- a/src/H5MFprivate.h +++ b/src/H5MFprivate.h @@ -48,8 +48,6 @@ H5_DLL herr_t H5MF_xfree(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size); H5_DLL haddr_t H5MF_realloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, haddr_t old_addr, hsize_t old_size, hsize_t new_size); -H5_DLL herr_t H5MF_reserve(H5F_t *f, hsize_t size); -H5_DLL herr_t H5MF_free_reserved(H5F_t *f, hsize_t size); H5_DLL hbool_t H5MF_alloc_overflow(H5F_t *f, hsize_t size); H5_DLL htri_t H5MF_can_extend(H5F_t *f, H5FD_mem_t type, haddr_t addr, hsize_t size, hsize_t extra_requested); |