diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-03-10 04:56:53 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-03-10 04:56:53 (GMT) |
commit | a127510b7b3049d0e136b677b180c8e644bdc7ea (patch) | |
tree | 0a7144ca74266b0e6eed3d86febd2968c9af7d40 /src/H5O.c | |
parent | 1bca28acc3294e465d22e4dee8ecfc92fbc55ebe (diff) | |
download | hdf5-a127510b7b3049d0e136b677b180c8e644bdc7ea.zip hdf5-a127510b7b3049d0e136b677b180c8e644bdc7ea.tar.gz hdf5-a127510b7b3049d0e136b677b180c8e644bdc7ea.tar.bz2 |
[svn-r13486] Description:
Move attribute tracking information out of object header prefix and
make it into a message that is inserted only when attributes are present on
the object.
Tested on:
FreeBSD/32 6.2 (duty)
Diffstat (limited to 'src/H5O.c')
-rw-r--r-- | src/H5O.c | 33 |
1 files changed, 2 insertions, 31 deletions
@@ -38,7 +38,6 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5Aprivate.h" /* Attributes */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5FLprivate.h" /* Free lists */ @@ -693,11 +692,6 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, hid_t ocpl_id, if(H5P_get(oc_plist, H5O_CRT_ATTR_MIN_DENSE_NAME, &oh->min_dense) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get min. # of dense attributes") - /* Set starting values for dense attribute storage info */ - oh->attr_fheap_addr = HADDR_UNDEF; - oh->name_bt2_addr = HADDR_UNDEF; - oh->corder_bt2_addr = HADDR_UNDEF; - /* Check for non-default attribute storage phase change values */ if(oh->max_compact != H5O_CRT_ATTR_MAX_COMPACT_DEF || oh->min_dense != H5O_CRT_ATTR_MIN_DENSE_DEF) oh->flags |= H5O_HDR_ATTR_STORE_PHASE_CHANGE; @@ -708,11 +702,6 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, hid_t ocpl_id, /* Reset unused time fields */ oh->atime = oh->mtime = oh->ctime = oh->btime = 0; - - /* Reset unused attribute fields */ - oh->attr_fheap_addr = HADDR_UNDEF; - oh->name_bt2_addr = HADDR_UNDEF; - oh->corder_bt2_addr = HADDR_UNDEF; } /* end else */ /* Compute total size of initial object header */ @@ -1467,12 +1456,6 @@ H5O_delete_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete file space for object header message") } /* end for */ - /* Check for dense attribute storage & delete it if necessary */ - if(oh->version > H5O_VERSION_1 && H5F_addr_defined(oh->attr_fheap_addr)) { - if(H5A_dense_delete(f, dxpl_id, oh) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete dense attribute storage") - } /* end if */ - /* Free main (first) object header "chunk" */ if(H5MF_xfree(f, H5FD_MEM_OHDR, dxpl_id, oh->chunk[0].addr, (hsize_t)oh->chunk[0].size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free object header") @@ -1920,7 +1903,6 @@ H5O_get_info(H5O_loc_t *oloc, H5O_info_t *oinfo, hid_t dxpl_id) oinfo->hdr.flags = oh->flags; /* Iterate over all the messages, accumulating message size & type information */ - oinfo->num_attrs = 0; oinfo->hdr.space.meta = H5O_SIZEOF_HDR(oh) + (H5O_SIZEOF_CHKHDR_OH(oh) * (oh->nchunks - 1)); oinfo->hdr.space.mesg = 0; oinfo->hdr.space.free = 0; @@ -1929,10 +1911,6 @@ H5O_get_info(H5O_loc_t *oloc, H5O_info_t *oinfo, hid_t dxpl_id) for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { uint64_t type_flag; /* Flag for message type */ - /* Check for attribute message */ - if(H5O_ATTR_ID == curr_msg->type->id) - oinfo->num_attrs++; - /* Accumulate space usage information, based on the type of message */ if(H5O_NULL_ID == curr_msg->type->id) oinfo->hdr.space.free += H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size; @@ -1952,15 +1930,8 @@ H5O_get_info(H5O_loc_t *oloc, H5O_info_t *oinfo, hid_t dxpl_id) oinfo->hdr.mesg.shared |= type_flag; } /* end for */ - /* Sanity checking, etc. for # of attributes */ - if(oh->version > H5O_VERSION_1) { - if(H5F_addr_defined(oh->attr_fheap_addr)) { - HDassert(oinfo->num_attrs == 0); - oinfo->num_attrs = oh->nattrs; - } /* end if */ - else - HDassert(oh->nattrs == oinfo->num_attrs); - } /* end if */ + /* Retrieve # of attributes */ + oinfo->num_attrs = H5O_attr_count_real(oloc->file, dxpl_id, oh); /* Iterate over all the chunks, adding any gaps to the free space */ oinfo->hdr.space.total = 0; |