changeset 812:987c34feb31b

objstore: we need device info for char and block device creation Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Sun, 05 Apr 2020 16:02:23 -0400
parents 13df67029f94
children d4abd585cced
files src/client/cmd_dir.c src/objstore/include/nomad/objstore.h src/objstore/obj_ops.c
diffstat 3 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/client/cmd_dir.c	Sun Apr 05 16:04:28 2020 -0400
+++ b/src/client/cmd_dir.c	Sun Apr 05 16:02:23 2020 -0400
@@ -37,7 +37,7 @@
 		return -EINVAL;
 
 	return objstore_create(oh->cookie, req->path, req->owner, req->group,
-			       req->mode, &res->oid);
+			       req->mode, req->dev, &res->oid);
 }
 
 int cmd_lookup(struct fsconn *conn, union cmd *cmd)
--- a/src/objstore/include/nomad/objstore.h	Sun Apr 05 16:04:28 2020 -0400
+++ b/src/objstore/include/nomad/objstore.h	Sun Apr 05 16:02:23 2020 -0400
@@ -163,7 +163,7 @@
 				   uint8_t **type);
 extern int objstore_create(struct objstore_open_obj_info *dircookie,
 			   const char *name, uint32_t owner, uint32_t group,
-			   uint16_t mode, struct noid *child);
+			   uint16_t mode, uint64_t dev, struct noid *child);
 extern int objstore_unlink(struct objstore_open_obj_info *dircookie,
 			   const char *name, const struct noid *desired);
 extern int objstore_getdent(struct objstore_open_obj_info *dircookie,
--- a/src/objstore/obj_ops.c	Sun Apr 05 16:04:28 2020 -0400
+++ b/src/objstore/obj_ops.c	Sun Apr 05 16:02:23 2020 -0400
@@ -473,7 +473,7 @@
 }
 
 int objstore_create(struct objstore_open_obj_info *diropen, const char *name,
-		    uint32_t owner, uint32_t group, uint16_t mode,
+		    uint32_t owner, uint32_t group, uint16_t mode, uint64_t dev,
 		    struct noid *child)
 {
 	struct txn txn;
@@ -495,6 +495,9 @@
 	if (_NATTR_ISNOTYPE(mode) || NATTR_ISGRAFT(mode))
 		return -EINVAL;
 
+	if (NATTR_ISBLK(mode) || NATTR_ISCHR(mode))
+		return -ENOTSUP; /* not yet supported */
+
 	MXLOCK(&dir->lock);
 
 	if (!NATTR_ISDIR(diropen->ver->attrs.mode)) {