summaryrefslogtreecommitdiffstats
path: root/booster
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-05 15:59:55 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 17:43:55 +0530
commita35a80b79702d3a81a9d62fc200ae61c6ec67b74 (patch)
tree9b7c2d4da174bcf1461366d13e1ae9db2262dbb3 /booster
parent61201d40bc22f1299bc49202433664664ec23ce6 (diff)
booster: Clean-up readv
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'booster')
-rw-r--r--booster/src/booster.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index c0f3b0046..6b842408e 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -764,24 +764,13 @@ readv (int fd, const struct iovec *vector, int count)
glfs_fd = booster_get_glfs_fd (booster_glfs_fdtable, fd);
if (!glfs_fd) {
- ret = real_readv (fd, vector, count);
- } else {
- uint64_t offset = 0;
- offset = real_lseek64 (fd, 0L, SEEK_CUR);
- if ((int64_t)offset != -1) {
- ret = glusterfs_lseek (glfs_fd, offset, SEEK_SET);
- if (ret != -1) {
- ret = glusterfs_readv (glfs_fd, vector, count);
- }
- } else {
+ if (real_readv == NULL) {
+ errno = ENOSYS;
ret = -1;
- }
-
+ } else
+ ret = real_readv (fd, vector, count);
+ } else {
ret = glusterfs_readv (glfs_fd, vector, count);
- if (ret > 0) {
- real_lseek64 (fd, offset + ret, SEEK_SET);
- }
-
booster_put_glfs_fd (glfs_fd);
}