summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/syncop.h
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2014-03-04 14:42:40 +0000
committerJeff Darcy <jdarcy@redhat.com>2014-03-04 14:42:40 +0000
commit0de07f4189cbd191a765c60ed3d7c72f72112e68 (patch)
tree83781a0df06c9110c6f3db12caad23ea00832b53 /libglusterfs/src/syncop.h
parentc28972ea53cc7cdb91c7aac01754dd7f0b66e1a7 (diff)
parent9f45d0f6212d6d5c96dafc4aba73d9d12b39c3d6 (diff)
Merge branch 'upstream' into merge
Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Conflicts: api/src/glfs-fops.c libglusterfs/src/syncop.c libglusterfs/src/syncop.h Change-Id: I8c3fa7a20fb167d9e6bc2749e177c0c8b366827b
Diffstat (limited to 'libglusterfs/src/syncop.h')
-rw-r--r--libglusterfs/src/syncop.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h
index 87985588f..fb867a108 100644
--- a/libglusterfs/src/syncop.h
+++ b/libglusterfs/src/syncop.h
@@ -31,6 +31,7 @@
#define SYNCOPCTX_UID 0x00000001
#define SYNCOPCTX_GID 0x00000002
#define SYNCOPCTX_GROUPS 0x00000004
+#define SYNCOPCTX_PID 0x00000008
struct synctask;
struct syncproc;
@@ -164,6 +165,7 @@ struct syncopctx {
int grpsize;
int ngrps;
gid_t *groups;
+ pid_t pid;
};
#define __yawn(args) do { \
@@ -260,6 +262,7 @@ int synctask_setid (struct synctask *task, uid_t uid, gid_t gid);
int syncopctx_setfsuid (void *uid);
int syncopctx_setfsgid (void *gid);
int syncopctx_setfsgroups (int count, const void *groups);
+int syncopctx_setfspid (void *pid);
static inline call_frame_t *
syncop_create_frame (xlator_t *this)
@@ -272,9 +275,13 @@ syncop_create_frame (xlator_t *this)
if (!frame)
return NULL;
- frame->root->pid = getpid ();
-
opctx = syncopctx_getctx ();
+
+ if (opctx && (opctx->valid & SYNCOPCTX_PID))
+ frame->root->pid = opctx->pid;
+ else
+ frame->root->pid = getpid ();
+
if (opctx && (opctx->valid & SYNCOPCTX_UID))
frame->root->uid = opctx->uid;
else
@@ -372,9 +379,11 @@ int syncop_listxattr (xlator_t *subvol, loc_t *loc, dict_t **dict);
int syncop_getxattr (xlator_t *xl, loc_t *loc, dict_t **dict, const char *key);
int syncop_fgetxattr (xlator_t *xl, fd_t *fd, dict_t **dict, const char *key);
int syncop_fgetxattr_with_xdata (xlator_t *xl, fd_t *fd, dict_t **dict, const char *key, dict_t *extra);
-int syncop_removexattr (xlator_t *subvol, loc_t *loc, const char *name);
+int syncop_removexattr (xlator_t *subvol, loc_t *loc, const char *name,
+ dict_t *xdata);
int syncop_removexattr_with_xdata (xlator_t *subvol, loc_t *loc, const char *name, dict_t *dict);
-int syncop_fremovexattr (xlator_t *subvol, fd_t *fd, const char *name);
+int syncop_fremovexattr (xlator_t *subvol, fd_t *fd, const char *name,
+ dict_t *xdata);
int syncop_fremovexattr_with_xdata (xlator_t *subvol, fd_t *fd, const char *name, dict_t *dict);
int syncop_create (xlator_t *subvol, loc_t *loc, int32_t flags, mode_t mode,