Commit Graph

420 Commits

Author SHA1 Message Date
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
pooka
5581d777a3 xref puffs_req 2007-01-20 15:10:38 +00:00
pooka
2fbe1b2261 document request handling routines 2007-01-20 15:09:34 +00:00
pooka
288823a738 Be consistent with the rest of the framework about the argument
order of puffs_docc and puffs_dopreq
2007-01-20 14:37:06 +00:00
pooka
84e83df1bb be consistent in naming request handlers 2007-01-20 13:52:14 +00:00
pooka
937097aa47 document puffs_getstate() and puffs_setstacksize() 2007-01-20 13:34:35 +00:00
wiz
2b5809387d Sort SEE ALSO. 2007-01-20 13:23:59 +00:00
pooka
809ae5f803 Bring the documentation slightly more into sync with the current
reality.  It's still really a far cry from proper documentation,
though.
2007-01-19 21:10:55 +00:00
pooka
c068d370f2 revoke revoke 2007-01-16 22:37:17 +00:00
pooka
05861b929d Checkpoint some more work in progress: for the benefit those file
system backends which operate purely based on paths, push out more
path management into the library and make path management more
abstract: enable a file system to define a bunch of path management
callbacks, which are used by the framework.  Management of normal
/this/is/a/path type paths is provided by the library.
2007-01-15 00:39:02 +00:00
pooka
5014a4c9c2 For directory renames we need to rename all the child nodes for
the given directory if the file system wants paths (PUFFS_FLAG_BUILDPATH).
Do this by walking the nodelist and adjusting the path prefix of
each matching node.
2007-01-11 18:18:36 +00:00
pooka
a3d07fb3e9 implement fsync 2007-01-11 17:48:21 +00:00
pooka
b599bb507d * do the l-variations of syscalls, since some nodes are symlinks
* truncate only regular files to set size
* do the chmod()-dance for cache flush to now write-protected files
  until I can think of a nicer way to solve this
2007-01-11 14:59:35 +00:00
pooka
e639bec8c2 Add preliminary code for a nullfs layer, which can be used to mount
a directory hierarchy to another point, just like with the kernel
nullfs.  This is not really a layering scheme yet, but it should
evolve into one.  Currently it can just be used to do 1:1 mapping.
2007-01-11 01:01:55 +00:00
pooka
14b3edf81b * don't chdir in possible daemon() call for the benefit of file systems
which specify a relative path as the root
* if (buildpath), build link source full pathname for the duration of
  the operation
2007-01-10 23:02:50 +00:00
pooka
2811d45fdd Be less shy about the default stack size, it's a only virtual memory space.
TODO: put a guard page at the end
2007-01-10 20:11:04 +00:00
pooka
71ddd8df08 rename name cache invalidation interface to be in sync with the
kernel operation names, i.e. contain "namecache" instead of just "name"
2007-01-09 18:19:01 +00:00
pooka
03a190dc22 lib interface for invalidation routines 2007-01-09 18:15:08 +00:00
pooka
7cc096d8ec * get rid of the mount callback; it's no great surprise to the
server that it needs to mount the file system backend if it wants
  to call mount
* provide some options for getmntopts(), assume that callers will parse
  command line (or fstab) args
* reorganize the puffs_cc interface just a bit, preparing for a bigger
  revamp later
2007-01-06 18:22:09 +00:00
pooka
f70a3c8c19 * inform kernel of our version
* homegrown lib ABI check (to avoid bumping major a ludicrillion times
  before reaching stability)
2007-01-02 15:53:05 +00:00
pooka
184a7d787c checkpoint some experimental work-in-progress, namely:
Add support for having multiple outstanding operations.  This is done
by exposing enough interfaces so that it is convenient to have the
main event loop in the implementation itself and by providing a
continuation framework for convinient blocking and rescheduling.

works fine, but will undergo further cleanup & development
2006-12-29 15:28:11 +00:00
alc
1a0e3f4a48 CID4360: don't leak `buf' upon return
ok pooka@
2006-12-14 18:15:59 +00:00
pooka
49df5bfc7b outline & export code for interfacing with kernel GET/PUT requests 2006-12-07 23:15:20 +00:00
pooka
24fb4d5d8c g/c out-of-date comment 2006-12-07 17:39:54 +00:00
pooka
43d8340ec6 support mmap 2006-12-07 16:59:14 +00:00
pooka
79fa3dd2c2 cleanup generated stuff from comments 2006-12-07 16:13:51 +00:00
pooka
55544f739a rototill the operation callbacks: unify the ops under struct puffs_ops
and namespace them
2006-12-07 10:53:21 +00:00
pooka
a0eb335104 adapt to kernel change:
Allow multiple requests to be transferred in each GET/PUTOP
2006-12-05 23:04:21 +00:00
pooka
b98361ea36 sauce catchup 2006-12-01 15:31:25 +00:00
pooka
0d5746a9ac PUFFSFLAG -> PUFFS_FLAG to be consistent with the kernel 2006-12-01 12:50:06 +00:00
pooka
465f49d71b build & send implemented operations list to kernel 2006-12-01 12:38:11 +00:00
pooka
d4280e60eb update with reality 2006-11-30 05:53:34 +00:00
pooka
c145fb5a17 summon daemon(3) in mainloop unless the nodaemon flag is given 2006-11-30 05:37:48 +00:00
pooka
c9aa28f463 * document open, close and access
* nomenclature improvements
2006-11-23 17:45:11 +00:00
pooka
4b5bf45935 const coherence 2006-11-23 16:44:28 +00:00
pooka
194d17d824 mode_t to enum vtype conversion 2006-11-21 23:11:09 +00:00
wiz
30ef64a953 Some mdoc and grammar nits. 2006-11-19 00:11:21 +00:00
pooka
d69d91cf3e * call statvfs() at mount() time, pass that info along
* start is gone
2006-11-18 12:40:35 +00:00
pooka
a0e314dc77 shuffle flags a bit 2006-11-17 17:48:32 +00:00
pooka
a40549faca namespace previous change under puffs_vfsnop to avoid confusions 2006-11-14 11:45:03 +00:00
pooka
2d9b770ec5 implement unmount, sync and statvfs as dummies for file system which
couldn't care less about implementing them
2006-11-14 11:23:44 +00:00
pooka
c025c6ae8f add note to BUGS about the questionable nature of puffs_node 2006-11-13 21:09:16 +00:00
pooka
c3f04e4e04 sync with change to lookup 2006-11-13 21:06:16 +00:00
pooka
80ce20607e * catch up with kernel changes
* better error handling when mounting
2006-11-09 13:11:01 +00:00
pooka
b8a1eae019 initial documentation for the puffs library interface 2006-11-09 01:30:15 +00:00
pooka
010234739c * support FAF (Fire-And-Forget) class operations
* adapt to new lookup
2006-11-07 22:10:53 +00:00
pooka
1fc270ecf0 pass rdev for specfs support 2006-10-26 22:53:01 +00:00
pooka
bda8cd7266 handle PUFFS_VN_INACTIVE 2006-10-25 18:15:50 +00:00
pooka
c643be45eb dump correct name for vfs operations 2006-10-23 16:53:17 +00:00
mrg
6bb0c03185 use casts to properly truncate some assignments. (sparc64 gcc complained.) 2006-10-23 03:18:30 +00:00
christos
d6a795f6a8 put back the comparison in a lint friendly way to appease pooka. 2006-10-23 03:13:13 +00:00
dogcow
acba3dfe4b comment out comparison of unsigned expression to >= 0 2006-10-23 03:11:53 +00:00
christos
7ef97c92be use portable prints 2006-10-23 03:10:09 +00:00
pooka
718426155f still check for array bounds, fix off-by-one 2006-10-23 01:36:13 +00:00
christos
bc7a8f1f3d fix a lint warning. 2006-10-23 01:23:42 +00:00
christos
b6f6a56052 pass lint; fix install. 2006-10-23 00:22:24 +00:00
dogcow
8f7efdd62a add the .include <bsd.own.mk>, so .d and .o files don't end up in the CWD.
remove INCDIR=/usr/include, as my leenooks system doesn't have puffs .h files.
2006-10-22 23:51:37 +00:00
pooka
1635cf06bc add libpuffs - the userspace programming interface for puffs
This work was initially started and completed for Google SoC 2005
and tweaked to work a bit better in the past few weeks.  While
being far from complete, it is functional enough to be able and
stable to host a fairly general-purpose in-memory file system in
userspace.  Even so, puffs should be considered experimental and
no binary compatibility for interfaces or crash-freedom or zero
security implications should be relied upon just yet.

The GSoC project was mentored by William Studenmund and the final
review for the code was done by Christos.
2006-10-22 22:52:21 +00:00