summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-05 16:00:27 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 17:44:19 +0530
commit24b360d865dbf344f8369e656d282739f07c18e8 (patch)
treef47066dcbe2af37bb498244779b2ce61eb356c3d
parent8cacf5455bc97e84f62605df60a6ae5f66b61a1c (diff)
booster: Clean-up write
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-rw-r--r--booster/src/booster.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index 418c77c4efc..48603c1fa63 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -789,26 +789,13 @@ write (int fd, const void *buf, size_t count)
glfs_fd = booster_get_glfs_fd (booster_glfs_fdtable, fd);
if (!glfs_fd) {
- ret = real_write (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_write (glfs_fd, buf, count);
- }
- } else {
+ if (real_write == NULL) {
+ errno = ENOSYS;
ret = -1;
- }
-
- if (ret == -1) {
+ } else
ret = real_write (fd, buf, count);
- }
-
- if (ret > 0 && ((int64_t) offset) >= 0) {
- real_lseek64 (fd, offset + ret, SEEK_SET);
- }
+ } else {
+ ret = glusterfs_write (glfs_fd, buf, count);
booster_put_glfs_fd (glfs_fd);
}