From 08d502c3b05c6f7831bb4cc764bd458b405a99b1 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Thu, 14 Mar 2019 18:41:11 +0530 Subject: gfapi: add function to set client-pid This api offers the ability to set the pid of a client to a particular value, identical to how gluster fuse clients provide the --client-pid option. This is an internal API to be used by gluster processes only. See https://lists.gluster.org/pipermail/gluster-devel/2019-March/055925.html for more details. Currently glfsheal is the only proposed consumer. updates: bz#1689250 Change-Id: I0620be2127d79d69cdd57cffb29bba44e6e5da1f Signed-off-by: Ravishankar N --- api/src/glfs.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'api/src/glfs.c') diff --git a/api/src/glfs.c b/api/src/glfs.c index b741f6e8b46..f4a8e082f51 100644 --- a/api/src/glfs.c +++ b/api/src/glfs.c @@ -1461,6 +1461,21 @@ invalid_fs: GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_ipc, 3.12.0); +int +priv_glfs_setfspid(struct glfs *fs, pid_t pid) +{ + cmd_args_t *cmd_args = NULL; + int ret = 0; + + cmd_args = &fs->ctx->cmd_args; + cmd_args->client_pid = pid; + cmd_args->client_pid_set = 1; + ret = syncopctx_setfspid(&pid); + + return ret; +} +GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_setfspid, 6.1); + void pub_glfs_free(void *ptr) { -- cgit