diff options
author | Anand Avati <avati@redhat.com> | 2012-07-11 16:23:44 -0700 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-07-13 21:10:48 -0700 |
commit | ab44480749a289aaaf78dad4123ef16d1872ea1b (patch) | |
tree | ede3a3aa3f248f9a3bd62b0ab3bda701cab3225d /libglusterfs/src/syncop.c | |
parent | aabe0c96cac4d219015a2fe085a7f89ebb9744d1 (diff) |
syncop: accomodate non-syncenv calls
Use mutex/cond and support syncop_XXXXXX() calls in non-syncenv
environments. syncenv environments continue to use swapcontext
based soft context switches. In non-syncenv environments this
blocks the caller thread on the mutex. The intended use case is
in libgfapi where it is expected to block the caller thread while
performing synchronous calls.
Change-Id: Id6470c99bdc2fe4b7610372139f7fa99b2da400b
BUG: 839950
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.com/3662
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'libglusterfs/src/syncop.c')
-rw-r--r-- | libglusterfs/src/syncop.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index 491f6ae1598..7b34c631d8c 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -1015,14 +1015,15 @@ syncop_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } int -syncop_writev (xlator_t *subvol, fd_t *fd, struct iovec *vector, +syncop_writev (xlator_t *subvol, fd_t *fd, const struct iovec *vector, int32_t count, off_t offset, struct iobref *iobref, uint32_t flags) { struct syncargs args = {0, }; SYNCOP (subvol, (&args), syncop_writev_cbk, subvol->fops->writev, - fd, vector, count, offset, flags, iobref, NULL); + fd, (struct iovec *) vector, count, offset, flags, iobref, + NULL); errno = args.op_errno; return args.op_ret; |