diff options
author | Shehjar Tikoo <shehjart@zresearch.com> | 2009-05-05 15:59:47 +0530 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-05-05 17:43:25 +0530 |
commit | 61201d40bc22f1299bc49202433664664ec23ce6 (patch) | |
tree | e84e606ca42f92cd6d415918774eb16567aa3823 /booster | |
parent | f0bef18b788c8beadc4131c5a6534761857c7f46 (diff) |
booster: Clean up read
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'booster')
-rw-r--r-- | booster/src/booster.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c index dd157f78a..c0f3b0046 100644 --- a/booster/src/booster.c +++ b/booster/src/booster.c @@ -742,27 +742,13 @@ read (int fd, void *buf, size_t count) glfs_fd = booster_get_glfs_fd (booster_glfs_fdtable, fd); if (!glfs_fd) { - ret = real_read (fd, buf, 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_read (glfs_fd, buf, count); - } - } else { + if (real_read == NULL) { + errno = ENOSYS; ret = -1; - } - - if (ret == -1) { + } else ret = real_read (fd, buf, count); - } - - if (ret > 0 && ((int64_t) offset) >= 0) { - real_lseek64 (fd, ret + offset, SEEK_SET); - } - + } else { + ret = glusterfs_read (glfs_fd, buf, count); booster_put_glfs_fd (glfs_fd); } |