]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-namei_mapper-20060731
authorDerrick Brashear <shadow@dementia.org>
Mon, 31 Jul 2006 17:50:52 +0000 (17:50 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 31 Jul 2006 17:50:52 +0000 (17:50 +0000)
add chaskiel's namei mapping tool to cvs and make a rule to build it

(cherry picked from commit 8c4496602badc1b0aa2642e061a720d4d1f108b8)

src/vol/Makefile.in
src/vol/namei_map.c [new file with mode: 0644]

index 114a3049971b6fda9258448b985054756af2a9ea..081c646d55d0a21bca003014aac592d7b6feaf4e 100644 (file)
@@ -163,6 +163,9 @@ gi: ${TOP_LIBDIR}/libsys.a
                        ${CC} ${LDFLAGS} -o gi gi.o ${TOP_LIBDIR}/libsys.a;; \
         esac
 
+namei_map: ${TOP_LIBDIR}/libsys.a namei_map.o
+       ${CC} ${CFLAGS} -o namei_map namei_map.o ${TOP_LIBDIR}/libafsutil.a ${LIBS} ${XLIBS}
+
 volinfo: vol-info.o physio.o ihandle.o ${LIBS}
        ${CC} ${CFLAGS} -o volinfo vol-info.o physio.o \
                ihandle.o ${LIBS} ${XLIBS}
diff --git a/src/vol/namei_map.c b/src/vol/namei_map.c
new file mode 100644 (file)
index 0000000..8b24c6f
--- /dev/null
@@ -0,0 +1,20 @@
+#include <sys/types.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <afs/param.h>
+#include <afs/afsutil.h>
+
+int main(int argc, char **argv) {
+  lb64_string_t tmp;
+
+  unsigned long vol;
+  if (argc < 2) { fprintf(stderr, "Usage: nametodir vol\n"); exit(1); }
+  vol=strtoul(argv[1], NULL, 0);
+  (void)int32_to_flipbase64(tmp, (int64_t) (vol & 0xff));
+  printf("Component is %s\n", tmp);
+  (void)int32_to_flipbase64(tmp, (int64_t) vol);
+  printf("Component is %s\n", tmp);
+
+  exit(0);
+}