Commit Graph

150 Commits

Author SHA1 Message Date
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
pooka b5bd455564 make closehandles() void, because that's what it is 2007-07-29 17:50:22 +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 242bfad7a6 support poll 2007-07-20 13:18:09 +00:00
pooka 87429c840c Oops, the cookies for nfs of course represent the *next* directory
entry offset, not the current one.
2007-07-19 10:14:53 +00:00
pooka d8a510556e get rid of DBG= 2007-07-18 22:38:58 +00:00
pooka 08db7d7534 * add mntfromname parameter to puffs_init()
* set it in file servers
2007-07-17 11:34:51 +00:00
pooka 90ba17c197 support standard user@host:path mount argument 2007-07-17 10:06:03 +00:00
pooka 9ec31d4b95 If the target node exists in rename, do not try to issue a setback
to signal no references, as that is not currently supported for
node_rename().  The removed node will not immediately be reclaimed,
but we can live with that for now.

While here, factor the removal code a bit to share with remove and
rmdir.

fixes PR kern/36637 by reinoud
2007-07-16 09:36:06 +00:00
pooka 52c5d7c979 * support non-blocking read/write
* support seek (or actually support failing to seek ...)
2007-07-09 09:28:21 +00:00
pooka a43c6db049 play it safe: ignore sigpipe 2007-07-08 17:13:24 +00:00
pooka 5e1b81c1b5 Accept user as a flag. This way the usage is fstab-compliant:
mount_9p argument mountpoint
2007-07-08 16:29:29 +00:00