Commit Graph

106 Commits

Author SHA1 Message Date
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