changeset 792:e1086d53181a

common: add owner & group arguments to fscall_create Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Thu, 02 Apr 2020 14:44:23 -0400
parents b12a1336b972
children 55b8061a7cf9
files src/common/fscall.c src/common/include/nomad/fscall.h src/fs/nomadfs.c
diffstat 3 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/common/fscall.c	Thu Apr 02 14:42:22 2020 -0400
+++ b/src/common/fscall.c	Thu Apr 02 14:44:23 2020 -0400
@@ -265,7 +265,8 @@
 }
 
 int fscall_create(struct fscall_state *state, const uint32_t parent_handle,
-		  const char *name, const uint16_t mode, struct noid *child)
+		  const char *name, const uint32_t owner, const uint32_t group,
+		  const uint16_t mode, struct noid *child)
 {
 	struct rpc_create_req create_req;
 	struct rpc_create_res create_res;
@@ -273,8 +274,8 @@
 
 	create_req.parent = parent_handle;
 	create_req.path = (char *) name;
-	create_req.owner = 0;
-	create_req.group = 0;
+	create_req.owner = owner;
+	create_req.group = group;
 	create_req.mode = mode;
 
 	ret = __fscall(state->sock, NRPC_CREATE,
--- a/src/common/include/nomad/fscall.h	Thu Apr 02 14:42:22 2020 -0400
+++ b/src/common/include/nomad/fscall.h	Thu Apr 02 14:44:23 2020 -0400
@@ -58,7 +58,8 @@
 			 const uint32_t parent_handle, const char *name,
 			 struct noid *child);
 extern int fscall_create(struct fscall_state *state, const uint32_t parent_handle,
-			 const char *name, const uint16_t mode, struct noid *child);
+			 const char *name, const uint32_t owner,
+			 const uint32_t group, uint16_t mode, struct noid *child);
 extern int fscall_unlink(struct fscall_state *state, const uint32_t parent_handle,
 			 const char *name, const struct noid *desired);
 extern int fscall_read(struct fscall_state *state, const uint32_t handle,
--- a/src/fs/nomadfs.c	Thu Apr 02 14:42:22 2020 -0400
+++ b/src/fs/nomadfs.c	Thu Apr 02 14:44:23 2020 -0400
@@ -103,7 +103,7 @@
 	if (ret)
 		return ret;
 
-	ret = fscall_create(&state, dir_ohandle, name, mode, child_oid);
+	ret = fscall_create(&state, dir_ohandle, name, 0, 0, mode, child_oid);
 	if (ret)
 		goto err;