Revert "Merge pull request #2477 in HDFFV/hdf5 from pio_update to develop"

This reverts commit ba80bcaff2, reversing
changes made to 522ef0dd5c.
This commit is contained in:
Larry Knox 2020-08-18 12:51:13 -05:00
parent 18012b1d98
commit 98754591b8
4 changed files with 0 additions and 48 deletions

View File

@ -386,9 +386,7 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size)
int myerrno = errno;
time_t mytime = HDtime(NULL);
#ifndef H5_HAVE_PREADWRITE
offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR);
#endif /* H5_HAVE_PREADWRITE */
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "write to backing store failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', ptr = %p, total write size = %llu, bytes this sub-write = %llu, bytes actually written = %llu, offset = %llu", HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), ptr, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)offset);
} /* end if */
@ -912,9 +910,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
int myerrno = errno;
time_t mytime = HDtime(NULL);
#ifndef H5_HAVE_PREADWRITE
offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR);
#endif /* H5_HAVE_PREADWRITE */
HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', file->mem = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), file->mem, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)offset);
} /* end if */

View File

@ -81,10 +81,8 @@ typedef struct H5FD_log_t {
int fd; /* the unix file */
haddr_t eoa; /* end of allocated region */
haddr_t eof; /* end of file; current file size */
#ifndef H5_HAVE_PREADWRITE
haddr_t pos; /* current file I/O position */
H5FD_file_op_t op; /* last operation */
#endif /* H5_HAVE_PREADWRITE */
hbool_t ignore_disabled_file_locks;
char filename[H5FD_MAX_FILENAME_LEN]; /* Copy of file name from open operation */
#ifndef H5_HAVE_WIN32_API
@ -573,10 +571,8 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
file->fd = fd;
H5_CHECKED_ASSIGN(file->eof, haddr_t, sb.st_size, h5_stat_size_t);
#ifndef H5_HAVE_PREADWRITE
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
#endif /* H5_HAVE_PREADWRITE */
#ifdef H5_HAVE_WIN32_API
file->hFile = (HANDLE)_get_osfhandle(fd);
if(INVALID_HANDLE_VALUE == file->hFile)
@ -1284,9 +1280,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
int myerrno = errno;
time_t mytime = HDtime(NULL);
#ifndef H5_HAVE_PREADWRITE
offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR);
#endif /* H5_HAVE_PREADWRITE */
if(file->fa.flags & H5FD_LOG_LOC_READ)
HDfprintf(file->logfp, "Error! Reading: %10a-%10a (%10Zu bytes)\n", orig_addr, (orig_addr + orig_size) - 1, orig_size);
@ -1343,19 +1337,15 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
HDfprintf(file->logfp, "\n");
} /* end if */
#ifndef H5_HAVE_PREADWRITE
/* Update current position */
file->pos = addr;
file->op = OP_READ;
#endif /* H5_HAVE_PREADWRITE */
done:
if(ret_value < 0) {
#ifndef H5_HAVE_PREADWRITE
/* Reset last file I/O information */
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
#endif /* H5_HAVE_PREADWRITE */
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
@ -1499,9 +1489,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha
int myerrno = errno;
time_t mytime = HDtime(NULL);
#ifndef H5_HAVE_PREADWRITE
offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR);
#endif /* H5_HAVE_PREADWRITE */
if(file->fa.flags & H5FD_LOG_LOC_WRITE)
HDfprintf(file->logfp, "Error! Writing: %10a-%10a (%10Zu bytes)\n", orig_addr, (orig_addr + orig_size) - 1, orig_size);
@ -1553,24 +1541,17 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha
HDfprintf(file->logfp, "\n");
} /* end if */
#ifndef H5_HAVE_PREADWRITE
/* Update current position and eof */
file->pos = addr;
file->op = OP_WRITE;
if(file->pos > file->eof)
file->eof = file->pos;
#else /* H5_HAVE_PREADWRITE */
if(addr > file->eof)
file->eof = addr;
#endif /* H5_HAVE_PREADWRITE */
done:
if(ret_value < 0) {
#ifndef H5_HAVE_PREADWRITE
/* Reset last file I/O information */
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
#endif /* H5_HAVE_PREADWRITE */
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
@ -1675,11 +1656,9 @@ H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_
/* Update the eof value */
file->eof = file->eoa;
#ifndef H5_HAVE_PREADWRITE
/* Reset last file I/O information */
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
#endif /* H5_HAVE_PREADWRITE */
} /* end if */
done:

View File

@ -59,14 +59,12 @@ typedef struct H5FD_class_mpi_t {
/* Library Private Typedefs */
/****************************/
#ifndef H5_HAVE_PREADWRITE
/* File operations */
typedef enum {
OP_UNKNOWN = 0, /* Unknown last file operation */
OP_READ = 1, /* Last file I/O operation was a read */
OP_WRITE = 2 /* Last file I/O operation was a write */
} H5FD_file_op_t;
#endif /* H5_HAVE_PREADWRITE */
/* Define structure to hold initial file image and other relevant information */

View File

@ -58,10 +58,8 @@ typedef struct H5FD_sec2_t {
int fd; /* the filesystem file descriptor */
haddr_t eoa; /* end of allocated region */
haddr_t eof; /* end of file; current file size */
#ifndef H5_HAVE_PREADWRITE
haddr_t pos; /* current file I/O position */
H5FD_file_op_t op; /* last operation */
#endif /* H5_HAVE_PREADWRITE */
hbool_t ignore_disabled_file_locks;
char filename[H5FD_MAX_FILENAME_LEN]; /* Copy of file name from open operation */
#ifndef H5_HAVE_WIN32_API
@ -371,10 +369,8 @@ H5FD__sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
file->fd = fd;
H5_CHECKED_ASSIGN(file->eof, haddr_t, sb.st_size, h5_stat_size_t);
#ifndef H5_HAVE_PREADWRITE
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
#endif /* H5_HAVE_PREADWRITE */
#ifdef H5_HAVE_WIN32_API
file->hFile = (HANDLE)_get_osfhandle(fd);
if(INVALID_HANDLE_VALUE == file->hFile)
@ -752,9 +748,7 @@ H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
int myerrno = errno;
time_t mytime = HDtime(NULL);
#ifndef H5_HAVE_PREADWRITE
offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR);
#endif /* H5_HAVE_PREADWRITE */
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)offset);
} /* end if */
@ -773,19 +767,15 @@ H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
buf = (char *)buf + bytes_read;
} /* end while */
#ifndef H5_HAVE_PREADWRITE
/* Update current position */
file->pos = addr;
file->op = OP_READ;
#endif /* H5_HAVE_PREADWRITE */
done:
if(ret_value < 0) {
#ifndef H5_HAVE_PREADWRITE
/* Reset last file I/O information */
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
#endif /* H5_HAVE_PREADWRITE */
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
@ -861,9 +851,7 @@ H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN
int myerrno = errno;
time_t mytime = HDtime(NULL);
#ifndef H5_HAVE_PREADWRITE
offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR);
#endif /* H5_HAVE_PREADWRITE */
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total write size = %llu, bytes this sub-write = %llu, bytes actually written = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)offset);
} /* end if */
@ -876,24 +864,17 @@ H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN
buf = (const char *)buf + bytes_wrote;
} /* end while */
#ifndef H5_HAVE_PREADWRITE
/* Update current position and eof */
file->pos = addr;
file->op = OP_WRITE;
if(file->pos > file->eof)
file->eof = file->pos;
#else /* H5_HAVE_PREADWRITE */
if(addr > file->eof)
file->eof = addr;
#endif /* H5_HAVE_PREADWRITE */
done:
if(ret_value < 0) {
#ifndef H5_HAVE_PREADWRITE
/* Reset last file I/O information */
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
#endif /* H5_HAVE_PREADWRITE */
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
@ -959,11 +940,9 @@ H5FD__sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR
/* Update the eof value */
file->eof = file->eoa;
#ifndef H5_HAVE_PREADWRITE
/* Reset last file I/O information */
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
#endif /* H5_HAVE_PREADWRITE */
} /* end if */
done: