2 * Copyright 2000, International Business Machines Corporation and others.
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
11 * Test "inode" creation in the user space file system.
14 #include <afsconfig.h>
15 #include <afs/param.h>
26 #include <afs/afsutil.h>
28 #include <afs/afsint.h>
32 #include "viceinode.h"
34 #include "partition.h"
38 char *prog
= "nincdec";
39 IHandle_t
*GetLinkHandle(char *part
, int volid
);
45 printf("Usage: %s <part> <volid> <-i ino | -v vno uniq tag> <inc|dec>\n",
50 main(int ac
, char **av
)
72 if (!strcmp(av
[3], "-i")) {
73 code
= sscanf(av
[i
++], "%Lu", &ino
);
75 printf("Failed to get inode from %s\n", av
[4]);
78 } else if (!strcmp(av
[3], "-v")) {
79 vno
= (int64_t) atoi(av
[i
++]);
81 tag
= (int64_t) atoi(av
[i
++]);
82 uniq
= (int64_t) atoi(av
[i
++]);
86 printf("ino=%Lu\n", ino
);
88 printf("Expected \"-i\" or \"-v\" for inode value\n");
93 if (!strcmp(incdecarg
, "dec"))
95 else if (!strcmp(incdecarg
, "inc"))
98 printf("%s: Expected \"inc\" or \"dec\"\n", incdecarg
);
103 lh
= GetLinkHandle(part
, volid
);
105 printf("Failed to get link handle, exiting\n");
110 code
= namei_inc(lh
, ino
, volid
);
112 code
= namei_dec(lh
, ino
, volid
);
114 printf("namei_%s returned %d\n", do_inc
? "inc" : "dec", code
);
120 #endif /* AFS_NAMEI_ENV */