summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/syncop.h
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/syncop.h')
-rw-r--r--libglusterfs/src/syncop.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h
index 9344d7067..004336d4c 100644
--- a/libglusterfs/src/syncop.h
+++ b/libglusterfs/src/syncop.h
@@ -196,7 +196,7 @@ struct syncargs {
if (task) \
frame = task->opframe; \
else \
- frame = create_frame (THIS, THIS->ctx->pool); \
+ frame = syncop_create_frame (THIS); \
if (task) { \
frame->root->uid = task->uid; \
frame->root->gid = task->gid; \
@@ -234,6 +234,23 @@ int synctask_setid (struct synctask *task, uid_t uid, gid_t gid);
#define SYNCTASK_SETID(uid, gid) synctask_setid (synctask_get(), uid, gid);
+static inline call_frame_t *
+syncop_create_frame (xlator_t *this)
+{
+ call_frame_t *frame = NULL;
+
+ frame = create_frame (this, this->ctx->pool);
+ if (!frame)
+ return NULL;
+
+ frame->root->pid = getpid();
+ frame->root->uid = geteuid ();
+ frame->root->gid = getegid ();
+ frame->root->ngrps = getgroups (GF_MAX_AUX_GROUPS, frame->root->groups);
+
+ return frame;
+}
+
int synclock_init (synclock_t *lock);
int synclock_destory (synclock_t *lock);
int synclock_lock (synclock_t *lock);