summaryrefslogtreecommitdiffstats
path: root/src/cmd/venti/fmtisect.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-01-18 05:25:09 +0000
committerrsc <devnull@localhost>2005-01-18 05:25:09 +0000
commitadbb83845c5d3cb02343d7613cfb8385aa909909 (patch)
tree6f2b79ae89f59d014cdbfb6a5bf5ded94bf775fa /src/cmd/venti/fmtisect.c
parentd338028eeb45434dab651466dcd664091517e087 (diff)
downloadplan9port-adbb83845c5d3cb02343d7613cfb8385aa909909.tar.gz
plan9port-adbb83845c5d3cb02343d7613cfb8385aa909909.zip
remove venti for now
Diffstat (limited to 'src/cmd/venti/fmtisect.c')
-rw-r--r--src/cmd/venti/fmtisect.c69
1 files changed, 0 insertions, 69 deletions
diff --git a/src/cmd/venti/fmtisect.c b/src/cmd/venti/fmtisect.c
deleted file mode 100644
index 77c92967..00000000
--- a/src/cmd/venti/fmtisect.c
+++ /dev/null
@@ -1,69 +0,0 @@
-#include "stdinc.h"
-#include "dat.h"
-#include "fns.h"
-
-void
-usage(void)
-{
- fprint(2, "usage: fmtisect [-Z] [-b blocksize] name file\n");
- threadexitsall(0);
-}
-
-void
-threadmain(int argc, char *argv[])
-{
- ISect *is;
- Part *part;
- char *file, *name;
- int blocksize, setsize, zero;
-
- fmtinstall('V', vtscorefmt);
- statsinit();
-
- blocksize = 8 * 1024;
- setsize = 64 * 1024;
- zero = 1;
- ARGBEGIN{
- case 'b':
- blocksize = unittoull(ARGF());
- if(blocksize == ~0)
- usage();
- if(blocksize > MaxDiskBlock){
- fprint(2, "block size too large, max %d\n", MaxDiskBlock);
- threadexitsall("usage");
- }
- break;
- case 'Z':
- zero = 0;
- break;
- default:
- usage();
- break;
- }ARGEND
-
- if(argc != 2)
- usage();
-
- name = argv[0];
- file = argv[1];
-
- if(nameok(name) < 0)
- sysfatal("illegal name %s", name);
-
- part = initpart(file, 0);
- if(part == nil)
- sysfatal("can't open partition %s: %r", file);
-
- if(zero)
- zeropart(part, blocksize);
-
- fprint(2, "configuring index section %s with space for index config bytes=%d\n", name, setsize);
- is = newisect(part, name, blocksize, setsize);
- if(is == nil)
- sysfatal("can't initialize new index: %r");
-
- if(wbisect(is) < 0)
- fprint(2, "can't write back index section header for %s: %r\n", file);
-
- threadexitsall(0);
-}