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.
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".
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)
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).
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.
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.
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.
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