diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2002-07-02 12:33:45 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2002-07-02 12:33:45 (GMT) |
commit | d72832679058d5cf0368a65b680e9d2459df5dd6 (patch) | |
tree | c8e1e340dacfa18f0ea6d9d5656290cb208427cf | |
parent | 80aee07340706e9bc8973694b5e533c1b7bd5a8b (diff) | |
download | hdf5-d72832679058d5cf0368a65b680e9d2459df5dd6.zip hdf5-d72832679058d5cf0368a65b680e9d2459df5dd6.tar.gz hdf5-d72832679058d5cf0368a65b680e9d2459df5dd6.tar.bz2 |
[svn-r5754] Purpose:
Code cleanup
Description:
More small tweaks with the contiguous POSIX I/O case.
Platforms tested:
IRIX64 6.5 (modi4) w/parallel
-rw-r--r-- | perform/pio_engine.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/perform/pio_engine.c b/perform/pio_engine.c index 34efd7e..b5ae4a1 100644 --- a/perform/pio_engine.c +++ b/perform/pio_engine.c @@ -740,22 +740,17 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, /* Compute file offset */ file_offset = posix_file_offset + (off_t)nbytes_xfer; - /* bytes to transfer this time */ - nbytes_toxfer = bytes_count - nbytes_xfer; - if (nbytes_toxfer > buf_size) - nbytes_toxfer = buf_size; - /* only care if seek returns error */ rc = POSIXSEEK(fd->posixfd, file_offset) < 0 ? -1 : 0; VRFY((rc==0), "POSIXSEEK"); /* check if all bytes are written */ rc = ((ssize_t)buf_size == - POSIXWRITE(fd->posixfd, buffer, nbytes_toxfer)); + POSIXWRITE(fd->posixfd, buffer, buf_size)); VRFY((rc != 0), "POSIXWRITE"); /* Advance global offset in dataset */ - nbytes_xfer+=nbytes_toxfer; + nbytes_xfer+=buf_size; } /* end if */ /* Interleaved access pattern */ else { @@ -1195,22 +1190,17 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, /* Compute file offset */ file_offset = posix_file_offset + (off_t)nbytes_xfer; - /* bytes to transfer this time */ - nbytes_toxfer = bytes_count - nbytes_xfer; - if (nbytes_toxfer > buf_size) - nbytes_toxfer = buf_size; - /* only care if seek returns error */ rc = POSIXSEEK(fd->posixfd, file_offset) < 0 ? -1 : 0; VRFY((rc==0), "POSIXSEEK"); /* check if all bytes are written */ rc = ((ssize_t)buf_size == - POSIXREAD(fd->posixfd, buffer, nbytes_toxfer)); + POSIXREAD(fd->posixfd, buffer, buf_size)); VRFY((rc != 0), "POSIXREAD"); /* Advance global offset in dataset */ - nbytes_xfer+=nbytes_toxfer; + nbytes_xfer+=buf_size; } /* end if */ /* Interleaved access pattern */ else { |