Commit Graph

173 Commits

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