Commit Graph

173 Commits

Author SHA1 Message Date
pooka 8c9c68dbc2 Make puffs_framebuf better suited from environments with multiple sources:
* in addition add/remove, allow enable/disable, which can be used
  to control events for descriptors without having to remove all the
  data associated with them
* add directsend/receive, which can be used to pass the same buffer
  from the caller to read/writeframe and back again
* add flags to enqueue functions and allow urgent buffers to be
  processed as the next PDU
2007-07-07 21:13:41 +00:00
pooka c3dac7fe6f make few function types match reality 2007-07-06 10:11:02 +00:00
pooka 1451f0dabb document PUFFS_KFLAG_LOOKUP_FULLPNBUF 2007-07-05 22:42:14 +00:00
pooka b710306f2c apply ketchup to recent source changes in libpuffs 2007-07-05 22:37:52 +00:00
pooka 0e40108103 * reorder calls to get results processed even if our I/O descriptors
go back to zero
* don't give up on the read-side of an fd if there is still unreceived data
2007-07-05 12:27:39 +00:00
pooka df6f052d2f Get rid of the "int *refs" parameter to inactive: the same can be
accomplished now with puffs_setbacks.
2007-07-02 10:24:17 +00:00
pooka 79d81a9639 pid is gone 2007-07-01 23:04:13 +00:00
pooka 8023454664 Instead of requesting various pieces of information from node-creating
methods using "please fill me"-pointers, pass "struct puffs_newinfo *"
and provide methods to fill in new node info.
2007-07-01 18:39:39 +00:00
pooka 209b3e08de cast to void * instead of actual (albeit incomplete) type to silence
gcc about type punning with -fstrict-alias
2007-07-01 17:42:19 +00:00
pooka ffe0a01441 Instead of supplying a plain pid, supply an abstract struct puffs_cid *,
which can currently be used to query the pid and lwpid.
2007-07-01 17:22:13 +00:00
pooka 438f52d212 make puffs_cred an opaque type 2007-07-01 15:30:15 +00:00
pooka 5092d42715 print time elapsed between calls 2007-06-30 12:42:25 +00:00
pooka 0f53ecfb54 fold in common code for node creation. no functional change. 2007-06-25 07:52:01 +00:00
pooka c3942902c4 Since we locate in-memory nodes based on the inode number, stat a
file always after creation to cache the inode number given by the
backend file system.  Otherwise we would not find a newly created
node from incore and create another one.  In practise this was
pretty well hidden by the kernel name cache.
2007-06-24 23:02:55 +00:00
pooka 8bfc66776f document KFLAG_NOCACHE{_PAGE,_NAME,} 2007-06-24 22:32:00 +00:00
pooka 53a4105885 Actually, keep PUFFS_KFLAG_NOCACHE and -o cache around as shorthand
to neither page- nor namecache.
2007-06-24 22:25:49 +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 159e84cbd3 Introduce puffs_null_setops(), which initializes the ops vector with
puffs nullfs ops.
2007-06-24 18:42:25 +00:00
pooka b1da438567 * document puffs_pn_remove
* all-around improve the manual page
2007-06-24 18:16:36 +00:00
pooka 564336f084 Introduce puffs_pn_remove() to signal that a node has been deleted
and destroyed, but not yet reclaimed.  This prevents puffs_pn_nodewalk()
from returning stale entries.  Make nullfs use this (some file
systems are a bit too happy with recycling inode numbers).
2007-06-24 17:55:07 +00:00
pooka 86e63e7e27 don't return errno from a function which returns an fd - there's
a "little" room for confusion.  instead, return -1 and let the
caller grab errno.
2007-06-24 17:41:09 +00:00
pooka 18e8d526ea print a specific warning if /dev/puffs cannot be opened in init 2007-06-11 06:13: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
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 0b02e3c304 remember to put the results of the final operations (including unmount)
to the kernel in mainloop
2007-05-21 08:30:49 +00:00
pooka 866bcfbb38 Introduce puffs_framev_framebuf_ccpromote, which can be used to
turn a reference to puffs_framebuf in the file system from a
cb/justsend operation to a cc wait, should the file system find
itself desiring the result.
2007-05-20 19:56:56 +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 1a07ce5385 quick TODO-list. very incomplete 2007-05-19 12:03:30 +00:00
pooka cc2ad436bf Allocate buf in 4k chunks instead of 64k chunks. If we are seriously
reclaiming and the network/server is slow, we might have thousands
of buffers allocated at the same time causing the process to run
out of vm space.  Rate limiting the number of outstanding ops would
be a nicer choice, but that requires more complex changes.
2007-05-19 11:01:21 +00:00
pooka e001b11fcd default refcount to 1 in inactive 2007-05-18 18:01:55 +00:00
pooka 0218526006 document puffs_node_poll 2007-05-18 14:38:15 +00:00
pooka 75bb6c40b0 dispatch PUFFS_VN_POLL 2007-05-18 13:53:54 +00:00
pooka 91681cc8fd * stuff results back to kernel before calling kevent - the file server
loop function might generate some results.  and this is still "after"
  event handling (except for the first call, but I'm not too keen on
  optimizing for that)
* don't be such a baby about EINTR from kevent().  if we get it, suck
  it up and continue instead of quitting
2007-05-18 13:24:23 +00:00
pooka ae3221667f reflect today's mount changes 2007-05-17 15:21:14 +00:00
pooka c7561a8e7c Reflect kernel changes for supplying root node information in mount
instead of puffs_start().  Get completely rid of puffs_start(), as
everything it used to do is now handled by the mount routine.
Introduce an optional pre-mount call puffs_setrootinfo() for setting
non-default root node information.  As the old puffs_mount() is
now virtually useless, say byebye to it and rename the old
puffs_domount() to puffs_mount(), but add a root cookie parameter
to compensate for the late puffs_start().
2007-05-17 14:03:13 +00:00
pooka 5a69314b41 struct puffs_usermoint does sound more lively, but be serious and
fix the typos to puffs_usermount
2007-05-17 13:31:30 +00:00
pooka 4fcec1c58b remember to document puffs_framev_cb error parameter addition 2007-05-16 10:07:11 +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 8be39bc354 switch the arbitrary default errno value for network i/o from
ECONNABORTED to ECONNRESET, which is at least a little bit better
2007-05-16 09:41:04 +00:00
pooka 7b30368988 update .Nd to reflect current reality better 2007-05-16 07:56:09 +00:00
pooka 13d0372f38 memset freshly allocated puffs_usermount to 0 2007-05-15 16:45:22 +00:00
pooka 291fe845cd Step 3 and currently final step of a more general purpose event loop:
support removal and addition of i/o file descriptors on the fly.

* detect closed file descriptors
* automatically free waiters of a dead file descriptor
* give the file server the possibility to specify a callback which
  notifies of a dead file descriptor
* move loop function to be a property of the mainloop instead of
  framebuf (doesn't change effective behaviour)
* add the possibility to configure a timespec parameter which
  attempts to call the loop function periodically
* move the event loop functions from the puffs_framebuf namespace
  to puffs_framev to differential between pure memory management
  functions
2007-05-15 13:44:46 +00:00
pooka 354b8e48b8 use size_t instead of int to calm over-eager lint 2007-05-12 07:44:58 +00:00
pooka 46dc457634 copyright adjustment 2007-05-11 21:44:00 +00:00
pooka e9cad0cef9 move puffs request dispatching code into it's own module.
no functional change
2007-05-11 21:42:42 +00:00
pooka e94b19cfed Step 2 of general-purpose eventloop: get rid of puffs_framebuf_eventloop().
puffs_mainloop() now handles that functionality as well.
2007-05-11 21:27:13 +00:00
pooka 2b8177d9fc Step 1 in moving towards a general-purpose eventloop: allow the
framebuf event loop to take n i/o fd's as parameters and also allow
dynamic add/remove of fd's.  (not tested except for one fd, but more
changes coming soon)
2007-05-11 16:22:38 +00:00
pooka 7806d3dfc4 assert that yield/continue is done only with a real continuation 2007-05-10 12:36:44 +00:00
pooka 4966e1c1de Add some kludges to be able to execute requests on the regular program
stack instead of the continuation stack.  This is for lib/36011, where
pthread gets confused since we aren't running on the regular stack.
I'm not really sure which direction to go to with this quite yet, so
make the hack hard to enable on purpose.  The whole request dispatch
code needs cleaning anyway.
2007-05-10 12:26:28 +00:00
pooka 4862309053 Remove the puffs_usermount argument from puffs_req_handle(). It can
be found from the other arguments and this way puffs_req_handle() is
more symmetric with the other puffs_req() routines.
2007-05-09 18:36:52 +00:00