summaryrefslogtreecommitdiffstats
path: root/xlators/storage
diff options
context:
space:
mode:
authorKaleb S KEITHLEY <kkeithle@redhat.com>2015-12-07 10:22:05 -0500
committerNiels de Vos <ndevos@redhat.com>2015-12-22 09:11:30 -0800
commit76f1680a2de05420934e131f934f3895fbe50db8 (patch)
tree54d7234fa2bef0f9adb43a15ef65db112b0b1ca4 /xlators/storage
parent439de31320315872d988720991e9baaead8712db (diff)
core: add preadv, pwritev, pread, pwrite syscall wrappers
add additional system calls plus pick up a couple missed unwrapped system calls that seem to have slipped into the master branch. Change-Id: If268ccd5e9a139ac3ffd38293c67cd2f62ea5b58 BUG: 1289258 Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/12895 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/storage')
-rw-r--r--xlators/storage/bd/src/bd.c10
-rw-r--r--xlators/storage/posix/src/posix.c8
2 files changed, 9 insertions, 9 deletions
diff --git a/xlators/storage/bd/src/bd.c b/xlators/storage/bd/src/bd.c
index 9599f4acbd5..115b01d4ea6 100644
--- a/xlators/storage/bd/src/bd.c
+++ b/xlators/storage/bd/src/bd.c
@@ -485,7 +485,7 @@ bd_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
goto out;
}
_fd = bd_fd->fd;
- op_ret = pread (_fd, iobuf->ptr, size, offset);
+ op_ret = sys_pread (_fd, iobuf->ptr, size, offset);
if (op_ret == -1) {
op_errno = errno;
gf_log (this->name, GF_LOG_ERROR,
@@ -1787,7 +1787,7 @@ __bd_pwritev (int fd, struct iovec *vector, int count, off_t offset,
if (!vector)
return -EFAULT;
- retval = pwritev (fd, vector, count, offset);
+ retval = sys_pwritev (fd, vector, count, offset);
if (retval == -1) {
int64_t off = offset;
gf_log (THIS->name, GF_LOG_WARNING,
@@ -1810,8 +1810,8 @@ __bd_pwritev (int fd, struct iovec *vector, int count, off_t offset,
vector[index].iov_len = bd_size - internal_offset;
no_space = 1;
}
- retval = pwritev (fd, vector[index].iov_base,
- vector[index].iov_len, internal_offset);
+ retval = sys_pwritev (fd, vector[index].iov_base,
+ vector[index].iov_len, internal_offset);
if (retval == -1) {
gf_log (THIS->name, GF_LOG_WARNING,
"base %p, length %ld, offset %ld, message %s",
@@ -2174,7 +2174,7 @@ bd_rchecksum (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
LOCK (&fd->lock);
{
- ret = pread (_fd, buf, len, offset);
+ ret = sys_pread (_fd, buf, len, offset);
if (ret < 0) {
gf_log (this->name, GF_LOG_WARNING,
"pread of %d bytes returned %d (%s)",
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index ffae66db273..a3e0aa26bf8 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -2823,7 +2823,7 @@ posix_readv (call_frame_t *frame, xlator_t *this,
}
_fd = pfd->fd;
- op_ret = pread (_fd, iobuf->ptr, size, offset);
+ op_ret = sys_pread (_fd, iobuf->ptr, size, offset);
if (op_ret == -1) {
op_errno = errno;
gf_msg (this->name, GF_LOG_ERROR, errno, P_MSG_READ_FAILED,
@@ -2889,7 +2889,7 @@ __posix_pwritev (int fd, struct iovec *vector, int count, off_t offset)
internal_off = offset;
for (idx = 0; idx < count; idx++) {
- retval = pwrite (fd, vector[idx].iov_base, vector[idx].iov_len,
+ retval = sys_pwrite (fd, vector[idx].iov_base, vector[idx].iov_len,
internal_off);
if (retval == -1) {
op_ret = -errno;
@@ -2935,7 +2935,7 @@ __posix_writev (int fd, struct iovec *vector, int count, off_t startoff,
memcpy (buf, vector[idx].iov_base, vector[idx].iov_len);
/* not sure whether writev works on O_DIRECT'd fd */
- retval = pwrite (fd, buf, vector[idx].iov_len, internal_off);
+ retval = sys_pwrite (fd, buf, vector[idx].iov_len, internal_off);
if (retval == -1) {
op_ret = -errno;
goto err;
@@ -6105,7 +6105,7 @@ posix_rchecksum (call_frame_t *frame, xlator_t *this,
if (priv->aio_capable && priv->aio_init_done)
__posix_fd_set_odirect (fd, pfd, 0, offset, len);
- bytes_read = pread (_fd, buf, len, offset);
+ bytes_read = sys_pread (_fd, buf, len, offset);
if (bytes_read < 0) {
gf_msg (this->name, GF_LOG_WARNING, errno,
P_MSG_PREAD_FAILED,