From ab44480749a289aaaf78dad4123ef16d1872ea1b Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Wed, 11 Jul 2012 16:23:44 -0700 Subject: 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 Reviewed-on: http://review.gluster.com/3662 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- libglusterfs/src/syncop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libglusterfs/src/syncop.c') diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index 491f6ae15..7b34c631d 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; -- cgit