Commit Graph

63 Commits

Author SHA1 Message Date
riastradh f4368f5168 Initialize psshfs root node's readdir waiters queue.
Every other node's readder waiters queue is initialized in makenode,
but the root node is created specially.

ok pooka
2011-05-19 15:07:16 +00:00
pooka 080506bc5d Make error message more userfriendly in cases where server does
not support sftp.
2010-10-29 16:13:51 +00:00
pooka d317936de6 umgah. meant fts, not fsu 2010-02-17 15:54:10 +00:00
pooka 046f5845a2 Bump the initial rootdir link count guess to a ludicrous value. 2010-02-17 15:50:54 +00:00
pooka ef38ca9933 Make r/w servers unmount themselves cleanly upon receiving SIGINT/TERM. 2010-01-12 18:43:37 +00:00
pooka eac396bb5a errx() already contains progname ... 2010-01-07 21:26:49 +00:00
pooka 754f939dd3 Don't allow mangling of uid or gid -1, since they have a special
meaning in the sftp protocol.
2010-01-07 21:23:10 +00:00
pooka c4291c195a Add -u and -g, which allow to remap one (local,remote) uidgid, i.e.
umapfs without the fuss.
2010-01-07 21:05:50 +00:00
pooka de048bdaae const woes 2009-11-05 11:40:24 +00:00
pooka d6c25c2b9b wait() for dead ssh processes (but don't block, so we might have
one teeny zmobie in the system).
2009-05-20 15:04:36 +00:00
pooka b5cb6a6ca0 Fix SNAFU in previous: connection handshake is already handled by
the connect routine now, so we're not required/allowed to do it twice.
Makes reconnect on dead link work again.
2009-05-20 14:39:42 +00:00
pooka dac06153a9 Copyright year management. no functional change (unless sarah disagrees) 2009-05-20 14:08:21 +00:00
pooka 8ff915319e Introduce -c [12], which can be used to open 1 or 2 ssh connections
to the server.  If "2" is specified, a separate connection is used
for data and directory operations.  Using two connections can
significantly increase directory operation performance on a saturated
link, at least up to 30x faster.
2009-05-20 13:56:36 +00:00
pooka 72d8b8b617 Support statvfs@openssh.com extension where available. Makes df(1)
return something other than just 0.
caveat: statvfs is done for the mountpoint path, so might not give
the truth about a directory inside the mountpoint.
2009-02-23 18:43:46 +00:00
pooka f423bfeed2 Due to a recent encounter with a sucky internet connection, add
experimental option -p, which tries to reestablish the connection
to the sftp server in case it is lost.  This currently has a few
limitations (found in the man page), but generally works in some
use cases.

Better support might eventually emerge, but since that requires a
plunge into the depths of puffs_framebuf, I need quite a bit of
Fernet Branca to build up my courage before attempting it.
2008-09-06 12:29:57 +00:00
pooka 84c098fe27 call puffs_exit() 2008-08-11 16:23:58 +00:00
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