Home | History | Annotate | Download | only in libpuffs
History log of /src/lib/libpuffs/framebuf.c
RevisionDateAuthorComments
 1.37  19-Apr-2022  rillig lib: remove CONSTCOND comment

Since 2021-01-31, lint doesn't need it anymore for the common pattern of
'do ... while (0)'.
 1.36  30-Oct-2021  nia puffs(3): Replace realloc(x * y) with reallocarr
 1.35  14-Jun-2017  christos remove now unnecessary casts.
 1.34  31-May-2017  christos Adjust to prototype.
 1.33  09-May-2017  christos Only add a write filter for sockets. It is not supported for vnodes, or
for 1/2 closed fifos (which we both have now).
 1.32  25-Jun-2012  abs branches: 1.32.22;
Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.31  19-Dec-2011  riastradh Fix error reporting in puffs_framev_enqueue_waitevent and callers.

ok christos
 1.30  12-Jan-2010  pooka branches: 1.30.6;
Add convenience routine puffs_unmountonsignal(), which does exactly that.
 1.29  04-Sep-2008  pooka Fix double free when i/o descriptor is violently closed. Bug was
introduced in rev 1.27.

fix provided by Taylor R Campbell in lib/39353
 1.28  29-Jan-2008  pooka branches: 1.28.6;
Fix a weirdosity in the framebuf gotfb interface: hand buffer
ownership to the called routine instead of keeping it. This means
that callees must now destroy the buffer once they are done with it.
 1.27  28-Jan-2008  pooka Implement lazy contexts for file systems using puffs_mainloop().
Previously each request was executed on its own callcontext and
switched to every time the request was being processed. Now requests
borrow the mainloop context and switch only if/when they yield.
This takes two context switches away from a file system request
bringing down the typical amounts 2->0 (e.g. dtfs) and 4->2 (e.g.
psshfs).

The interfaces for manually executing requests changed a bit:
puffs_dispatch_create() and puffs_dispatch_exec() must now be used.
They are not tested, as nothing in-tree wants them and I doubt
anyone else is really interested in them either.

Also do some misc code cleanup related to execution contexts. The
"work-in-progress checkpoint" committed over a year ago was starting
to look slightly weed-infested.
 1.26  16-Dec-2007  pooka * nuke puffs_cc_get{specific,usermount} for good
* move prototypes for puffs_docc and puffs_dopufbuf into the
public header, as they are should be exposed
 1.25  04-Dec-2007  pooka Part 3/n of extensive changes to message handling:

Get rid of the original puffs_req(3) framework and use puffs_framebuf(3)
instead for file system requests. It has the advantage of being
suitable for transporting a distributed message passing protocol
and therefore us being able to run the file system server on any
host.

Ok, puffs is not quite here yet: libpuffs needs to grow request
routing support and the message contents need to be munged into a
host independent format. Saying which format would be telling,
but it might begin with an X, end in an L and have the 13th character
in the middle. Keep an eye out for the sequels: Parts 3+m/n.
 1.24  04-Dec-2007  pooka realloc() len+incr, not offset+incr. Makes space reservation
actually work properly.
 1.23  06-Sep-2007  pooka document puffs_framev_framebuf_ccpromote()
 1.22  06-Sep-2007  pooka Give cmpframe() the ability to shortcircuit the comparison loop by
signalling back that the buffer under examination is not a response
at all.
 1.21  01-Sep-2007  pooka Add gotframe callback, which is called if an incoming frame matches
no outstanding request.
 1.20  25-Aug-2007  pooka branches: 1.20.2;
Pass usermount to errnotify, it might not be available there through
other structures. CID 4496
 1.19  21-Jul-2007  pooka branches: 1.19.4;
Return -1 and errno from puffs_framev_enqueue_waitevent instead of
a direct error value.
 1.18  20-Jul-2007  pooka simplify send loop
 1.17  20-Jul-2007  pooka Add puffs_framev_enqueue_waitevent, which waits for read/write/error
events from an i/o descriptor. It yields until an event happens
and continues execution when the event loop notices the event has
happened.
 1.16  08-Jul-2007  pooka g/c leftover
 1.15  08-Jul-2007  pooka make notifyfunction optional and do not call removeonclose() if
none is given.
 1.14  07-Jul-2007  pooka 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
 1.13  20-May-2007  pooka 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.
 1.12  20-May-2007  pooka 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.
 1.11  19-May-2007  pooka 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.
 1.10  16-May-2007  pooka Add error parameter to puffs_framev_cb to signal if there is a
result of if the function should just do resource cleanup.
 1.9  16-May-2007  pooka switch the arbitrary default errno value for network i/o from
ECONNABORTED to ECONNRESET, which is at least a little bit better
 1.8  15-May-2007  pooka 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
 1.7  12-May-2007  pooka use size_t instead of int to calm over-eager lint
 1.6  11-May-2007  pooka Step 2 of general-purpose eventloop: get rid of puffs_framebuf_eventloop().
puffs_mainloop() now handles that functionality as well.
 1.5  11-May-2007  pooka 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)
 1.4  09-May-2007  pooka 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.
 1.3  06-May-2007  pooka implement the conveniently-already-prototyped puffs_framebuf_remaining(),
which is just shorthand for tellsize() - telloff()
 1.2  06-May-2007  pooka Remove the user-specified argument for the framebuf loop callback.
It can be generated through other means if it is desired.
 1.1  05-May-2007  pooka Add puffs "frame buffers", which are an abstraction of the buffering
and event handling mechanisms required in file servers with blocking
I/O backends. puffs_framebuf is built on the concept of puffs_cc
and uses those to multiplex execution where needed.

File systems are required to implement three methods:
* read frame
* write frame
* compare if frame is a response to the given one

Memory management is provided by puffs_framebuf, but the file
systems must still, of course, interpret the protocol and do e.g.
byte order conversion.

As always, puffs_framebuf is work in progress. Current users are
mount_psshfs and mount_9p.
 1.19.4.2  21-Jul-2007  pooka Return -1 and errno from puffs_framev_enqueue_waitevent instead of
a direct error value.
 1.19.4.1  21-Jul-2007  pooka file framebuf.c was added on branch matt-mips64 on 2007-07-21 09:29:08 +0000
 1.20.2.3  23-Mar-2008  matt sync with HEAD
 1.20.2.2  09-Jan-2008  matt sync with HEAD
 1.20.2.1  06-Nov-2007  matt sync with HEAD
 1.28.6.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.30.6.2  30-Oct-2012  yamt sync with head
 1.30.6.1  17-Apr-2012  yamt sync with head
 1.32.22.1  11-May-2017  pgoyette Sync with HEAD

RSS XML Feed