diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-05-27 22:57:29 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-05-27 22:57:29 (GMT) |
commit | e4246519c9d59a5f837f2b1009471533b729b778 (patch) | |
tree | 0ed23bfb58157edccfa11487a6c9f293b9e97670 /src/H5C.c | |
parent | fc3de1ec794584b1bdc6e615d8d2afc15f5bb5ec (diff) | |
download | hdf5-e4246519c9d59a5f837f2b1009471533b729b778.zip hdf5-e4246519c9d59a5f837f2b1009471533b729b778.tar.gz hdf5-e4246519c9d59a5f837f2b1009471533b729b778.tar.bz2 |
[svn-r18920] Description:
Bring r18917 from trunk to 1.8 branch:
Bring r18911 (plus some adaptions to match the code on the trunk)
from the metadata journaling "merging" branch to the trunk:
More general changes to align trunk with eventual changes from
metadata journaling branch.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Diffstat (limited to 'src/H5C.c')
-rw-r--r-- | src/H5C.c | 94 |
1 files changed, 41 insertions, 53 deletions
@@ -1986,13 +1986,10 @@ H5C_insert_entry(H5F_t * f, /* not protected, so can't be dirtied */ entry_ptr->dirtied = FALSE; - if ( (type->size)(f, thing, &(entry_ptr->size)) < 0 ) { - - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, FAIL, \ - "Can't get size of thing") - } - - HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); + /* Retrieve the size of the thing */ + if((type->size)(f, thing, &(entry_ptr->size)) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, FAIL, "Can't get size of thing") + HDassert(entry_ptr->size > 0 && entry_ptr->size < H5C_MAX_ENTRY_SIZE); entry_ptr->in_slist = FALSE; @@ -4470,8 +4467,6 @@ H5C_unprotect(H5F_t * f, #ifdef H5_HAVE_PARALLEL hbool_t clear_entry = FALSE; #endif /* H5_HAVE_PARALLEL */ - herr_t result; - size_t size_increase = 0; H5C_cache_entry_t * entry_ptr; H5C_cache_entry_t * test_entry_ptr; herr_t ret_value = SUCCEED; /* Return value */ @@ -7432,28 +7427,27 @@ H5C_load_entry(H5F_t * f, hbool_t UNUSED skip_file_checks) #endif /* NDEBUG */ { - void * thing = NULL; - void * ret_value = NULL; - H5C_cache_entry_t * entry_ptr = NULL; + void * thing = NULL; /* Pointer to thing loaded */ + H5C_cache_entry_t * entry; /* Alias for thing loaded, as cache entry */ + void * ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5C_load_entry) - HDassert( f ); - HDassert( f->shared ); - HDassert( f->shared->cache ); - HDassert( skip_file_checks || f ); - HDassert( type ); - HDassert( type->load ); - HDassert( type->size ); - HDassert( H5F_addr_defined(addr) ); + HDassert(f); + HDassert(f->shared); + HDassert(f->shared->cache); + HDassert(skip_file_checks || f); + HDassert(type); + HDassert(type->load); + HDassert(type->size); + HDassert(H5F_addr_defined(addr)); - if ( NULL == (thing = (type->load)(f, dxpl_id, addr, udata)) ) { + if(NULL == (thing = (type->load)(f, dxpl_id, addr, udata))) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "unable to load entry") - } - entry_ptr = (H5C_cache_entry_t *)thing; + entry = (H5C_cache_entry_t *)thing; /* In general, an entry should be clean just after it is loaded. * @@ -7464,11 +7458,11 @@ H5C_load_entry(H5F_t * f, * * To support this bug fix, I have replace the old assert: * - * HDassert( entry_ptr->is_dirty == FALSE ); + * HDassert( entry->is_dirty == FALSE ); * * with: * - * HDassert( ( entry_ptr->is_dirty == FALSE ) || ( type->id == 5 ) ); + * HDassert( ( entry->is_dirty == FALSE ) || ( type->id == 5 ) ); * * Note that type id 5 is associated with object headers in the metadata * cache. @@ -7478,50 +7472,44 @@ H5C_load_entry(H5F_t * f, * metadata cache. */ - HDassert( ( entry_ptr->is_dirty == FALSE ) || ( type->id == 5 ) ); + HDassert( ( entry->is_dirty == FALSE ) || ( type->id == 5 ) ); #ifndef NDEBUG - entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; + entry->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; #endif /* NDEBUG */ - entry_ptr->cache_ptr = f->shared->cache; - entry_ptr->addr = addr; - entry_ptr->type = type; - entry_ptr->is_protected = FALSE; - entry_ptr->is_read_only = FALSE; - entry_ptr->ro_ref_count = 0; - entry_ptr->in_slist = FALSE; - entry_ptr->flush_marker = FALSE; + entry->cache_ptr = f->shared->cache; + entry->addr = addr; + entry->type = type; + entry->is_protected = FALSE; + entry->is_read_only = FALSE; + entry->ro_ref_count = 0; + entry->in_slist = FALSE; + entry->flush_marker = FALSE; #ifdef H5_HAVE_PARALLEL - entry_ptr->clear_on_unprotect = FALSE; + entry->clear_on_unprotect = FALSE; #endif /* H5_HAVE_PARALLEL */ - entry_ptr->flush_in_progress = FALSE; - entry_ptr->destroy_in_progress = FALSE; - entry_ptr->free_file_space_on_destroy = FALSE; + entry->flush_in_progress = FALSE; + entry->destroy_in_progress = FALSE; + entry->free_file_space_on_destroy = FALSE; - if ( (type->size)(f, thing, &(entry_ptr->size)) < 0 ) { + if((type->size)(f, thing, &(entry->size)) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, NULL, \ - "Can't get size of thing") - } + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, NULL, "Can't get size of thing") - HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); + HDassert( entry->size < H5C_MAX_ENTRY_SIZE ); - entry_ptr->ht_next = NULL; - entry_ptr->ht_prev = NULL; + entry->next = NULL; + entry->prev = NULL; - entry_ptr->next = NULL; - entry_ptr->prev = NULL; + entry->aux_next = NULL; + entry->aux_prev = NULL; - entry_ptr->aux_next = NULL; - entry_ptr->aux_prev = NULL; - - H5C__RESET_CACHE_ENTRY_STATS(entry_ptr); + H5C__RESET_CACHE_ENTRY_STATS(entry); ret_value = thing; done: FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_load_entry() */ |