libglusterfs/syncop: do not rely on synctask set in makecontext

Across glibc implementations, interpretation of argc/argv passed
to makecontext() is different. This patch does away with dependence
on such arguments passed to makecontext(). Instead,synctask reference
is retrieved from pthread_getspecific().

Change-Id: Ie01feaa0b7d430f8782c2f6805ccdf8026e401f4
BUG: 3636
Reviewed-on: http://review.gluster.com/547
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
This commit is contained in:
Raghavendra Bhat 2011-10-01 19:20:28 +05:30 committed by Vijay Bellur
parent 9ef8eabae2
commit 0db88567b9

View File

@ -97,10 +97,15 @@ synctask_wake (struct synctask *task)
void
synctask_wrap (struct synctask *task)
synctask_wrap (struct synctask *old_task)
{
int ret;
struct synctask *task = NULL;
/* Do not trust the pointer received. It may be
wrong and can lead to crashes. */
task = synctask_get ();
ret = task->syncfn (task->opaque);
task->synccbk (ret, task->frame, task->opaque);