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>
27 #include <afs/afsutil.h>
29 #include <afs/afsint.h>
33 #include "viceinode.h"
35 #include "partition.h"
37 #include <afs/assert.h>
40 char *prog = "nincdec";
41 IHandle_t * GetLinkHandle(char *part, int volid);
46 printf("Usage: %s <part> <volid> <-i ino | -v vno uniq tag> <inc|dec>\n",
51 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]);
79 else if (!strcmp(av[3], "-v")) {
80 vno = (int64_t)atoi(av[i++]);
82 tag = (int64_t)atoi(av[i++]);
83 uniq = (int64_t)atoi(av[i++]);
87 printf("ino=%Lu\n", ino);
90 printf("Expected \"-i\" or \"-v\" for inode value\n");
95 if (!strcmp(incdecarg, "dec")) do_inc = 0;
96 else if (!strcmp(incdecarg, "inc")) do_inc = 1;
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 */