diff options
Diffstat (limited to 'libglusterfs/src/syncop.c')
-rw-r--r-- | libglusterfs/src/syncop.c | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index 219fbc842..552a26355 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -169,6 +169,46 @@ out: return ret; } +int +syncopctx_setfspid (void *pid) +{ + struct syncopctx *opctx = NULL; + int ret = 0; + + /* In args check */ + if (!pid) { + ret = -1; + errno = EINVAL; + goto out; + } + + opctx = syncopctx_getctx (); + + /* alloc for this thread the first time */ + if (!opctx) { + opctx = GF_CALLOC (1, sizeof (*opctx), gf_common_mt_syncopctx); + if (!opctx) { + ret = -1; + goto out; + } + + ret = syncopctx_setctx (opctx); + if (ret != 0) { + GF_FREE (opctx); + opctx = NULL; + goto out; + } + } + +out: + if (opctx && pid) { + opctx->pid = *(pid_t *)pid; + opctx->valid |= SYNCOPCTX_PID; + } + + return ret; +} + static void __run (struct synctask *task) { @@ -1224,7 +1264,7 @@ syncop_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } int -syncop_removexattr (xlator_t *subvol, loc_t *loc, const char *name) +syncop_removexattr (xlator_t *subvol, loc_t *loc, const char *name, dict_t *xdata) { return(syncop_removexattr_with_xdata(subvol, loc, name, NULL)); } @@ -1259,12 +1299,12 @@ syncop_fremovexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } int -syncop_fremovexattr (xlator_t *subvol, fd_t *fd, const char *name) +syncop_fremovexattr (xlator_t *subvol, fd_t *fd, const char *name, dict_t *xdata) { struct syncargs args = {0, }; SYNCOP (subvol, (&args), syncop_fremovexattr_cbk, - subvol->fops->fremovexattr, fd, name, NULL); + subvol->fops->fremovexattr, fd, name, xdata); if (args.op_ret < 0) return -args.op_errno; |