Commit Graph

161 Commits

Author SHA1 Message Date
jmmv d96be1e18a Add a -F option to allow passing a configuration file to ssh(1), instead
of having to use multiple -O options on the command line.  OKed by pooka@.
2007-12-14 10:56:22 +00:00
pooka 074f023a65 Record inode number in psshfs_dir also for already instantiated
nodes when doing readdir.  This makes pwd work again for cases
where getcwd() actually has to do the "READDIR + compare inode
numbers" trick.

Yet another problem reported by jmmv.
2007-12-13 14:59:00 +00:00
pooka 343d277986 *blink*, remember to update comment too 2007-12-13 14:32:47 +00:00
pooka 794adab583 Do previous in a way which causes less waste of potential inode numbers. 2007-12-13 14:31:44 +00:00
pooka 00b48f3e40 Fix lossage noticed by jmmv (mostly for -t 0 mounts) and make sure
a node always has the inode number set.  And since I'm feeling
generous, sprinkle a few comments around the affected areas (mostly
so that I'd remember what in the world the code is trying to do).
2007-12-12 16:04:35 +00:00
pooka faa30930fd When creating a node, do the server-dance before creating the local
data structure.  This avoids a race between create and lookup, as
the kernel now unlock the directory before the create operation
returns.
2007-12-09 18:05:42 +00:00
pooka a86a009392 Don't use puffs_cc_getusermount() 2007-12-07 14:59:22 +00:00
pooka f845b0dacb Get rid of a lot of extra complexity due to doing separate getattr
requests in readdir - just use the results from the readdir rpc.
2007-12-07 14:54:08 +00:00
pooka 2195151d14 In case a node is created in lookup in the readdir path, initialize
attribute cache timestamp to be equal to that of the directory
cache timestamp.
2007-12-07 13:09:49 +00:00
pooka 375257e2a7 Invalidate namecache for a directory only if we've already read it
at least once.
2007-12-05 12:01:44 +00:00
pooka 30e5c41557 When scheduling waiters for re-run, remove them from the waitqueue
already when scheduling to make sure they're not scheduled more
than once.
2007-12-04 19:31:22 +00:00
wiz 6ee13c8582 Do not overload Xr macro. 2007-12-03 18:14:48 +00:00
wiz 9fbc5e2b76 Sort options. 2007-12-02 21:03:39 +00:00
wiz c50e337e51 Nits. Sort options. 2007-12-02 21:03:32 +00:00
wiz c3ff82973e Sort SEE ALSO. Minor nit fixes. 2007-12-02 19:05:51 +00:00
pooka 21913eabe5 Rototill.
Ok, ok, a few more words about it: stop holding puffs_cc as a holy
value and passing it around to almost every possible place (popquiz:
which kernel variable does this remind you of?).  Instead, pass
the natural choice, puffs_usermount, and fetch puffs_cc via
puffs_cc_getcc() only in routines which actually need it.  This
not only simplifies code, but (thanks to the introduction of
puffs_cc_getcc()) enables constructs which weren't previously sanely
possible, say layering as a curious example.

There's still a little to do on this front, but this was the major
fs interface blast.
2007-11-30 19:02:28 +00:00
pooka 3fe3f65454 Introduce the concept of lazyopens. This means that when a file
handle open is requested, it is waited for only if the node was
not previously succesfully opened.  The actual wait for the file
handle happens only when the file handle is actually needed (read
or write).  This in turn has the effect that reading cached files
will be quick instead of waiting for the file handle from the sftp
server first.  The wait previously could be very long if there were
serveral hundred k of outstanding requests in a limited-bandwidth
link.

The code is in some need of serious handholding, but it works, so
I'll leave that as "future work".
2007-11-30 16:24:04 +00:00
pooka 6a3d9a187d Remove "puffs_cid" from the puffs interface following l-removal
from the kernel vfs interfaces.  puffs_cc_getcaller(pcc) can be
used now should the same information be desired.
2007-11-27 11:31:17 +00:00
pooka 8dd9b67755 Don't bother tracking opencount and try to close file handles in
the close method - simply just wait for inactive and do it there.
2007-11-18 17:41:55 +00:00
pooka 4462e9454f use puffs_daemon() instead of daemon() 2007-11-16 18:39:01 +00:00
pooka 968196af71 If a regular file was remotely updated and a readdir was done on
the directory which contained the file before a getattr on the file
itself, the locally cached mtime would be updated without invalidating
the kernel page cache.  Thus incorrect data would be returned when
the node was read afterwards as the node size wouldn't match the
data length in the page cache.

Fix the problem by making all vattr-setting routines use the same code.

Problem noticed again by jmmv & atf (and again by running atf over
psshfs ... sometimes you're the windshield, sometimes you're the bug)
2007-11-16 15:53:47 +00:00
jmmv 55876f3f39 Drop trailing whitespace. On behalf of pooka. 2007-11-16 15:10:06 +00:00
pooka 0feebae56b When checking if the file page cache should be invalidated, compare
against cached mtime instead of attrread - attrread can be reset
these days by sending SIGHUP.

Problem noticed by jmmv & atf (well.. namely by using atf through psshfs).
2007-11-16 14:25:47 +00:00
pooka b0106b7eaf Don't overload "attributes last read" for the symlink cache,
use a separate variable.
2007-11-11 18:06:35 +00:00
pooka 6b4d0688e7 Cache readlink results similarly to attributes. Makes "cd" fast
for a slow connection if a symlink is along the path.

(this should be done elsewhere, but I want it for sshfs now)
2007-11-10 18:36:06 +00:00
pooka c5afd8dc36 Make it possible to force attribute/directory cache re-read by
sending SIGHUP to mount_psshfs.
2007-11-08 17:49:43 +00:00
pooka 7dc67449bf don't allow negative timeouts apart from -1 2007-11-08 16:42:31 +00:00
pooka a56f46a5ac Make attribute & directory content caching timeout a command line
option.  Use -t -1 to never expire, which is nifty on a high-latency
link where you know the server won't be modified from under you.
2007-11-08 16:40:14 +00:00
pooka a02fe51bef Open the kernel descriptor as part of mount(), not init(). Then
it doesn't matter if someone fork()s or does other tricks between
init() and mount() (and besides, now it's where it logically should be).
2007-11-06 15:09:07 +00:00
pooka ec865a5b29 Actually, daemonize the file servers before mounting. I might require
at some point that the local protocol handler does not change after
the file system has been mounted.
2007-11-05 17:54:31 +00:00
pooka 4b0f2948e2 Pull the daemonizing code out of the library mainloop into the file
servers.  Calling daemon() (i.e. fork()ing) inside a library can
cause nice surprises for e.g. threaded programs.  As discussed with
Greg Oster & others.
2007-11-05 17:48:17 +00:00
pooka afe4c2ed02 Use puffs_cc_schedule() (which is an exported interface) instead of
plugging directly to puffs_goto().
2007-10-21 19:27:12 +00:00
pooka 8543b6baeb Add option -r to specify maximum number of active read requests
for each node.  Setting this to a small number can be used to
improve interactive performance on low-bandwidth links when performing
bulk data reads.  Of course I could also open separate pipes for
bulk and other, but this was quicker and less intrusive and doesn't
require authenticating twice.
2007-10-20 19:14:27 +00:00
pooka 8215b8c2bc Close file handles if opencount drops to zero instead of closing
them if it does not drop to zero, i.e. fix a pretty obvious bug.
2007-10-16 10:53:02 +00:00
pooka 1b050f3a07 update usage to match reality. caught by jmcneill 2007-10-15 17:28:13 +00:00
pooka 6360ca31ab Execute getattr in lookup to get file size. The kernel doesn't
anymore do this if we fail to set size.

The whole lookup procedure should be done in a smarter fashion,
but this is the quickie fix to get things working again.
2007-10-13 17:21:39 +00:00
pooka 38602220e1 Free longname in all error branches. CID: 4545 2007-09-08 22:05:32 +00:00
pooka 96b66ea698 Free pufbuf in error branches. CID: 4546 2007-09-08 15:49:33 +00:00
pooka 08386a8ca4 adapt to new cmpfb signature 2007-09-06 16:09:09 +00:00
pooka 9336b1ca30 Adapt to new puffs_framev_init() signature - gotfb. 2007-09-01 16:43:10 +00:00
pooka 485aeac15e error branch management. CID 4503 2007-08-25 09:22:39 +00:00
pooka c64b357f71 jump to correct error branch. CID 4500 2007-08-25 09:01:08 +00:00
pooka 73d7189c08 If a node is forcibly reclaimed, close can be called more times
than open (or less, for the particular fs).  So don't be uptight
about opencount.
2007-08-24 13:33:51 +00:00
pooka 9b93e5ea2c Prevent crash in case there is more than one reader for the same
directory concurrently.  Might need to revisit the method used here
later, though.
2007-08-23 15:19:40 +00:00
pooka 25a346d4fb Nuke PUFFSLOOKUP_FOO and move to NAMEI_FOO 2007-08-15 14:19:19 +00:00
pooka 62234858c3 * use more sensible perms
* use mounter uid/gid as file owners
* sprinkle static
2007-08-10 08:13:11 +00:00
pooka f49fa2014c add mount_sysctlfs.8 2007-08-10 07:59:32 +00:00
pooka e0876492cd __RCSID police 2007-08-09 22:03:20 +00:00
pooka ef86ff763c add sysctlfs 2007-08-09 22:03:01 +00:00
pooka ba4e596bc9 move sysctlfs from examples to base 2007-08-09 22:01:25 +00:00