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"
36 #include <afs/afs_assert.h>
39 char *prog
= "nincdec";
40 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
)
73 if (!strcmp(av
[3], "-i")) {
74 code
= sscanf(av
[i
++], "%Lu", &ino
);
76 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
);
89 printf("Expected \"-i\" or \"-v\" for inode value\n");
94 if (!strcmp(incdecarg
, "dec"))
96 else if (!strcmp(incdecarg
, "inc"))
99 printf("%s: Expected \"inc\" or \"dec\"\n", incdecarg
);
104 lh
= GetLinkHandle(part
, volid
);
106 printf("Failed to get link handle, exiting\n");
111 code
= namei_inc(lh
, ino
, volid
);
113 code
= namei_dec(lh
, ino
, volid
);
115 printf("namei_%s returned %d\n", do_inc
? "inc" : "dec", code
);
121 #endif /* AFS_NAMEI_ENV */