Commit Graph

407 Commits

Author SHA1 Message Date
pooka 61113f40fd 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.
2007-12-04 21:24:10 +00:00
pooka cf878f1627 add flushops 2007-12-04 20:03:40 +00:00
pooka 661a5edd0a tyop: reserver -> reserve 2007-12-04 19:40:45 +00:00
pooka 2049bce7a5 realloc() len+incr, not offset+incr. Makes space reservation
actually work properly.
2007-12-04 17:21:24 +00:00
wiz 1746ee1de1 Add comma in enumeration. Punctuation nits. Fix a typo. 2007-12-02 22:05:51 +00:00
wiz 6db764bae5 Add comma in enumeration. 2007-12-02 19:43:10 +00:00
wiz 9429ef03ff Fix another persistent spello. 2007-12-01 19:54:01 +00:00
wiz 0b6ffdfedb Fix a typo that has migrated across files. 2007-12-01 19:18:49 +00:00
pooka c8c3c477bb fix gotframe signature to match code 2007-12-01 18:59:36 +00:00
wiz 8498f992c4 Typo fixes. 2007-12-01 18:53:28 +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 aadcb17f11 * allocate pcc as a slice from the stack instead of allocating it
separately
* provide puffs_cc_getcc()

This is in preparation for the removal of you-should-guess-what as
an argument to routines here and there and everywhere.
2007-11-29 17:47:54 +00:00
pooka 73a538eac2 print mode in open 2007-11-29 17:22: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 7568ff51e1 print more info when receiving an abort 2007-11-26 12:20:21 +00:00
pooka dac2b0c689 fix request size 2007-11-17 17:12:11 +00:00
pooka 4b2334142b puffs_mount():
* initialize values better
* always go through "fail" to see if puffs_daemon() needs to be
  woken up
* open device r/w instead of r/o
2007-11-17 16:06:18 +00:00
pooka 3537e99eb1 Introduce puffs_daemon(), which works like daemon(3) except that it
also synchronizes with puffs_mount() and does not return (exit) in the
parent process until the file system has been mounted.  This makes
it possible to reliably run e.g. mount_foo jippi /kai ; cd /kai/ee
2007-11-16 18:35:10 +00:00
pooka 154c2e54fb dump lookup return values 2007-11-16 14:59:14 +00:00
pooka 805571cfce remove header that was never committed 2007-11-12 17:35:32 +00:00
pooka 9ac65ee1fe * split the putter header into a kernel version and a userland version
+ install latter to /usr/include/dev/putter
* remove last dependencies to puffs from putter, it's completely
  independent now
2007-11-12 16:39:32 +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 e5a1d7804c remember to bump version for puffs_mainloop() change 2007-11-05 17:55:23 +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 bcc59b911e Call puffs_genfs_reclaim directly instead of through an extra jumpgate. 2007-11-05 16:53:00 +00:00
pooka baea362887 Fix a few bugs and memleaks with the threading code. 2007-10-31 16:09:09 +00:00
pooka f7de032584 lock massage, although I don't think there's a happy ending here 2007-10-29 17:47:33 +00:00
pooka 40ffc8b91f Sprinkle some hackish locks here and there, just enough to allow
libp2k & rump to run multithreaded.
2007-10-29 15:52:44 +00:00
pooka b40b63f077 Add possibility to set pre- and post callbacks which will be called
for all operations before or after executing the specific callback
(the api is not be final yet, though).
2007-10-28 18:40:30 +00:00
pooka edb40ac9bf Add some very initial support for a threading worker model as an
alternative to the (vastly superior ;) continuation model.  This
is very preliminary stuff and not compiled by default (which it
even won't do without some other patches I cannot commit yet).

The raison d'commit of the patch is a snippet which ensures proper
in-order dispatching of all operations, including those which don't
require a response.  Previously many of them would be dispatched
simultaneosly, e.g. fsync and reclaim on the same node, which
obviously isn't all that nice for correct operation.
2007-10-26 17:35:01 +00:00
pooka 944ce6a1a8 dump pid/lwp of caller 2007-10-26 17:24:45 +00:00
pooka cb50a739c3 mmap stacks, makes it possible to align them 2007-10-26 13:51:14 +00:00
pooka 5643bf6454 Make pu_haskq a flag instead of its own variable. 2007-10-25 10:59:45 +00:00
pooka 753b7cae6e Add puffs_cc_schedule() which marks a pcc runnable and will pass
execution to it when in the main loop the next time.
2007-10-21 19:25:58 +00:00
he 71a133879f To work around lint problems, add a LINTED comment on pooka's request. 2007-10-21 16:29:40 +00:00
pooka be98071c8c Always provide caller information from the kernel based on curlwp.
(but don't deprecate the old puffs_cid interface just yet)
2007-10-21 14:28:05 +00:00
pooka cc72c593dd typo in comment 2007-10-21 14:26:15 +00:00
pooka cf6e3aa4f9 When doing a read operation, don't copy the whole kernel buffer to
userspace, since it doesn't contain any information yet.  I should
still rework this more so this is just a quickie to get the read/write
style interface more up to speed with the ioctl version.
2007-10-19 14:38:45 +00:00
pooka ce87c49167 * Change type of boolean functions to, well, boolean instead of int.
* add puffs_cid_isequal() which can be used to test if the two caller
  id's refer to the same process/lwp.
2007-10-18 13:48:04 +00:00
pooka 33c91738e5 Part 1/n of some pretty extensive changes to how the kernel module
interacts with the userspace file server:

  * since the kernel-user communication is not purely request-response
    anymore (hasn't been since 2006), try to rename some "request" to
    "message".  more similar mangling will take place in the future.

  * completely rework how messages are allocated.  previously most of
    them were borrowed from the stack (originally *all* of them),
    but now always allocate dynamically.  this makes the structure
    of the code much cleaner.  also makes it possible to fix a
    locking order violation.  it enables plenty of future enhancements.

  * start generalizing the transport interface to be independent of puffs

  * move transport interface to read/write instead of ioctl.  the
    old one had legacy design problems, and besides, ioctl's suck.
    implement a very generic version for now; this will be
    worked on later hopefully some day reaching "highly optimized".

  * implement libpuffs support behind existing library request
    interfaces.  this will change eventually (I hate those interfaces)
2007-10-11 19:41:13 +00:00
pooka bf2346742b g/c #if 0'd code which isn't likely to get used any time soon 2007-10-09 21:04:55 +00:00
pooka c8c5d830fc SEE ALSO paper 2007-10-05 00:04:59 +00:00
pooka 0e5d568d01 minor updates/clarifications 2007-10-02 13:41:44 +00:00
pooka 174fb761dd Pass reason string to pu_errnotify. Print it in the default
version before aborting.
2007-10-01 21:10:50 +00:00
pooka 930ce5ac9b support error notifications 2007-09-29 22:07:32 +00:00
pooka 6eff998647 silence lint. also noticed by xtraeme 2007-09-27 23:11:41 +00:00
pooka aa533e99dd Add error notifications, which are used to deliver errors from the
kernel to the file server for silly things the file server did,
e.g. attempting to create a file with size VSIZENOTSET.  The file
server can handle these as it chooses, but the default action is
for it to throw its hands in the air and sing "goodbye, cruel world,
it's over, walk on by".
2007-09-27 21:14:49 +00:00
pooka 12e401bc1a Add refuse paper to SEE ALSO 2007-09-24 00:22:25 +00:00
pooka 3875108e18 document puffs_framev_framebuf_ccpromote() 2007-09-06 18:01:34 +00:00
pooka 56b35d3b97 Give cmpframe() the ability to shortcircuit the comparison loop by
signalling back that the buffer under examination is not a response
at all.
2007-09-06 16:08:55 +00:00
pooka 91872d550d xref refuse, don't bump date 2007-09-03 12:34:21 +00:00
pooka dc9a91060d Add gotframe callback, which is called if an incoming frame matches
no outstanding request.
2007-09-01 16:42:42 +00:00
pooka b017aa6055 Pass usermount to errnotify, it might not be available there through
other structures.  CID 4496
2007-08-25 09:30:41 +00:00
pooka 083b854262 Dump lookup/componentname specific info in opdump.
(sigh, I guess I guess I'll never do opdump properly at this rate)
2007-08-22 17:57:48 +00:00
pooka e6d6dce9bf Mimic namei structure changes for puffs. bump both kernel & lib version. 2007-08-22 17:54:30 +00:00
pooka f9009a84a6 puffs_cc_create/destroy aren't supposed to be exported to the user 2007-08-18 10:26:05 +00:00
pooka 4385b647e7 Add accessors for struct puffs_node to prepare for removal from
exported headers.
2007-08-17 17:25:31 +00:00
pooka 25a346d4fb Nuke PUFFSLOOKUP_FOO and move to NAMEI_FOO 2007-08-15 14:19:19 +00:00
pooka ea9b8a0046 run realpath() on the mountpath 2007-08-11 18:04:50 +00:00
pooka a213499d32 dump further info for read/write 2007-08-07 13:44:27 +00:00
pooka 78302eef99 Per rumble's lead in vnodeops, clarify the bit about readdir cookies. 2007-07-31 21:48:18 +00:00
pooka 8631cf4e2b mmap fflags -> prot 2007-07-27 08:28:16 +00:00
pooka b2a631b1fe * add missing credential handle to fsync args
* and now with more cosmetic attack
2007-07-25 09:10:26 +00:00
pooka 9825955cc2 pure cosmetics: minor facelift 2007-07-25 08:31:19 +00:00
pooka b0e54182a4 document puffs_framev_enqueue_waitevent 2007-07-21 09:36:49 +00:00
pooka e30ed21300 Return -1 and errno from puffs_framev_enqueue_waitevent instead of
a direct error value.
2007-07-21 09:29:07 +00:00
pooka e2dc8334cf simplify send loop 2007-07-20 14:55:42 +00:00
pooka 343e8df31e 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.
2007-07-20 13:14:55 +00:00
pooka 99db048c69 note caveat with puffs_node_poll 2007-07-20 10:01:24 +00:00
wiz 77bf5a1ac4 Use HTML escapes. Drop trailing whitespace. Punctuation nits. 2007-07-19 19:25:09 +00:00
pooka f2825a0ae8 Don't float puffs_kargs needlessly around after mount, saves
a couple k of memory (and there was much rejoycing!)
2007-07-19 12:52:28 +00:00
pooka 044229479a wizd reminded me that if I provide the synopsis for puffs_node_seek(),
I would do well to also describe what it does.  so make it so.
2007-07-19 08:32:06 +00:00
pooka 2f6b69c368 Use ioctl(PUFFSREQSIZEOP) instead of mount(MNT_GETARGS) to fetch
the maximum request size after mount.  Calling mount(MNT_GETARGS)
from the file server is currently not kosher, as it vrele()s the
root vnode, potentially causing an inactive, which the file server
cannot handle while it itself is inactive in the kernel (deadlock).
2007-07-19 07:54:46 +00:00
pooka 638ce78980 stuff 2007-07-19 07:48:10 +00:00
pooka d8a510556e get rid of DBG= 2007-07-18 22:38:58 +00:00
pooka 9651f40228 update 2007-07-18 22:23:37 +00:00
pooka 81ec5d68ec uncomment puffs_node_seek - it's supported and in use 2007-07-18 21:41:06 +00:00
pooka 46bd6a6148 puffs_cid* is always const 2007-07-18 21:24:40 +00:00
pooka 08db7d7534 * add mntfromname parameter to puffs_init()
* set it in file servers
2007-07-17 11:34:51 +00:00
dsl 0666faeea3 Add new 'data_len' parameter to mount system call.
Add an additional call with MNT_GETARGS to retrieve the modified
information instead of relying on the kernel code abusing the mount
interface during mount.
2007-07-14 16:02:14 +00:00
pooka fb503062d5 add IO_NDELAY 2007-07-09 09:28:48 +00:00
pooka 181c165c35 bring up-to-date 2007-07-08 17:25:26 +00:00
pooka 3541e44ce7 g/c leftover 2007-07-08 17:24:41 +00:00
pooka 1119cb908e make notifyfunction optional and do not call removeonclose() if
none is given.
2007-07-08 11:24:58 +00:00
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
pooka 19db57c596 List all current ways to write a file system. Also, add a reference
to puffs_req(3) for the manual operation case.
2007-05-09 18:24:11 +00:00
pooka a1388b4c53 Return 0 from puffs_mainloop() if no error occurs.
pointed out by Phil Nelson
2007-05-09 18:23:12 +00:00
pooka e5a894536c document PUFFS_KFLAG_WTCACHE and PUFFS_KFLAG_IAONDEMAND 2007-05-09 13:54:08 +00:00
pooka 06dd177014 document puffs_setback() 2007-05-09 13:46:16 +00:00
pooka 7faf2bccbe Add puffs_setback(), which can be used to set setbacks for nodes before
the call returns to the kernel.  Currently it can be called only from
open(), mmap(), remove() and rmdir().  (But that might change)
2007-05-07 17:16:07 +00:00
pooka 0a36778e8f Xr puffs_framebuf 2007-05-06 13:56:16 +00:00
pooka bbf8b7cf94 document puffs_framebuf 2007-05-06 13:56:03 +00:00
pooka 4226bd8b40 implement the conveniently-already-prototyped puffs_framebuf_remaining(),
which is just shorthand for tellsize() - telloff()
2007-05-06 10:54:41 +00:00
pooka a5f3fa93dc Remove the user-specified argument for the framebuf loop callback.
It can be generated through other means if it is desired.
2007-05-06 10:21:45 +00:00
pooka bb0de0a878 add stubby version of puffs_framebuf manual page. proper one
forthcoming to an internet near you Real Soon Now(tm)
2007-05-05 16:09:16 +00:00
pooka b223c403fc 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.
2007-05-05 15:48:18 +00:00
pooka 5fac7361cf Introduce PUFFS_FLAG_HASHPATH, which for PUFFS_FLAG_BUILDPATH file servers
creates a hash of the node's path into po->po_hash to avoid a full pathcmp
every time.
2007-05-01 15:58:00 +00:00
pooka 9601d4d304 use more accurate flag masking 2007-04-22 18:02:44 +00:00
pooka 5ad485727c assert that the file server doesn't try to return more cookies than
it was supposed to
2007-04-20 08:28:53 +00:00
pooka 89a0f35e6c improve descriptions and markup 2007-04-19 21:03:00 +00:00
pooka 5d86889ea0 add puffs_cc_getspecific(pcc), which is shorthand for:
puffs_getspecific(puffs_cc_getusermount(pcc))
2007-04-19 14:45:03 +00:00
pooka 7cfb5f2d40 fix readdir prototype 2007-04-18 20:37:05 +00:00
pooka d17f97ea42 * describe fhtonode, nodetofh and suspend
* update description of readdir to match reality
2007-04-17 13:11:05 +00:00
pooka eeff4f8efe Introduce PUFFS_STORE_DCOOKIE, which stores a directory cookie for a
given offset iff the directory read in question wants cookies.
2007-04-17 11:42:14 +00:00
pooka f9d2f485d4 improve markup and descriptions 2007-04-17 10:14:27 +00:00
pooka aaf5af07be Move file system and node callbacks into their own manual page.
Improve markup and descriptions a bit (not completely finished yet).
2007-04-16 19:16:02 +00:00
pooka 0d032531d1 document new interfaces 2007-04-16 16:37:02 +00:00
pooka d1667bb48c alloc to set flags when setting fhsize 2007-04-16 13:04:49 +00:00
pooka fca427389c some routines for setting mount parameters 2007-04-16 08:28:55 +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 fdd8f87db5 document accessor routines added when making struct puffs_usermount
implementation private
2007-04-12 21:45:29 +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 6b7023f08f * support nodetofh and fhtonode callbacks
* use new signature of node_readdir
2007-04-11 21:04:51 +00:00
pooka f7d8f11391 document the flush routines 2007-04-06 17:55:10 +00:00
pooka 6cc35b910e support page cache flushing 2007-04-06 17:49:11 +00:00
pooka 1e9c4b7026 use range invalidation op also for invalidating entire page cache of a node 2007-04-06 17:06:39 +00:00
pooka 622f8591d4 document puffs_inval_pagecache_node{,_range} 2007-04-06 16:44:01 +00:00
pooka fa10fe8f9f implement puffs_inval_pagecache_node_range() 2007-04-06 16:38:03 +00:00
pooka dd4643d880 Remove check against null parameter along with the XXX comment wondering
why the check was there.  CID 4408
2007-03-29 12:54:54 +00:00
pooka 406a946463 document credentials & access control methods 2007-03-22 17:38:09 +00:00
pooka cfd6dc233f allow kernel creds in addition to superuser creds when checking for access 2007-03-22 17:15:34 +00:00
pooka d28a42812b unify the location of *pcr in puffs_access_* 2007-03-22 16:57:27 +00:00
pooka 3a93377a23 copy ngroups * sizeof(gid_t) groups instead of just ngroups 2007-03-22 15:48:42 +00:00
pooka c3a2affb84 * return -1 and set errno instead of returning errno directly
* introduce puffs_cred_isregular() which checks if the cred structure
  has regular uid/gid (i.e. "person" credentials and not kernel creds)
2007-03-22 15:32:22 +00:00
pooka 1d029cc056 remove variable names from header 2007-03-22 14:22:08 +00:00
pooka 0f28e7c1d1 add routiens which check against ufs semantics for permission to
chown, chmod and change a/mtime
2007-03-21 19:55:55 +00:00
pooka 1ba4b810d1 implement counterpart of vaccess() 2007-03-20 18:28:08 +00:00
pooka a1e98c19f2 match puffs_node_access prototype with reality 2007-03-20 18:25:56 +00:00
pooka a4143b4298 g/c unused debug variable 2007-03-20 11:28:35 +00:00
pooka 5c0f0bcf80 initial support for cacheops 2007-03-20 10:22:22 +00:00
pooka 2df275c4cd va->va_mode doesn't contain the full argument to the mknod() system call,
so introduce puffs_addvtype2mode() and use that in null.c to generate the
proper syscall argument
2007-03-16 08:14:49 +00:00
pooka b93b025715 return errno instead of -1 if file is not present in lookup 2007-03-16 07:43:14 +00:00
pooka ec2d43895a add puffs paper presented at AsiaBSDCon 2007 to "SEE ALSO" 2007-03-13 17:06:10 +00:00
pooka d695eff80f Create in-memory nodes only per unique inode, not unique pathname.
Solves problem with e.g. cache coherency of hardlinked files.
2007-03-13 17:05:23 +00:00
pooka 8022394bca Until someone can sort non-priviledged mounts and kauth, force
MNT_NOSUID | MNT_NODEV for mounts with geteuid() != 0.  I'm tired
of typing them on the command line every time I test a file system.
2007-02-18 17:38:10 +00:00
pooka b681c2611b dump return values for operations 2007-02-18 17:36:48 +00:00
pooka 29d5922025 #include <ucontext.h> 2007-02-17 23:00:16 +00:00
pooka 70247c3530 in case rootpath is "/", make dotdot lookup in "/foo" build
a path of "/", not ""
2007-02-15 21:26:50 +00:00
pooka 76fead3a3e Readlink should place the length of the link (without terminating
nul) in the length field.  Make it so.
2007-02-15 19:33:51 +00:00
pooka 09156a1e18 use puffs_path_walkcmp() instead of a homegrown comparison routine 2007-02-15 17:05:25 +00:00
pooka 7fea503eb4 Introduce puffs_path_walkcmp(), which is to be called from nodewalk
and compares the path of the node against the given pathobject.
Also make comparison method take a flag to indicate if it should
check if the second path is a true prefix of the first.

plus some namespace cleanup
2007-02-15 17:04:46 +00:00
pooka a32e39e624 * get rid of the holy kernel-given ISDOTDOT, and instead define a
macro which does strcmp against ".." and (the untranslated)
  componentname
* make PUFFS_FLAG_BUILDPATH build paths also if dotdot is the case,
  and adapt the regular path objects to this
* make nullfs lookup readable because we can now get rid of dotdot
  processing there
2007-02-15 12:51:45 +00:00
pooka 1427bda45d generic node reclaim, which just puts a puffs_node 2007-02-15 12:51:24 +00:00
pooka f7a084b3b0 Nm the manual puffs instead of libpuffs 2007-02-08 05:24:36 +00:00
pooka 6c42c843ee make it possible for the root path to be "/" and the next path to
be "/foo" instead of "//foo"
2007-02-06 01:46:41 +00:00
wiz e6a160bd78 Fix spellos. 2007-01-28 07:58:05 +00:00
agc 9715dfff81 If we can't set the attributes when making the directory, use rmdir to
remove the directory, not unlink.
2007-01-27 11:49:44 +00:00
pooka f4e2aba8ce document puffs_fs_suspend() 2007-01-26 23:55:27 +00:00
pooka d83ed90176 add interfaces for suspending the file system 2007-01-26 23:00:33 +00:00
wiz 6d53f7319f New sentence, new line. 2007-01-20 16:49:36 +00:00
pooka 1118cadca7 document puffs_docc 2007-01-20 15:11:02 +00:00