Commit Graph

252 Commits

Author SHA1 Message Date
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
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
pooka 9d2baecbde build & install puffsportal (if MKPUFFS) 2007-07-08 14:29:52 +00:00
pooka 226c70ad91 Build this as mount_puffsportal for now, so that it can be easily
installed at the same with the regular mount_portal.
2007-07-08 14:27:48 +00:00
pooka 33318660d7 * don't need to define a nop notify, just pass in NULL to init
* remove node's i/o descriptor in reclaim
2007-07-08 11:45:00 +00:00
pooka e395775675 Add support for non-blocking I/O. Also fixes problems the providers
and popen() caused with concurrent access.

This should match the original portalfs in functionality now.
2007-07-08 10:43:03 +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 330acd4a45 Add initial puffs version of mount_portal, eventually to replace
portalfs.  Uses the same config files etc. as the "regular"
mount_portal, and actually compiles a lot of the code directly from
under src/sbin/mount_portal.

Doesn't yet support concurrent access, but I have a pretty clear
vision on how to neatly fix that.
2007-07-02 18:35:14 +00:00
pooka 58457f2209 adapt: inactive no longer comes with int *refcount (not that it was
used except for setting the default here anyway)
2007-07-02 10:26:50 +00:00
pooka 6596e0c995 adapt: **newnode etc. pointers -> struct puffs_newinfo 2007-07-01 18:40:15 +00:00
pooka fe7bbdec69 adapt: pid -> const struct puffs_cid * 2007-07-01 17:23:44 +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 4a403dd973 Fix return value comparison inversion. Makes psshfs work for the
nocache case again, as the server error value for EOF is properly
handled again.
2007-06-26 11:04:29 +00:00
pooka 5662e7f720 PUFFS_KFLAG_NOCACHE became two, so introduce the command line options
-o nonamecache and -o nopagecache and adapt file systems where necessary.
2007-06-24 22:18:38 +00:00
pooka 91629617de Call puffs_pn_remove() just in case the file server happens to be
quick with recycling qids.
2007-06-24 19:13:39 +00:00
pooka 23c0297785 print warning if directory cache invalidation fails 2007-06-21 13:53:00 +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
tls 4147a3c54a Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry.  RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros.  Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default.  Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
2007-05-28 12:06:17 +00:00
pooka 464b354e31 devnullify ssh process's stderr to avoid tty spam 2007-05-21 08:55:04 +00:00
pooka d32c8fa56b In case we are really tight on vnodes, the directory vnode might
be reclaimed from under while we are warming the getattr cache.
Shuffle some code to prevent the effects.  Theoretically the race
is still possible, but I don't think it will happen in practice.
In any case, the code could benefit from some more dusting.
2007-05-20 20:27:04 +00:00
pooka 4bc09685b9 Observe that when doing ls -l, the attributes of the first file
getattr are usually still outstanding when we already would like
the result.  Instead of issueing another stat which will be serviced
only after all the other entries in the directory, record all the
outgoing readdir getattr buffers and if we encounter an outstanding
request when we need to fetch attrs, do a puffs_framev_framebuf_ccpromote()
wait for it instead of firing off the second query.  This shaves
almost 10% off the time for ls -lR.

Also, get rid of the SUPERREADDIR conditional, since it has penetrated
the code quite a bit and the #ifdef SUPERREADDIRs were starting to
look like tagliatelle alla bolognese (n.b. I love how it looks,
but I wouldn't like it either if my tagliatelle alla bolognese
looked like psshfs code).  Maybe it should be re-introduced in the
form of a switch?
2007-05-20 20:06:23 +00:00
pooka a769baf075 Implement SUPERREADDIR (like nfs readdirplus) getattr cache warming
a bit differently: when reading the directory, store all getattr
caching queries and fire off only when the directory read is
complete.  That way the common sequence is not [readdir, lots of
async getattr requests, readdir EOF] but rather [readdir, readdir
EOF, lots of async getattr].  This speeds up ls -lR by about 25%
(on my LAN).
2007-05-20 17:47:12 +00:00
pooka 7c537b89eb Change the signature of puffs_respcmp to return -1,0,1 for smaller,
equal, larger, respectively instead of 0/1 for non/equal.  This
will allow sorting the buffers for faster matching in libpuffs.
While here, change the name from respcmp to framecmp, as that better
reflects the purpose.

NOTE!  there is no obvious way to make compilation fail for file
systems which may already be using this feature (although I don't
think there are any outside our tree, as the feature is two weeks
old).  Nevertheless, non-updated file systems will fail very quickly.
2007-05-20 16:24:37 +00:00
pooka b283afddec support reclaim. set noref setback when removing a node to prompt
immediate reclaim.
2007-05-19 10:38:23 +00:00
pooka 423fa255c6 remove obvious incorrect assert() from doreclaim() and remove the
whole PSN_NUKED bit - it's not very useful because of the noref setback.
2007-05-18 18:00:07 +00:00
pooka f98f18ebad * use NOREF setback to prompt immediate (well, once the kernel
reference count goes to 0) reclaim of deleted nodes as opposed to
  waiting for the system to start reclaiming the freelist
* combine some nodeflags from different variable to one status variable
2007-05-18 16:13:47 +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 c1f0cc6870 Add error parameter to puffs_framev_cb to signal if there is a
result of if the function should just do resource cleanup.
2007-05-16 10:04:08 +00:00
pooka 0b0e609b9b Enhance the GETRESPONSE, JUSTSEND and SENDCB macros to process the
return value from the network layer.
2007-05-16 09:57:21 +00:00
pooka ddf4b3708e * free framebuf after use (even in the common path ;)
* simplify a loop
2007-05-15 17:08:34 +00:00
pooka 8427494a96 don't leak memory if getting data from the buffer fails
CID 4485
2007-05-15 14:22:58 +00:00
pooka eaf4ddfb76 remember to free longname if getting vattr from the message fails
CID 4486
2007-05-15 14:17:30 +00:00
pooka 9fec81140f In case we counter a protocol error while parsing the readdir response,
completely release our directory cookie - it's unlike we'll be coming
back to it.  And if we do, it'll just be autogenerated.

CID 4487
2007-05-15 14:12:41 +00:00
pooka 5252a3b094 free name from proto_getstat() after use
CID 4488
2007-05-15 13:56:00 +00:00
pooka e3468dbcce adapt to "step 3" of puffs_framebuf changes 2007-05-15 13:46:47 +00:00
pooka c495e43bb1 uint32_t vs. size_t pointer adjustments for LP64 build 2007-05-12 09:41:30 +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 a2b224da1f Error with rtagid instead of tagid. caught by Dan's compiler flags. 2007-05-11 11:43:08 +00:00
pooka 888697433e remove caveat no longer applicable 2007-05-09 21:50:47 +00:00
pooka 3c246dfd5b use fprintf instead of errx for usage() 2007-05-09 21:46:27 +00:00
tnn 05ca7e85d0 Add an EXAMPLES section. 2007-05-09 21:00: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 3ac2e6b4df If mode is set, the uppermost byte specifying the type must be
correctly, otherwise the file server will attempt a conversion.
Specifically, if the directory bit is not set when changing the
permissions for a directory, a conversion from directory to regular
file would be attempted and naturally it being unsupported the
whole chmod would fail.  So supply the file type as part of the
file mode.
2007-05-06 22:17:50 +00:00
pooka afa0f0e278 Close file handles in inactive instead of close - a memory mapping
may still be active after a vnode is closed
2007-05-06 21:58:24 +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 c0da05fe2a Fire off FXP_CLOSE in create() and return immediately instead of
waiting for the result.
2007-05-06 15:30:18 +00:00
pooka d34b752303 use puffs_framebuf_remaining() 2007-05-06 10:54:55 +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 ff4087e2ce Fix a couple of gotchas left after AUTOVAR() started creating the
network buffers.

CID 4477, 4478, 4479, 4480
2007-05-04 18:17:34 +00:00
pooka 6784b33211 free uid and gid strings after use
CID 4474, 4475
2007-05-04 18:12:25 +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 5e73325b44 g/c forgotten printf 2007-05-01 20:43:14 +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 436cfd0df4 Alter the strategy for reading/writing a bit. First of all, use
PUFFS_KFLAG_WTCACHE.  Second, create separate fids for reading and
writing.  If opening for read, open a read-only fid and for write
a write-only fid; use these for reading and writing.  When the
open-count for a node drops to zero, clunk both.  This avoids hitting
the fid limit when accessing large directory hierarchies.

Two problems remain:
* does not take credentials into account, although we can only mount
  the remote 9P file server with one set of credentials, so not a
  huge worry
* doesn't work for the open/mmap/close/access_memory_window case, but
  that will require some further kernel changes
2007-04-22 18:10:48 +00:00
pooka 46853cdc64 descend into mount_9p 2007-04-21 14:23:10 +00:00
pooka e73a712f80 mount_9p: mount a file server using the Plan9 file sharing protocol
Works, but lots of little things to nibble on:
* fix permissions to work better
* limit the amount of open files required
* do constant folding with psshfs code
* support authentication
etcetc.
2007-04-21 14:21:42 +00:00
pooka 4895c619c9 use puffs_cc_getspecific() where puffs_usermount is not required 2007-04-19 20:31:09 +00:00
pooka 8ecf355f37 psbuf_recycle now exists, so use it instead of destroy&make in one
spot I probably missed originally.  No real functional change.
2007-04-18 15:53:20 +00:00
pooka 4c854dd8b4 Use ntohl instead of htonl when converting data from the network.
Result isn't that much different, though ....
2007-04-18 15:35:02 +00:00
pooka 66efb94d3b use PUFFS_STORE_DCOOKIE 2007-04-17 11:43:32 +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 b142df9b67 Actually, we can't reclaim our memory image for nodes which have
been nodetofh translated even if they are not valid on the sftp
server anymore, because some nfs client might still be clinging on
to the file handle we are reclaiming now.
2007-04-12 21:08:49 +00:00
pooka db8a30d61d document -e for nfs exportability 2007-04-12 21:04:39 +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 1cfe630356 adapt to new readdir signature. no functional change 2007-04-11 21:21:50 +00:00
pooka 81cd3e0214 fix another case of checking for return value from wrong variable
(that's what you get when you copypaste code, a cid with a pin
to burst your bubble, that's what you get for all your troubles, I'll
never copypaste again)

CID 4461
2007-04-09 20:59:08 +00:00
pooka fb8082e163 Check for success from correct variable after allocnode()
CID 4460
2007-04-09 20:52:32 +00:00
pooka 94b72e4fc4 If we have to do a stat in lookup, update time of last stat for
the new node to avoid a most likely immediate stat from the server.
2007-03-22 13:43:58 +00:00
pooka 7517e20c03 In case lookup from the directory listing fails, try statting the
target before giving up.  Makes it possible to access files from
-r+x directories.
2007-03-22 13:11: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 ad70c5ab2e one more size_t -> uint32_t 2007-02-27 14:17:14 +00:00
pooka cbb615f4db size_t -> uint32_t cleanup to make LP64 build
noticed by wiz
2007-02-27 13:28:39 +00:00
pooka b44590b7d0 * document -s
* explicitly mention that this implements sshfs functionality
2007-02-17 22:19:20 +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 986368958f Don't destroy puffs_nodes in success paths of remove and rmdir: the
kernel assumes that they will not be recycled until reclaim.
2007-02-10 02:53:27 +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 5d293715c8 * adapt to libpuffs path changes
* fix bug in rename
2007-01-15 00:42:21 +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 0ac919744e Give nukenode a destroy flag. If given, it completely wipes out
the node and directory cache (for directories).  Otherwise it just
nukes directory entry information.  The latter case is used when
renaming.
2007-01-11 18:50:42 +00:00
pooka 9da6af0a36 Invalidate kernel name cache for a directory when (re-)reading
directory contents from the server.
2007-01-09 18:23:21 +00:00
pooka 6ee2e9c031 Mark invalid attributes as invalid. Fixes stuff such a cp'ing files
when cp uses mmap().  Also makes attributes appear correct.
2007-01-09 12:34:20 +00:00
wiz 85181e787c New sentence, new line. Sort SEE ALSO. Punctuation nit. 2007-01-08 07:26:40 +00:00
pooka 94f62e9b01 properly carry fileid for directory entries, fixes pwd 2007-01-07 21:59:27 +00:00
pooka d66d221ae1 man page for mount_psshfs 2007-01-07 19:56:26 +00:00
pooka 5c80f85b24 use UBC by default 2007-01-07 19:33:23 +00:00
pooka 7f864d6007 * Adapt to openssh standard of timestamps in file attributes. Maybe
should make this work with the IETF standard some day, also.
* kludge with writes and permissions a bit to be able to flush data
  cached in ubc to files which are already with r/o permissions in
  the backend
2007-01-07 19:31:48 +00:00
pooka c53a62f5e3 fix link count calculation for directories 2007-01-07 19:29:55 +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 d584a8d23a SUSv3 says: should the implementation not support directory unlinking,
unlink shall fail with EPERM and the errno of the failure shall be EPERM
2007-01-01 21:32:12 +00:00
pooka 75a62546e6 Makefile.inc to get BINDIR right 2006-12-29 17:42:52 +00:00