aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vbackup
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-05-04 18:03:11 +0000
committerrsc <devnull@localhost>2006-05-04 18:03:11 +0000
commit80b4aedc11325793331a7bffb46e32ae3f9af8ac (patch)
tree3445ab17b00dfad697b44ec240da5b61ac6e1231 /src/cmd/vbackup
parent886a6f6c535f081e5d845db7ba79b16f2b68ef97 (diff)
downloadplan9port-80b4aedc11325793331a7bffb46e32ae3f9af8ac.tar.gz
plan9port-80b4aedc11325793331a7bffb46e32ae3f9af8ac.tar.bz2
plan9port-80b4aedc11325793331a7bffb46e32ae3f9af8ac.zip
ext2 fixes
Diffstat (limited to 'src/cmd/vbackup')
-rw-r--r--src/cmd/vbackup/config.c1
-rw-r--r--src/cmd/vbackup/diskftp.c7
-rw-r--r--src/cmd/vbackup/disknfs.c15
-rw-r--r--src/cmd/vbackup/vnfs.c4
4 files changed, 20 insertions, 7 deletions
diff --git a/src/cmd/vbackup/config.c b/src/cmd/vbackup/config.c
index 7d5e2d8c..1b5b404a 100644
--- a/src/cmd/vbackup/config.c
+++ b/src/cmd/vbackup/config.c
@@ -463,6 +463,7 @@ fsysconfigreaddir(Fsys *fsys, SunAuthUnix *au, Nfs3Handle *h, u32int count, u64i
ep = data+count;
while(e && p < ep){
ne.name = e->name;
+ ne.namelen = strlen(e->name);
ne.cookie = ++cookie;
ne.fileid = *(u64int*)e->sha1;
if(nfs3entrypack(p, ep, &np, &ne) < 0)
diff --git a/src/cmd/vbackup/diskftp.c b/src/cmd/vbackup/diskftp.c
index b8c26ed0..bf586624 100644
--- a/src/cmd/vbackup/diskftp.c
+++ b/src/cmd/vbackup/diskftp.c
@@ -15,7 +15,7 @@ usage(void)
fprint(2, "\tcat file\n");
fprint(2, "\tls dir\n");
fprint(2, "\tstat file\n");
- exits("usage");
+ threadexitsall("usage");
}
void
@@ -24,10 +24,10 @@ printattr(Nfs3Attr *attr)
Fmt fmt;
char buf[256];
- fmtfdinit(&fmt, 1, buf, sizeof buf);
+ fmtfdinit(&fmt, 2, buf, sizeof buf);
nfs3attrprint(&fmt, attr);
fmtfdflush(&fmt);
- print("\n");
+ fprint(2, "\n");
}
char buf[8192];
@@ -105,6 +105,7 @@ threadmain(int argc, char **argv)
if(strcmp(argv[1], "cat") == 0){
switch(attr.type){
case Nfs3FileReg:
+ case Nfs3FileDir:
offset = 0;
for(;;){
x(fsysreadfile(fsys, &au, &h, sizeof buf, offset, &data, &n, &eof));
diff --git a/src/cmd/vbackup/disknfs.c b/src/cmd/vbackup/disknfs.c
index edbcf3e4..8ad4ffb7 100644
--- a/src/cmd/vbackup/disknfs.c
+++ b/src/cmd/vbackup/disknfs.c
@@ -39,6 +39,14 @@ threadmain(int argc, char **argv)
addr = "*";
ARGBEGIN{
+ default:
+ usage();
+ case 'L':
+ if(srv->localonly == 0)
+ srv->localonly = 1;
+ else
+ srv->localparanoia = 1;
+ break;
case 'R':
srv->chatty++;
break;
@@ -70,14 +78,15 @@ threadmain(int argc, char **argv)
if(sunsrvudp(srv, addr) < 0)
sysfatal("starting server: %r");
- sunsrvprog(srv, &nfs3prog, nfs3chan);
- sunsrvprog(srv, &nfsmount3prog, mountchan);
sunsrvthreadcreate(srv, nfs3proc, nfs3chan);
sunsrvthreadcreate(srv, mount3proc, mountchan);
+ sunsrvprog(srv, &nfs3prog, nfs3chan);
+ sunsrvprog(srv, &nfsmount3prog, mountchan);
fsgetroot(&h);
- print("mountbackups -h %.*H %s /mountpoint\n", h.len, h.h, addr);
+
+ print("vmount0 -h %.*H %s /mnt\n", h.len, h.h, addr);
threadexits(nil);
}
diff --git a/src/cmd/vbackup/vnfs.c b/src/cmd/vbackup/vnfs.c
index 1de100cb..019f7f72 100644
--- a/src/cmd/vbackup/vnfs.c
+++ b/src/cmd/vbackup/vnfs.c
@@ -116,7 +116,8 @@ threadmain(int argc, char **argv)
tracecalls = 1;
break;
case 'V':
- chattyventi = 1;
+ if(chattyventi++)
+ vttracelevel++;
break;
case 'a':
addr = EARGF(usage());
@@ -836,6 +837,7 @@ cnodereaddir(Cnode *n, u32int count, u64int cookie, uchar **pdata, u32int *pcoun
continue;
}
ne.name = n->name;
+ ne.namelen = strlen(n->name);
ne.cookie = ++cookie;
ne.fileid = *(u64int*)n->handle;
if(nfs3entrypack(p, ep, &np, &ne) < 0)