summaryrefslogtreecommitdiffstats
path: root/windows
Commit message (Expand)AuthorAgeFilesLines
* [svn-r11053] Purpose:Fang Guo2005-07-081-1/+1
* [svn-r11050] Purpose:Fang Guo2005-07-071-0/+2
* [svn-r11049] Purpose:Fang Guo2005-07-071-0/+2
* [svn-r11048] Purpose:Fang Guo2005-07-071-1688/+1718
* [svn-r11045] Purpose:Fang Guo2005-07-071-0/+60
* [svn-r11044] Purpose:Fang Guo2005-07-071-0/+60
* [svn-r11040] Purpose:Fang Guo2005-07-071-0/+7
* [svn-r11039] Purpose:Fang Guo2005-07-071-0/+42
* [svn-r11038] Purpose:Fang Guo2005-07-071-0/+107
* [svn-r11037] Purpose:Fang Guo2005-07-071-0/+107
* [svn-r11029] Purpose:Fang Guo2005-07-051-1688/+1688
* [svn-r11028] Purpose:Fang Guo2005-07-051-0/+30
* [svn-r11027] Purpose:Fang Guo2005-07-051-0/+30
* [svn-r11011] Purpose:before_removing_docsFang Guo2005-07-011-4/+0
* [svn-r11004] Purpose:Fang Guo2005-06-301-1722/+1688
* [svn-r11002] Purpose:Fang Guo2005-06-291-1/+4
* [svn-r10993] Purpose:Fang Guo2005-06-271-1/+4
* [svn-r10992] Purpose:Fang Guo2005-06-271-0/+2
* [svn-r10991] Purpose:Fang Guo2005-06-241-1722/+1722
* [svn-r10990] Purpose:Fang Guo2005-06-241-0/+1
* [svn-r10989] Purpose:Fang Guo2005-06-241-0/+4
* [svn-r10988] Purpose:Fang Guo2005-06-241-1/+1
* [svn-r10987] Purpose:Fang Guo2005-06-241-1/+1
* [svn-r10969] Purpose:Fang Guo2005-06-211-2/+2
* [svn-r10967] Purpose:Fang Guo2005-06-211-1722/+1722
* [svn-r10966] Purpose:Fang Guo2005-06-211-0/+15
* [svn-r10965] Purpose:Fang Guo2005-06-211-30/+45
* [svn-r10964] Purpose:Fang Guo2005-06-211-1722/+1722
* [svn-r10943] Purpose:Fang Guo2005-06-172-4/+4
* [svn-r10941] Purpose:Fang Guo2005-06-171-1722/+1722
* [svn-r10940] Purpose:Fang Guo2005-06-171-8/+8
* [svn-r10939] Purpose:Fang Guo2005-06-171-2/+2
* [svn-r10938] Purpose:Fang Guo2005-06-171-0/+106
* [svn-r10937] Purpose:Fang Guo2005-06-171-0/+107
* [svn-r10936] Purpose:Fang Guo2005-06-171-105/+0
* [svn-r10935] Purpose:Fang Guo2005-06-171-106/+0
* [svn-r10925] Purpose:Fang Guo2005-06-161-1/+1
* [svn-r10912] Purpose:Fang Guo2005-06-131-3/+3
* [svn-r10911] Purpose:Fang Guo2005-06-131-3/+3
* [svn-r10910] Purpose:Fang Guo2005-06-101-9/+5
* [svn-r10907] Purpose:Fang Guo2005-06-101-1/+2
* [svn-r10904] Purpose:Fang Guo2005-06-101-0/+25
* [svn-r10903] Purpose:Fang Guo2005-06-101-0/+2183
* [svn-r10902] Purpose:Fang Guo2005-06-101-0/+111
* [svn-r10901] Purpose:Fang Guo2005-06-101-0/+27
* [svn-r10900] Purpose:Fang Guo2005-06-101-0/+212
* [svn-r10899] Purpose:Fang Guo2005-06-101-0/+114
* [svn-r10898] Purpose:Fang Guo2005-06-101-0/+24
* [svn-r10897] Purpose:Fang Guo2005-06-101-0/+209
* [svn-r10896] Purpose:Fang Guo2005-06-101-0/+34
f); HDassert(H5F_addr_defined(addr)); /* Check for attempting I/O on 'temporary' file address */ if(H5F_addr_le(f_sh->tmp_addr, (addr + size))) HGOTO_ERROR(H5E_IO, H5E_BADRANGE, FAIL, "attempting I/O in temporary file space") /* Treat global heap as raw data */ map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type; /* Pass through page buffer layer */ if(H5PB_read(f_sh, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "read through page buffer failed") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_shared_block_read() */ /*------------------------------------------------------------------------- * Function: H5F_block_read * * Purpose: Reads some data from a file/server/etc into a buffer. * The data is contiguous. The address is relative to the base * address for the file. * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke * matzke@llnl.gov * Jul 10 1997 * *------------------------------------------------------------------------- */ herr_t H5F_block_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/) { H5FD_mem_t map_type; /* Mapped memory type */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ HDassert(f); HDassert(f->shared); HDassert(buf); HDassert(H5F_addr_defined(addr)); /* Check for attempting I/O on 'temporary' file address */ if(H5F_addr_le(f->shared->tmp_addr, (addr + size))) HGOTO_ERROR(H5E_IO, H5E_BADRANGE, FAIL, "attempting I/O in temporary file space") /* Treat global heap as raw data */ map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type; /* Pass through page buffer layer */ if(H5PB_read(f->shared, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "read through page buffer failed") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_block_read() */ /*------------------------------------------------------------------------- * Function: H5F_shared_block_write * * Purpose: Writes some data from memory to a file/server/etc. The * data is contiguous. The address is relative to the base * address. * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke * matzke@llnl.gov * Jul 10 1997 * *------------------------------------------------------------------------- */ herr_t H5F_shared_block_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf) { H5FD_mem_t map_type; /* Mapped memory type */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ HDassert(f_sh); HDassert(H5F_SHARED_INTENT(f_sh) & H5F_ACC_RDWR); HDassert(buf); HDassert(H5F_addr_defined(addr)); /* Check for attempting I/O on 'temporary' file address */ if(H5F_addr_le(f_sh->tmp_addr, (addr + size))) HGOTO_ERROR(H5E_IO, H5E_BADRANGE, FAIL, "attempting I/O in temporary file space") /* Treat global heap as raw data */ map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type; /* Pass through page buffer layer */ if(H5PB_write(f_sh, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "write through page buffer failed") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_shared_block_write() */ /*------------------------------------------------------------------------- * Function: H5F_block_write * * Purpose: Writes some data from memory to a file/server/etc. The * data is contiguous. The address is relative to the base * address. * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke * matzke@llnl.gov * Jul 10 1997 * *------------------------------------------------------------------------- */ herr_t H5F_block_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf) { H5FD_mem_t map_type; /* Mapped memory type */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ HDassert(f); HDassert(f->shared); HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); HDassert(buf); HDassert(H5F_addr_defined(addr)); /* Check for attempting I/O on 'temporary' file address */ if(H5F_addr_le(f->shared->tmp_addr, (addr + size))) HGOTO_ERROR(H5E_IO, H5E_BADRANGE, FAIL, "attempting I/O in temporary file space") /* Treat global heap as raw data */ map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type; /* Pass through page buffer layer */ if(H5PB_write(f->shared, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "write through page buffer failed") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_block_write() */ /*------------------------------------------------------------------------- * Function: H5F_flush_tagged_metadata * * Purpose: Flushes metadata with specified tag in the metadata cache * to disk. * * Return: Non-negative on success/Negative on failure * * Programmer: Mike McGreevy * September 9, 2010 * *------------------------------------------------------------------------- */ herr_t H5F_flush_tagged_metadata(H5F_t *f, haddr_t tag) { herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) /* Use tag to search for and flush associated metadata */ if(H5AC_flush_tagged_metadata(f, tag) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") /* Flush and reset the accumulator */ if(H5F__accum_reset(f->shared, TRUE) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator") /* Flush file buffers to disk. */ if(H5FD_flush(f->shared->lf, FALSE) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "low level flush failed") done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5F_flush_tagged_metadata */ /*------------------------------------------------------------------------- * Function: H5F_evict_tagged_metadata * * Purpose: Evicts metadata from the cache with specified tag. * * Return: Non-negative on success/Negative on failure * * Programmer: Mike McGreevy * September 9, 2010 * *------------------------------------------------------------------------- */ herr_t H5F_evict_tagged_metadata(H5F_t *f, haddr_t tag) { herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) /* Evict the object's metadata */ if(H5AC_evict_tagged_metadata(f, tag, TRUE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "unable to evict tagged metadata") done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5F_evict_tagged_metadata */ /*------------------------------------------------------------------------- * Function: H5F__evict_cache_entries * * Purpose: To evict all cache entries except the pinned superblock entry * * Return: Non-negative on success/Negative on failure * * Programmer: Vailin Choi * Dec 2013 * *------------------------------------------------------------------------- */ herr_t H5F__evict_cache_entries(H5F_t *f) { herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE HDassert(f); HDassert(f->shared); /* Evict all except pinned entries in the cache */ if(H5AC_evict(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "unable to evict all except pinned entries") #ifndef NDEBUG { unsigned status = 0; uint32_t cur_num_entries; /* Retrieve status of the superblock */ if(H5AC_get_entry_status(f, (haddr_t)0, &status) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to get entry status") /* Verify status of the superblock entry in the cache */ if(!(status & H5AC_ES__IN_CACHE) || !(status & H5AC_ES__IS_PINNED)) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to get entry status") /* Get the number of cache entries */ if(H5AC_get_cache_size(f->shared->cache, NULL, NULL, NULL, &cur_num_entries) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_get_cache_size() failed.") /* Should be the only one left in the cache (the superblock) */ if(cur_num_entries != 1) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "number of cache entries is not correct") } #endif /* NDEBUG */ done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5F__evict_cache_entries() */ /*------------------------------------------------------------------------- * Function: H5F_get_checksums * * Purpose: Decode checksum stored in the buffer * Calculate checksum for the data in the buffer * * Note: Assumes that the checksum is the last data in the buffer * * Return: Non-negative on success/Negative on failure * * Programmer: Vailin Choi * Sept 2013 * *------------------------------------------------------------------------- */ herr_t H5F_get_checksums(const uint8_t *buf, size_t buf_size, uint32_t *s_chksum/*out*/, uint32_t *c_chksum/*out*/) { FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(buf); HDassert(buf_size); /* Return the stored checksum */ if(s_chksum) { const uint8_t *chk_p; /* Pointer into raw data buffer */ /* Offset to the checksum in the buffer */ chk_p = buf + buf_size - H5_SIZEOF_CHKSUM; /* Decode the checksum stored in the buffer */ UINT32DECODE(chk_p, *s_chksum); } /* end if */ /* Return the computed checksum for the buffer */ if(c_chksum) *c_chksum = H5_checksum_metadata(buf, buf_size - H5_SIZEOF_CHKSUM, 0); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5F_get_chksums() */