changeset 250:89bf2ad7bc4f

rename REMOVE to UNLINK Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Fri, 15 Apr 2016 20:03:19 -0400
parents c7d222e7cfcd
children f4d8349f3ba4
files docs/fs-protocol.md src/client/cmd_dir.c src/client/cmds.c src/client/cmds.h src/common/include/nomad/rpc_fs.h src/common/rpc_fs.x src/objstore/include/nomad/objstore.h src/objstore/include/nomad/objstore_impl.h src/objstore/mem/obj.c src/objstore/obj.c src/objstore/vg.c
diffstat 11 files changed, 26 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/docs/fs-protocol.md	Fri Apr 15 18:35:36 2016 -0400
+++ b/docs/fs-protocol.md	Fri Apr 15 20:03:19 2016 -0400
@@ -131,7 +131,7 @@
 Fails with `EPROTO` if the client hasn't gotten a successful LOGIN.
 
 
-REMOVE (0x0005)
+UNLINK (0x0005)
 ===============
 
 Given a directory open file handle and a path component (string), remove the
--- a/src/client/cmd_dir.c	Fri Apr 15 18:35:36 2016 -0400
+++ b/src/client/cmd_dir.c	Fri Apr 15 20:03:19 2016 -0400
@@ -53,14 +53,14 @@
 	return objstore_lookup(conn->vg, oh->cookie, req->path, &res->child);
 }
 
-int cmd_remove(struct fsconn *conn, union cmd *cmd)
+int cmd_unlink(struct fsconn *conn, union cmd *cmd)
 {
-	struct rpc_remove_req *req = &cmd->remove.req;
+	struct rpc_unlink_req *req = &cmd->unlink.req;
 	struct ohandle *oh;
 
 	oh = ohandle_find(conn, req->parent);
 	if (!oh)
 		return -EINVAL;
 
-	return objstore_remove(conn->vg, oh->cookie, req->path);
+	return objstore_unlink(conn->vg, oh->cookie, req->path);
 }
--- a/src/client/cmds.c	Fri Apr 15 18:35:36 2016 -0400
+++ b/src/client/cmds.c	Fri Apr 15 20:03:19 2016 -0400
@@ -81,8 +81,8 @@
 	CMD        (NRPC_NOP,           nop,           cmd_nop,         false),
 	CMD_ARG_RET(NRPC_OPEN,          open,          cmd_open,        true),
 	CMD_ARG_RET(NRPC_READ,          read,          cmd_read,        true),
-	CMD_ARG    (NRPC_REMOVE,        remove,        cmd_remove,      true),
 	CMD_ARG_RET(NRPC_STAT,          stat,          cmd_stat,        true),
+	CMD_ARG    (NRPC_UNLINK,        unlink,        cmd_unlink,      true),
 	CMD_ARG    (NRPC_WRITE,         write,         cmd_write,       true),
 };
 
--- a/src/client/cmds.h	Fri Apr 15 18:35:36 2016 -0400
+++ b/src/client/cmds.h	Fri Apr 15 20:03:19 2016 -0400
@@ -67,17 +67,17 @@
 		struct rpc_read_res res;
 	} read;
 
-	/* remove */
-	struct {
-		struct rpc_remove_req req;
-	} remove;
-
 	/* stat */
 	struct {
 		struct rpc_stat_req req;
 		struct rpc_stat_res res;
 	} stat;
 
+	/* unlink */
+	struct {
+		struct rpc_unlink_req req;
+	} unlink;
+
 	/* write */
 	struct {
 		struct rpc_write_req req;
@@ -101,8 +101,8 @@
 extern int cmd_nop(struct fsconn *conn, union cmd *cmd);
 extern int cmd_open(struct fsconn *conn, union cmd *cmd);
 extern int cmd_read(struct fsconn *conn, union cmd *cmd);
-extern int cmd_remove(struct fsconn *conn, union cmd *cmd);
 extern int cmd_stat(struct fsconn *conn, union cmd *cmd);
+extern int cmd_unlink(struct fsconn *conn, union cmd *cmd);
 extern int cmd_write(struct fsconn *conn, union cmd *cmd);
 
 #endif
--- a/src/common/include/nomad/rpc_fs.h	Fri Apr 15 18:35:36 2016 -0400
+++ b/src/common/include/nomad/rpc_fs.h	Fri Apr 15 20:03:19 2016 -0400
@@ -31,7 +31,7 @@
 #define NRPC_STAT	0x0002
 #define NRPC_LOOKUP	0x0003
 #define NRPC_CREATE	0x0004
-#define NRPC_REMOVE	0x0005
+#define NRPC_UNLINK	0x0005
 #define NRPC_OPEN	0x0006
 #define NRPC_CLOSE	0x0007
 #define NRPC_READ	0x0008
--- a/src/common/rpc_fs.x	Fri Apr 15 18:35:36 2016 -0400
+++ b/src/common/rpc_fs.x	Fri Apr 15 20:03:19 2016 -0400
@@ -75,8 +75,8 @@
 	struct noid	oid;
 };
 
-%/***** REMOVE *****/
-struct rpc_remove_req {
+%/***** UNLINK *****/
+struct rpc_unlink_req {
 	HANDLE(parent);
 	string		path<>;
 };
--- a/src/objstore/include/nomad/objstore.h	Fri Apr 15 18:35:36 2016 -0400
+++ b/src/objstore/include/nomad/objstore.h	Fri Apr 15 20:03:19 2016 -0400
@@ -91,7 +91,7 @@
 			   const char *name, struct noid *child);
 extern int objstore_create(struct objstore *vg, void *dircookie,
 			   const char *name, uint16_t mode, struct noid *child);
-extern int objstore_remove(struct objstore *vg, void *dircookie,
+extern int objstore_unlink(struct objstore *vg, void *dircookie,
 			   const char *name);
 
 #endif
--- a/src/objstore/include/nomad/objstore_impl.h	Fri Apr 15 18:35:36 2016 -0400
+++ b/src/objstore/include/nomad/objstore_impl.h	Fri Apr 15 20:03:19 2016 -0400
@@ -61,7 +61,7 @@
 		      const char *name, struct noid *child);
 	int (*create)(struct objstore_vol *vol, void *dircookie,
 		      const char *name, uint16_t mode, struct noid *child);
-	int (*remove)(struct objstore_vol *vol, void *dircookie,
+	int (*unlink)(struct objstore_vol *vol, void *dircookie,
 		      const char *name);
 };
 
@@ -92,7 +92,7 @@
 		      const char *name, struct noid *child);
 extern int vol_create(struct objstore_vol *vol, void *dircookie,
 		      const char *name, uint16_t mode, struct noid *child);
-extern int vol_remove(struct objstore_vol *vol, void *dircookie,
+extern int vol_unlink(struct objstore_vol *vol, void *dircookie,
 		      const char *name);
 
 #endif
--- a/src/objstore/mem/obj.c	Fri Apr 15 18:35:36 2016 -0400
+++ b/src/objstore/mem/obj.c	Fri Apr 15 20:03:19 2016 -0400
@@ -550,7 +550,7 @@
 	return ret;
 }
 
-static int __obj_remove(struct memstore *store, struct memver *dir,
+static int __obj_unlink(struct memstore *store, struct memver *dir,
 			struct memdentry *dentry)
 {
 	struct memobj *child;
@@ -590,7 +590,7 @@
 	return 0;
 }
 
-static int mem_obj_remove(struct objstore_vol *vol, void *dircookie,
+static int mem_obj_unlink(struct objstore_vol *vol, void *dircookie,
 			  const char *name)
 {
 	const struct memdentry key = {
@@ -620,7 +620,7 @@
 	}
 
 	/* ok, we got the dentry - remove it */
-	ret = __obj_remove(ms, dirver, dentry);
+	ret = __obj_unlink(ms, dirver, dentry);
 
 err_unlock:
 	mxunlock(&dirver->obj->lock);
@@ -636,5 +636,5 @@
 	.write   = mem_obj_write,
 	.lookup  = mem_obj_lookup,
 	.create  = mem_obj_create,
-	.remove  = mem_obj_remove,
+	.unlink  = mem_obj_unlink,
 };
--- a/src/objstore/obj.c	Fri Apr 15 18:35:36 2016 -0400
+++ b/src/objstore/obj.c	Fri Apr 15 20:03:19 2016 -0400
@@ -107,13 +107,13 @@
 	return vol->def->obj_ops->create(vol, dircookie, name, mode, child);
 }
 
-int vol_remove(struct objstore_vol *vol, void *dircookie, const char *name)
+int vol_unlink(struct objstore_vol *vol, void *dircookie, const char *name)
 {
 	if (!vol || !name)
 		return -EINVAL;
 
-	if (!vol->def->obj_ops || !vol->def->obj_ops->remove)
+	if (!vol->def->obj_ops || !vol->def->obj_ops->unlink)
 		return -ENOTSUP;
 
-	return vol->def->obj_ops->remove(vol, dircookie, name);
+	return vol->def->obj_ops->unlink(vol, dircookie, name);
 }
--- a/src/objstore/vg.c	Fri Apr 15 18:35:36 2016 -0400
+++ b/src/objstore/vg.c	Fri Apr 15 20:03:19 2016 -0400
@@ -283,7 +283,7 @@
 	return ret;
 }
 
-int objstore_remove(struct objstore *vg, void *dircookie, const char *name)
+int objstore_unlink(struct objstore *vg, void *dircookie, const char *name)
 {
 	struct objstore_vol *vol;
 	int ret;
@@ -297,7 +297,7 @@
 	if (!vol)
 		return -ENXIO;
 
-	ret = vol_remove(vol, dircookie, name);
+	ret = vol_unlink(vol, dircookie, name);
 
 	vol_putref(vol);