Commit Graph

47 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 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 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 b0106b7eaf Don't overload "attributes last read" for the symlink cache,
use a separate variable.
2007-11-11 18:06:35 +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 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 9336b1ca30 Adapt to new puffs_framev_init() signature - gotfb. 2007-09-01 16:43:10 +00:00
pooka 1aba0dbed1 Track memory mappings. Close file handles already in close() if there
are no active mappings, otherwise do the standard inactive() run.
2007-07-27 09:46:27 +00:00
pooka 08db7d7534 * add mntfromname parameter to puffs_init()
* set it in file servers
2007-07-17 11:34:51 +00:00
pooka 1ad69966c9 I'm fairly certain this file system's type is psshfs, not ppshfs
(how did that manage to be there this long?)
2007-07-07 22:06:09 +00:00
pooka bfecc30afc adapt to puffs_framebuf changes 2007-07-07 21:14:26 +00:00
pooka a5c38fbcdf g/c bit about MNT_NOATIME being mandatory. it obvious isn't since
the code was #if 0'd out.
2007-06-26 13:20:34 +00:00
pooka f8326bf98e Move puffs to a two clause license where it already isn't so. And
as agc pointed out, even files with the third clause were already
effectively two clause because of a slight bug in the language...
2007-06-06 01:54:59 +00:00
pooka 464b354e31 devnullify ssh process's stderr to avoid tty spam 2007-05-21 08:55:04 +00:00
pooka c8b0a89198 reflect changes in fs mount: use puffs_mount() instead of
puffs_domount() & puffs_start()
2007-05-17 14:13:04 +00:00
pooka e3468dbcce adapt to "step 3" of puffs_framebuf changes 2007-05-15 13:46:47 +00:00
pooka 3a7dcceb40 use puffs_mainloop(); puffs_framebuf_eventloop() is a goner 2007-05-11 21:27:45 +00:00
pooka 5069b5df0c adapt to puffs_framebuf changes 2007-05-11 16:23:00 +00:00
pooka 3c246dfd5b use fprintf instead of errx for usage() 2007-05-09 21:46:27 +00:00
tnn 098bf95670 Change [-O sshopt value] to [-O sshopt=value] to better conform with the
way other userland apps behave. In /etc/fstab one would specify options
with -O=sshopt=value.
2007-05-09 20:25:20 +00:00
tnn edbbe0d8f9 Add flag [-O sshopt value] to mount_psshfs(8), allowing the user to specify
options to pass along to ssh(1). Remove redundant flag [-p sshport]; an
equivalent of -O Port sshport. ok'd by pooka@
2007-05-09 19:54:39 +00:00
pooka dca252d8a0 Use inactive-on-demand, set inactive request in open() to close
file handles when last reference is removed from the kernel.
2007-05-07 17:20:58 +00:00
pooka ded3a0bfa7 Open files in open and close them in inactive. This avoids the
silly and problematic chmod + open + "un"chmod in write, among
other things.
2007-05-06 19:48:51 +00:00
pooka cfd2c55859 adapt to puffs_framebuf_eventloop signature change 2007-05-06 10:51:19 +00:00
pooka 0e7bdfc146 Adapt to use puffs_framebuf. This gets rid of most of the duplicated
code between mount_psshfs and mount_9p and clarifies the code
structure.
2007-05-05 15:49:51 +00:00
pooka 9c16b5e434 For consistency destroy kernel request putbuffers also when
escaping event loop (the process is going to exit anyway, but ...)
2007-05-02 18:50:30 +00:00
pooka c442e78507 Add -p to specify server port if someone should for some reason
happen to run sshd on port, to pick a random number, 443.

Probably should give a way to specify rest of the ssh options.
2007-04-29 10:02:56 +00:00
pooka 0809789ff9 Use PUFFS_KFLAG_WTCACHE to avoid the need to do a sync(8) on the
client host to get all the data onto the server.
2007-04-22 20:03:26 +00:00
pooka b173dac692 adapt to kernel changes with file handles 2007-04-16 13:06:39 +00:00
pooka 37dd7942fc Instead of keeping on adding parameters to puffs_mount(), make it
only take the bare essentials, which currently means removing
"maxreqlen" from the argument list (all current callers I'm aware
of set it as 0 anyway).  Introduce puffs_init(), which provides a
context for setting various parameters and puffs_domount(), which
can be used to mount the file system.  Keep puffs_mount() as a
shortcut for the above two for simple file systems.

Bump development ABI version to 13.  After all, it's Friday the 13th.
Watch out!  Bad things can happen on Friday the 13th. --No carrier--
2007-04-13 13:35:46 +00:00
pooka bf4e539fe8 Support nfs exporting.
Now, when I say support, I mean "support", due to the limitations
of the backend.  File handles are valid only for one session, since
nodes can only be identified by pathnames and pathnames don't (all)
fit into the nfs file handle space.  Additionally, we can't detect
if a pathname is completely replaced by another file (if it's done
via some other route that through our mount, of course).  But then
again, that's an inherent problem with sshfs even without nfs.
2007-04-12 20:42:46 +00:00
pooka 95a18d20b9 Hide struct puffs_usermount from the rest of the world and provide
accessors for interesting data in it.  Namely, you can now get
pu->pu_privdata with puffs_getspecific(), pu->pu_pn_root with
puffs_set/getroot() and pu->pu_maxreqlen with puffs_getmaxreqlen().
2007-04-12 15:09:00 +00:00
pooka f446ae6b9f * don't require a directory entry to exist for a reclaimee node.
this can happen legally when a file is removed from backing
  storage not using this sshfs instance, a readdir is executed for
  the parent directory and only then the node gets reclaimed.
* now that there is a mechanism in place which does not require a
  pcc to do an sftp transaction, do not yield() in operations where
  the final transaction is something where we don't care about the
  return value (e.g. close handle).  speedup benefit for no cost.
2007-03-13 18:00:34 +00:00
pooka f5fed5348b Support reclaim. To support dotdot lookup, here we leave the
reclaimed nodes hanging until all their children have been reclaimed
and then reclaim everything we can as far up to root as possible.
This is because the file system structures are currently interlinked
in a fashion which would make dotdot lookup based on purely a path
instead of a in-memory node parent member pointer very difficult.
Yes, this deserves a closer look some day.
2007-02-15 13:07:29 +00:00
pooka 306e0025cf Implement "superreaddir". This issues a getattr for all the
directory entries already in readdir and caches the results instead
of waiting for each individial getattr from the kernel.  For
high-latency links the difference in "ls -l" is quite astounding
and even on my lan "ls -lR" is faster than for nfs in a normal
directory hierarchy (i.e. not one artifically setup to have thousands
of files per directory).

TODO: implement some sort of bandwidth/latency measurement in the
code and enable or disable this option based on than information
(and a command-line flag).
2007-02-09 23:36:17 +00:00
pooka 984c93b472 more ketchup 2007-01-20 14:37:48 +00:00
pooka 9fcf633272 play catchup with the lib 2007-01-20 13:52:35 +00:00
pooka c921b47454 don't detach if -s or -o dump is given on the command line 2007-01-11 18:52:26 +00:00
pooka 5c80f85b24 use UBC by default 2007-01-07 19:33:23 +00:00
pooka a67e4ce37f * do mount as a forward operation instead of a callback
* process -o args for mount
2007-01-06 18:25:19 +00:00
pooka c3ef8ea5d0 puffs sshfs, an sshfs implementation built on top of the puffs
continuation framework
2006-12-29 15:35:39 +00:00