summaryrefslogtreecommitdiffstats
path: root/src/H5Distore.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-10-21 15:52:54 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-10-21 15:52:54 (GMT)
commit275d19661e1f06f95c57e5f81635bb0e5e2c357a (patch)
treeeb393a99ea9d67984c9191597b584c1001ca0515 /src/H5Distore.c
parent155d762b9c4d60e0455f3bc71700a289ad18e6a4 (diff)
downloadhdf5-275d19661e1f06f95c57e5f81635bb0e5e2c357a.zip
hdf5-275d19661e1f06f95c57e5f81635bb0e5e2c357a.tar.gz
hdf5-275d19661e1f06f95c57e5f81635bb0e5e2c357a.tar.bz2
[svn-r11593] Purpose:
Code cleanup Description: Clean up & standardize a bit in preparation for coding standards discussion. Platforms tested: FreeBSD 4.11 (sleipnir) Too minor to require h5committest
Diffstat (limited to 'src/H5Distore.c')
-rw-r--r--src/H5Distore.c156
1 files changed, 28 insertions, 128 deletions
diff --git a/src/H5Distore.c b/src/H5Distore.c
index 2a753f0..bf0c92e 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -40,10 +40,17 @@
* entry which is added to the end of the list.
*/
+/****************/
+/* Module Setup */
+/****************/
+
#define H5B_PACKAGE /*suppress error about including H5Bpkg */
#define H5D_PACKAGE /*suppress error about including H5Dpkg */
+/***********/
+/* Headers */
+/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Bpkg.h" /* B-link trees */
#include "H5Dpkg.h" /* Datasets */
@@ -59,6 +66,10 @@
#include "H5Sprivate.h" /* Dataspaces */
#include "H5Vprivate.h" /* Vector and array functions */
+/****************/
+/* Local Macros */
+/****************/
+
/*
* Feature: If this constant is defined then every cache preemption and load
* causes a character to be printed on the standard error stream:
@@ -91,6 +102,12 @@
*/
#define H5D_ISTORE_NDIMS(X) (((X)->sizeof_rkey-8)/8)
+#define H5D_HASH(D,ADDR) H5F_addr_hash(ADDR,(D)->cache.chunk.nslots)
+
+/******************/
+/* Local Typedefs */
+/******************/
+
/* Raw data chunks are cached. Each entry in the cache is: */
typedef struct H5D_rdcc_ent_t {
hbool_t locked; /*entry is locked in cache */
@@ -136,9 +153,10 @@ typedef struct H5D_istore_ud1_t {
hsize_t *dims; /*dataset dimensions */
} H5D_istore_ud1_t;
-#define H5D_HASH(D,ADDR) H5F_addr_hash(ADDR,(D)->cache.chunk.nslots)
+/********************/
+/* Local Prototypes */
+/********************/
-/* Private prototypes */
static void *H5D_istore_chunk_alloc(size_t size, const H5O_pline_t *pline);
static void *H5D_istore_chunk_xfree(void *chk, const H5O_pline_t *pline);
static herr_t H5D_istore_shared_create (const H5F_t *f, H5O_layout_t *layout);
@@ -199,6 +217,14 @@ H5B_class_t H5B_ISTORE[1] = {{
H5D_istore_debug_key, /*debug */
}};
+/*********************/
+/* Package Variables */
+/*********************/
+
+/*******************/
+/* Local Variables */
+/*******************/
+
/* Declare a free list to manage the H5B_shared_t struct */
H5FL_EXTERN(H5B_shared_t);
@@ -233,8 +259,6 @@ H5FL_BLK_DEFINE_STATIC(chunk_page);
* Programmer: Robb Matzke
* Wednesday, October 8, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
/* ARGSUSED */
@@ -269,8 +293,6 @@ H5D_istore_sizeof_rkey(const H5F_t UNUSED *f, const void *_udata)
* Programmer: Quincey Koziol
* Monday, July 5, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
/* ARGSUSED */
@@ -303,8 +325,6 @@ H5D_istore_get_shared(const H5F_t UNUSED *f, const void *_udata)
* Programmer: Robb Matzke
* Friday, October 10, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -347,8 +367,6 @@ H5D_istore_decode_key(const H5F_t UNUSED *f, const H5B_t *bt, const uint8_t *raw
* Programmer: Robb Matzke
* Friday, October 10, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -391,8 +409,6 @@ H5D_istore_encode_key(const H5F_t UNUSED *f, const H5B_t *bt, uint8_t *raw, void
* Programmer: Robb Matzke
* Thursday, April 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
/* ARGSUSED */
@@ -439,8 +455,6 @@ H5D_istore_debug_key (FILE *stream, H5F_t UNUSED *f, hid_t UNUSED dxpl_id, int i
* Programmer: Robb Matzke
* Thursday, November 6, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
/* ARGSUSED */
@@ -492,8 +506,6 @@ H5D_istore_cmp2(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_uda
* Programmer: Robb Matzke
* Wednesday, October 8, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
/* ARGSUSED */
@@ -557,8 +569,6 @@ H5D_istore_cmp3(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_uda
* Programmer: Robb Matzke
* Tuesday, October 14, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -639,9 +649,6 @@ done:
* Programmer: Robb Matzke
* Thursday, October 9, 1997
*
- * Modifications:
- * Robb Matzke, 1999-07-28
- * The ADDR argument is passed by value.
*-------------------------------------------------------------------------
*/
/* ARGSUSED */
@@ -706,10 +713,6 @@ done:
* Programmer: Robb Matzke
* Thursday, October 9, 1997
*
- * Modifications:
- * Robb Matzke, 1999-07-28
- * The ADDR argument is passed by value. The NEW_NODE argument
- * is renamed NEW_NODE_P.
*-------------------------------------------------------------------------
*/
/* ARGSUSED */
@@ -833,12 +836,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, April 21, 1999
*
- * Modifications:
- * Robb Matzke, 1999-07-28
- * The ADDR argument is passed by value.
- *
- * Quincey Koziol, 2002-04-22
- * Changed to callback from H5B_iterate
*-------------------------------------------------------------------------
*/
/* ARGSUSED */
@@ -870,12 +867,6 @@ H5D_istore_iter_allocated (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_l
* Programmer: Robb Matzke
* Wednesday, April 21, 1999
*
- * Modifications:
- * Robb Matzke, 1999-07-28
- * The ADDR argument is passed by value.
- *
- * Quincey Koziol, 2002-04-22
- * Changed to callback from H5B_iterate
*-------------------------------------------------------------------------
*/
/* ARGSUSED */
@@ -922,8 +913,6 @@ H5D_istore_iter_dump (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_lt_key
* Programmer: Robb Matzke
* Monday, May 18, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -963,8 +952,6 @@ done:
* Programmer: Robb Matzke
* Thursday, May 21, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1079,11 +1066,6 @@ done:
* Programmer: Robb Matzke
* Thursday, May 21, 1998
*
- * Modifications:
- * Pedro Vicente, March 28, 2002
- * Added flush parameter that switches the call to H5F_istore_flush_entry
- * The call with FALSE is used by the H5F_istore_prune_by_extent function
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1146,10 +1128,6 @@ done:
* Programmer: Robb Matzke
* Thursday, May 21, 1998
*
- * Modifications:
- * Pedro Vicente, March 28, 2002
- * Added TRUE parameter to the call to H5F_istore_preempt
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1206,10 +1184,6 @@ done:
* Programmer: Robb Matzke
* Thursday, May 21, 1998
*
- * Modifications:
- * Pedro Vicente, March 28, 2002
- * Added TRUE parameter to the call to H5F_istore_preempt
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1272,8 +1246,6 @@ done:
* Programmer: Quincey Koziol
* Monday, September 27, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1331,8 +1303,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, July 8, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1367,10 +1337,6 @@ H5D_istore_shared_free (void *_shared)
* Programmer: Robb Matzke
* Thursday, May 21, 1998
*
- * Modifications:
- * Pedro Vicente, March 28, 2002
- * TRUE parameter to the call to H5F_istore_preempt
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1498,13 +1464,6 @@ done:
* Programmer: Robb Matzke
* Thursday, May 21, 1998
*
- * Modifications:
- * Robb Matzke, 1999-08-02
- * The split ratios are passed in as part of the data transfer
- * property list.
- *
- * Pedro Vicente, March 28, 2002
- * TRUE parameter to the call to H5F_istore_preempt
*-------------------------------------------------------------------------
*/
static void *
@@ -1778,10 +1737,6 @@ done:
* Programmer: Robb Matzke
* Thursday, May 21, 1998
*
- * Modifications:
- * Robb Matzke, 1999-08-02
- * The split_ratios are passed as part of the data transfer
- * property list.
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1859,8 +1814,6 @@ done:
* Programmer: Quincey Koziol
* Wednesday, May 7, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
ssize_t
@@ -2052,8 +2005,6 @@ done:
* Programmer: Quincey Koziol
* Friday, May 2, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
ssize_t
@@ -2207,8 +2158,6 @@ done:
* Programmer: Robb Matzke
* Tuesday, October 21, 1997
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -2256,9 +2205,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, April 21, 1999
*
- * Modifications:
- * Robb Matzke, 1999-07-28
- * The ADDR argument is passed by value.
*-------------------------------------------------------------------------
*/
hsize_t
@@ -2315,10 +2261,6 @@ done:
* Programmer: Albert Cheng
* June 27, 1998
*
- * Modifications:
- * Modified to return the address instead of returning it through
- * a parameter - QAK, 1/30/02
- *
*-------------------------------------------------------------------------
*/
haddr_t
@@ -2380,8 +2322,6 @@ done:
* Programmer: Quincey Koziol
* April 22, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
@@ -2414,8 +2354,6 @@ H5D_istore_chunk_alloc(size_t size, const H5O_pline_t *pline)
* Programmer: Quincey Koziol
* April 22, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
@@ -2457,26 +2395,6 @@ H5D_istore_chunk_xfree(void *chk, const H5O_pline_t *pline)
* Programmer: Albert Cheng
* June 26, 1998
*
- * Modifications:
- * rky, 1998-09-23
- * Added barrier to preclude racing with data writes.
- *
- * rky, 1998-12-07
- * Added Wait-Signal wrapper around unlock-lock critical region
- * to prevent race condition (unlock reads, lock writes the
- * chunk).
- *
- * Robb Matzke, 1999-08-02
- * The split_ratios are passed in as part of the data transfer
- * property list.
- *
- * Quincey Koziol, 2002-05-16
- * Rewrote algorithm to allocate & write blocks without using
- * lock/unlock code.
- *
- * Quincey Koziol, 2002-05-17
- * Added feature to avoid writing fill-values if user has indicated
- * that they should never be written.
*-------------------------------------------------------------------------
*/
herr_t
@@ -2901,8 +2819,6 @@ done:
*
* Comments: Called by H5D_prune_by_extent
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
/* ARGSUSED */
@@ -2961,8 +2877,6 @@ done:
*
* Comments: Part of H5B_ISTORE
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
/* ARGSUSED */
@@ -3011,8 +2925,6 @@ done:
* Fot the ones that are allocated we initialize the part that lies outside the boundary
* with the fill value.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -3204,8 +3116,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, March 20, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -3256,8 +3166,6 @@ done:
* Programmer: Quincey Koziol
* Saturday, May 29, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -3357,9 +3265,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, April 28, 1999
*
- * Modifications:
- * Robb Matzke, 1999-07-28
- * The ADDR argument is passed by value.
*-------------------------------------------------------------------------
*/
herr_t
@@ -3398,8 +3303,6 @@ done:
* Programmer: Robb Matzke
* Thursday, May 21, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -3461,9 +3364,6 @@ done:
* Programmer: Robb Matzke
* Thursday, April 16, 1998
*
- * Modifications:
- * Robb Matzke, 1999-07-28
- * The ADDR argument is passed by value.
*-------------------------------------------------------------------------
*/
herr_t