newuuid-20070612
[openafs.git] / src / venus / fs.c
index 8d9abfd..439bc78 100644 (file)
@@ -69,7 +69,7 @@ static char tspace[1024];
 static struct ubik_client *uclient;
 
 static int GetClientAddrsCmd(), SetClientAddrsCmd(), FlushMountCmd();
-static int RxStatProcCmd(), RxStatPeerCmd(), GetFidCmd();
+static int RxStatProcCmd(), RxStatPeerCmd(), GetFidCmd(), NewUuidCmd();
 
 extern char *hostutil_GetNameByINet();
 extern struct hostent *hostutil_GetHostByName();
@@ -1245,6 +1245,24 @@ FlushVolumeCmd(struct cmd_syndesc *as, char *arock)
 }
 
 static int
+NewUuidCmd(struct cmd_syndesc *as, char *arock)
+{
+    afs_int32 code;
+    struct ViceIoctl blob;
+
+    blob.in_size = 0;
+    blob.out_size = 0;
+    code = pioctl(0, VIOC_NEWUUID, &blob, 1);
+    if (code) {
+       Die(errno, 0);
+       return 1;
+    }
+
+    printf("New uuid generated.\n");
+    return 0;
+}
+
+static int
 FlushCmd(struct cmd_syndesc *as, char *arock)
 {
     afs_int32 code;
@@ -3623,6 +3641,9 @@ defect 3069
     ts = cmd_CreateSyntax("nukenfscreds", NukeNFSCredsCmd, 0, "nuke credentials for NFS client");
     cmd_AddParm(ts, "-addr", CMD_SINGLE, 0, "host name or address");
 
+    ts = cmd_CreateSyntax("newuuid", NewUuidCmd, 0,
+                         "force a new uuid");
+
     code = cmd_Dispatch(argc, argv);
     if (rxInitDone)
        rx_Finalize();