Remove the RCSID macro
[openafs.git] / src / vol / test / nicreate.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 /* nicreate
11  * Test "inode" creation in the user space file system.
12  */
13
14 #include <afsconfig.h>
15 #include <afs/param.h>
16
17
18 #ifdef AFS_NAMEI_ENV
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <errno.h>
22 #include <fcntl.h>
23 #include <fcntl.h>
24 #include <sys/stat.h>
25 #include <lock.h>
26 #include <afs/afsutil.h>
27 #include "nfs.h"
28 #include <afs/afsint.h>
29 #include "ihandle.h"
30 #include "vnode.h"
31 #include "volume.h"
32 #include "viceinode.h"
33 #include "voldefs.h"
34 #include "partition.h"
35 #include <dirent.h>
36 #include <afs/assert.h>
37
38
39 char *prog = "nicreate";
40 IHandle_t *GetLinkHandle(char *part, int volid);
41
42 void
43 Usage(void)
44 {
45     printf("Usage: %s partition RWvolid p1 p2 p3 p4\n", prog);
46     exit(1);
47 }
48
49 main(int ac, char **av)
50 {
51     char *part;
52     int volid;
53     int p1, p2, p3, p4;
54     IHandle_t lh, *lhp;
55     Inode ino;
56
57     if (ac != 7)
58         Usage();
59
60     part = av[1];
61     volid = atoi(av[2]);
62     p1 = atoi(av[3]);
63     p2 = atoi(av[4]);
64     p3 = atoi(av[5]);
65     p4 = atoi(av[6]);
66
67     if (p2 == -1 && p3 == VI_LINKTABLE)
68         lhp = NULL;
69     else {
70         lhp = GetLinkHandle(part, volid);
71         if (!lhp) {
72             perror("Getting link handle.\n");
73             exit(1);
74         }
75     }
76
77     ino = namei_icreate(lhp, part, p1, p2, p3, p4);
78     if (!VALID_INO(ino)) {
79         perror("namei_icreate");
80     } else {
81         printf("Returned inode %s\n", PrintInode(NULL, ino));
82     }
83 }
84
85 #endif /* AFS_NAMEI_ENV */