summaryrefslogtreecommitdiffstats
path: root/booster
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-05 16:00:20 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 17:44:15 +0530
commit8cacf5455bc97e84f62605df60a6ae5f66b61a1c (patch)
tree6f7081139553fd3c80cf6c6b01d004cf2f6d4644 /booster
parent0c86f9686f2c91ef8838972ad038ba0c587cd09d (diff)
booster: Clean-up writev
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'booster')
-rw-r--r--booster/src/booster.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index ec726178ecc..418c77c4efc 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -824,29 +824,13 @@ writev (int fd, const struct iovec *vector, int count)
glfs_fd = booster_get_glfs_fd (booster_glfs_fdtable, fd);
if (!glfs_fd) {
- ret = real_writev (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_writev (glfs_fd, vector, count);
- }
- } else {
+ if (real_writev == NULL) {
+ errno = ENOSYS;
ret = -1;
- }
-
-/* ret = glusterfs_writev (glfs_fd, vector, count); */
- if (ret == -1) {
+ } else
ret = real_writev (fd, vector, count);
- }
-
- if (ret > 0 && ((int64_t)offset) >= 0) {
- real_lseek64 (fd, offset + ret, SEEK_SET);
- }
-
+ } else {
+ ret = glusterfs_writev (glfs_fd, vector, count);
booster_put_glfs_fd (glfs_fd);
}