summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-11-15 16:03:37 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-11-15 16:03:37 (GMT)
commitbe3ccfa47de5d0e80cc64421d6b4b9ed3df8bbcc (patch)
treef800d66da093105506d11714db5bc4082d6b4659
parentbff2b14a052063b5f339e747278f57942fa67e59 (diff)
downloadhdf5-be3ccfa47de5d0e80cc64421d6b4b9ed3df8bbcc.zip
hdf5-be3ccfa47de5d0e80cc64421d6b4b9ed3df8bbcc.tar.gz
hdf5-be3ccfa47de5d0e80cc64421d6b4b9ed3df8bbcc.tar.bz2
[svn-r14262] Description:
Correct "off by one" error in computing the size of block to allocate when the I/O size is less than the memory block size. Tested on: Customer machines, by local developer...
-rw-r--r--src/H5FDdirect.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index 23ff0fe..b078511 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -976,7 +976,7 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha
* copy buffer size. Make a bigger buffer for aligned I/O if size is
* smaller than maximal copy buffer. */
if(size < _cbsize)
- alloc_size = (size / _fbsize + 1) * _fbsize + _fbsize;
+ alloc_size = ((size / _fbsize) * _fbsize) + _fbsize;
else
alloc_size = _cbsize;
if (HDposix_memalign(&copy_buf, _boundary, alloc_size) != 0)
@@ -1141,7 +1141,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h
* smaller than maximal copy buffer.
*/
if(size < _cbsize)
- alloc_size = (size / _fbsize + 1) * _fbsize + _fbsize;
+ alloc_size = ((size / _fbsize) * _fbsize) + _fbsize;
else
alloc_size = _cbsize;