ftpfs: no caching by default, add -c flag to enable it (patch by mycroftiv)

This commit is contained in:
cinap_lenrek 2018-02-14 20:35:36 +01:00
parent df6a30f3c0
commit b192800096
2 changed files with 13 additions and 8 deletions

View file

@ -4,7 +4,7 @@ ftpfs \- file transfer protocol (FTP) file system
.SH SYNOPSIS
.B ftpfs
[
.B -/dqnt
.B -/dqntc
]
[
.B -m
@ -90,6 +90,10 @@ To avoid seeing startup messages from the server use option
To see all messages from the server use option
.BR -d .
.PP
By default ftpfs only caches while a file operation is in progress. The
.BR -c
flag enables caching, increasing performance but allowing outdated file and directory data to persist.
.PP
Some systems will hangup an ftp connection that has no activity
for a given period. The
.BR -K
@ -183,13 +187,8 @@ only one directory, usually
However, walking to any valid directory on that machine will succeed
and cause that directory entry to appear under the mount point.
.PP
.I Ftpfs
caches files and directories. A directory will fall from the cache
after 5 quiescent minutes or if the local user changes the
directory by writing or removing a file.
Otherwise, remote
changes to the directory that occur after the directory has
been cached might not be immediately visible.
If caching is active, remote
changes that have been cached will not be visible.
Attempting to walk to
.IB directory /.flush.ftpfs
will flush

View file

@ -85,6 +85,7 @@ char *nouid = "?uid?";
char *nosuchfile = "file does not exist";
char *keyspec = "";
int docache = 0;
void
usage(void)
@ -149,6 +150,9 @@ main(int argc, char *argv[])
case 'q':
quiet = 1;
break;
case 'c':
docache = 1;
break;
} ARGEND
if(argc != 1)
usage();
@ -582,6 +586,8 @@ rclunk(Fid *f)
f->node->opens--;
}
f->busy = 0;
if(!docache && ISCACHED(f->node))
uncache(f->node);
return 0;
}