summaryrefslogtreecommitdiffstats
path: root/src/H5HFdtable.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-06-19 10:06:10 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-06-19 10:06:10 (GMT)
commit9db9e82cd1c4e35c6e64fbb2da5eb1db95a0fb55 (patch)
treedf8aaa72b1094bcfacc740a8d33b255c84e1d34e /src/H5HFdtable.c
parent54e2de04d3b7a0359c80cc995f94b63123f4a4da (diff)
downloadhdf5-9db9e82cd1c4e35c6e64fbb2da5eb1db95a0fb55.zip
hdf5-9db9e82cd1c4e35c6e64fbb2da5eb1db95a0fb55.tar.gz
hdf5-9db9e82cd1c4e35c6e64fbb2da5eb1db95a0fb55.tar.bz2
[svn-r12424] Purpose:
Code checkpoint Description: Add in more new features for the fractal heap code, mostly bringing in more ability for deleting objects (which isn't completely working yet). Also, checkpoint free space manager code, which is essentially complete (although it needs some more work after the metadata cache has some additional features) Platforms tested: FreeBSD 4.11 (sleipnir) Linux 2.4 (chicago) h5committest
Diffstat (limited to 'src/H5HFdtable.c')
-rw-r--r--src/H5HFdtable.c39
1 files changed, 35 insertions, 4 deletions
diff --git a/src/H5HFdtable.c b/src/H5HFdtable.c
index e51b45b..1461cd7 100644
--- a/src/H5HFdtable.c
+++ b/src/H5HFdtable.c
@@ -103,11 +103,11 @@ H5HF_dtable_init(H5HF_dtable_t *dtable)
HDassert(dtable);
/* Compute/cache some values */
- dtable->first_row_bits = H5V_log2_of2(dtable->cparam.start_block_size) +
- H5V_log2_of2(dtable->cparam.width);
+ dtable->start_bits = H5V_log2_of2(dtable->cparam.start_block_size);
+ dtable->first_row_bits = dtable->start_bits + H5V_log2_of2(dtable->cparam.width);
dtable->max_root_rows = (dtable->cparam.max_index - dtable->first_row_bits) + 1;
- dtable->max_direct_rows = (H5V_log2_of2(dtable->cparam.max_direct_size) -
- H5V_log2_of2(dtable->cparam.start_block_size)) + 2;
+ dtable->max_direct_bits = H5V_log2_of2(dtable->cparam.max_direct_size);
+ dtable->max_direct_rows = (dtable->max_direct_bits - dtable->start_bits) + 2;
dtable->num_id_first_row = dtable->cparam.start_block_size * dtable->cparam.width;
dtable->max_dir_blk_off_size = H5HF_SIZEOF_OFFSET_LEN(dtable->cparam.max_direct_size);
@@ -245,3 +245,34 @@ H5HF_dtable_size_to_row(H5HF_dtable_t *dtable, size_t block_size)
FUNC_LEAVE_NOAPI(row)
} /* end H5HF_dtable_size_to_row() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5HF_dtable_size_to_rows
+ *
+ * Purpose: Compute # of rows of indirect block of a given size
+ *
+ * Return: Non-negative on success (can't fail)
+ *
+ * Programmer: Quincey Koziol
+ * koziol@ncsa.uiuc.edu
+ * May 31 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+unsigned
+H5HF_dtable_size_to_rows(H5HF_dtable_t *dtable, hsize_t size)
+{
+ unsigned rows; /* # of rows required for indirect block */
+
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_dtable_size_to_rows)
+
+ /*
+ * Check arguments.
+ */
+ HDassert(dtable);
+
+ rows = (H5V_log2_gen(size) - dtable->first_row_bits) + 1;
+
+ FUNC_LEAVE_NOAPI(rows)
+} /* end H5HF_dtable_size_to_rows() */
+