Commit Graph

11869 Commits

Author SHA1 Message Date
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
christos 19468d62cc More fixes:
- make sure that the args array is NULL terminated.
- make sure argc is initialized and argv is set to NULL after freeing.
- make the deep copy function an opt interface function.
2007-05-17 01:55:43 +00:00
xtraeme b18c74c93e Add the $NetBSD$ tag, it's easier to know what revision you have. 2007-05-16 22:17:52 +00:00
christos c0df99a133 - Always check strdup return. For now we are lazy and bail instead of cleaning
up.
- Use malloc and free instead of macros, delete macros.
- Merge the two copies of deep copy and free args that were slightly buggy
  into one and use that one.

XXX: Lots of ints should be size_t.
XXX: Bailing on error is not a good thing for a library.
XXX: Defs.h should be eliminated completely. Not all files need all the headers.
2007-05-16 21:39:08 +00:00
agc 9ceda06dfa The FUSE_USE_VERSION is the definition which the user sets, and which
determines the API.

Provide a default for FUSE_USE_VERSION if it's not set, and use this
value to determine the number of arguments given to fuse_main().
2007-05-16 21:37:18 +00:00
pooka 71bc398720 Enable puffs_fakecc. FUSE file systems don't use continuations anyway,
and now file servers linked against libpthread won't crash when they
attempt to malloc something.
2007-05-16 10:53:41 +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
agc dcd3457a33 When parsing arguments for the directory to mount, search backwards from
the end of the argument vector for an argument that doesn't begin with '-',
and use it - this improves upon the previous naive approach of using the
last argument, which could have been placed there by one of the argument
appending functions.

Be consistent with the mount name processing, and always do the
puffs:refuse:filesystem substitution once and once only.

% priv mount.ntfs-3g ntfs-refuse.img /mnt
% df /mnt
Filesystem           1K-blocks      Used     Avail Capacity  Mounted on
puffs:refuse:ntfs-3g   1000943     66309    934634     6%    /mnt
% priv umount /mnt
% priv /usr/src/share/examples/refuse/id3fs/id3fs /mnt &
% df /mnt
Filesystem         1K-blocks      Used     Avail Capacity  Mounted on
puffs:refuse:id3fs         0         0         0   100%    /mnt
% priv umount /mnt
%
2007-05-15 22:56:16 +00:00
agc 01b98414eb Fuse version 2.6 (and above) has a 4 argument version of fuse_main(),
whereas previous versions had a 3 argument one. Accept both.
2007-05-15 22:47:35 +00:00
agc a6521ab14a When puffs_mount fails, display the name of the directory which wasn't
able to be mounted.
2007-05-15 22:46:06 +00:00
skrll 795d937239 All platforms are MD_DO_NOT_NEED_FALLTHRU now so no need to keep it
conditional.
2007-05-15 16:51:37 +00:00
skrll c97173f648 MD_DO_NOT_NEED_FALLTHRU for amd64.
Thanks to Juan Romero Pardines for testing.
2007-05-15 16:48:13 +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
christos f8178c49fa use syslog_r, from OpenBSD 2007-05-10 18:44:24 +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
he e085b08462 The sl_delete function needs namespace protection added here as well. 2007-05-10 11:52: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
christos 36a3340867 PR/36299: Greg Woods: Add namespace protection for sl_delete. 2007-05-09 17:10:29 +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
ad 9ccfa416c9 Remove pointless AUTHORS sections. 2007-05-05 19:16:01 +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
rmind ed3e2de27c Add aio_cancel(3), aio_error(3), aio_read(3), aio_return(3), aio_suspend(3),
aio_write(3) and lio_listio(3) man-pages for asynchronous I/O.
Taken from FreeBSD with modifications for NetBSD implementation.

wizd, please! :)
2007-05-04 22:37:33 +00:00
agc 76c020111a ...and include fuse_opt.h in the correct place. 2007-05-03 21:13:25 +00:00
agc 363bf2c052 Implement fuse_setup(), and fuse_teardown() - necessary for the python
bindings for refuse.
2007-05-03 21:02:54 +00:00
agc a2b7c5e9b3 FUSE includes fuse_opt.h from fuse.h, albeit indirectly, via fuse_common.h.
Refuse doessn't have a fuse_common.h, so include fuse_opt.h explicitly
from fuse.h.  To avoid circular dependencies, don't include fuse.h
from fuse_opt.h.

This means that we no longer have to modify packages which use the argument
and option parsing routines to include fuse_opt.h.
2007-05-03 20:58:22 +00:00
ad e7c35aabc9 Remove obsolete comment. 2007-05-02 21:54:16 +00:00
pooka 80dbf44035 In case a fuse fs hands an stbuf with an inode number 0 to the
readdir filler, fake the inode number.  Our readdir() doesn't show
entries with inode number 0.

per discussion with Stephen Borrill
2007-05-02 18:05:54 +00:00
pooka f5ef068cda use PUFFS_FLAG_HASHPATH 2007-05-01 15:58:25 +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
dsl 7effc1a79d Set kp2p->p_ru = 0 in the kproc2 structure.
It was only ever non-zero for zombies, and now doesn't exist.
The 'pstats' field has been valid for zombies for a while (it isn't in
the uarea any more).
Fixes part of build breakage.
2007-05-01 06:58:08 +00:00
rmind 0994dd0691 - Create sysctl nodes for AIO.
- Add POSIX defined system variables and constants of AIO_LISTIO_MAX and
  AIO_MAX values.  Both with _POSIX_ASYNCHRONOUS_IO, provide them in
  sysconf(3) and getconf(1) interfaces.
- Clean up sysconf(3) for handling sysctl nodes dynamically.
2007-05-01 01:01:25 +00:00
rmind 67d703cf25 Import of POSIX Asynchronous I/O.
Seems to be quite stable. Some work still left to do.

Please note, that syscalls are not yet MP-safe, because
of the file and vnode subsystems.

Reviewed by: <tech-kern>, <ad>
2007-04-30 14:44:28 +00:00
msaitoh 8ce1f4fff2 fix typos 2007-04-29 20:23:34 +00:00
tnozaki 6a1c27dd91 fix typo. 2007-04-24 15:42:08 +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
matt ec31ca5aa4 Mark some internal libm symbols as hidden 2007-04-19 00:37:20 +00:00
pooka 7cfb5f2d40 fix readdir prototype 2007-04-18 20:37:05 +00:00
matt ae3ada32fe Make the internal __libm_dsqrt_r6 have a fake entry mask of 0 to make
ld.elf_so.
2007-04-18 04:46:13 +00:00
heinz 9e9284adba Fixed spelling error. 2007-04-17 21:11:47 +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
agc 1e1fbd91da The error return code from fuse_opt_add_arg() and fuse_opt_insert_arg() is
actually -1, not 1. Fix the broken sewing machine, and make it sew.
2007-04-17 06:34:48 +00:00
xtraeme 2a9a16f24b Forgot to move the prototype in a comment to the correct place. 2007-04-17 00:25:21 +00:00
xtraeme 5ebefbd7c9 Sync comments with reality. 2007-04-17 00:23:23 +00:00
xtraeme b1f8749808 Wrap long lines. 2007-04-17 00:20:52 +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
agc 426de30578 Flesh out the args management a bit more:
+ put some meat into the add_arg and insert_arg functions
+ implement the free_args function
+ use 0 and 1 return values, instead of EXIT_SUCCESS and EXIT_FAILURE, in
  internal functions (they bear no relation to shell exit values)
+ deep copy argument structures in refuse.c - we need to do this because
  some FUSE file systems attempt to obliterate^Wcloak the argument vector
  "for security reasons"
+ a side benefit of this is that we get the specific refuse file system
  name back again:

[10:48:43] agc@inspiron1300 ...src/lib/librefuse 38 > df
Filesystem         1K-blocks      Used     Avail Capacity  Mounted on
/dev/dk0            28101396  19318530   7377798    72%    /
kernfs                     1         1         0   100%    /kern
procfs                     4         4         0   100%    /proc
ptyfs                      1         1         0   100%    /dev/pts
puffs:refuse:id3fs         0         0         0   100%    /mnt
[10:48:51] agc@inspiron1300 ...src/lib/librefuse 39 >
2007-04-16 09:55:51 +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
ad b5a5e72af1 Mirror a fix made to the kernel's condvars:
After resuming execution, the thread must check to see if it
has been restarted as a result of pthread_cond_signal().  If it
has, but cannot take the wakeup (because of eg a pending Unix
signal or timeout) then try to ensure that another thread sees
it.  This is necessary because there may be multiple waiters,
and at least one should take the wakeup if possible.
2007-04-12 21:36:06 +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 65ec9d356d Don't clobber callee save registers r12 & r13 in swapcontext. They
were saved in the stack, but the subsequent swapcontext would return
to the earlier stack frame and never restore them.  Fixes puffs
with default compiler flags on amd64.

Thanks to Mihai Chelaru for providing access to an amd64 machine
for debugging this problem.
2007-04-12 12:33:26 +00:00
lukem 2d50a59010 Use IEC 60027-2 prefixes for 2^n based prefixes. 2007-04-12 06:50:39 +00:00
pooka 7ed53cb9ec adapt to new readdir signature. no functional change 2007-04-11 21:10:49 +00:00
pooka 6b7023f08f * support nodetofh and fhtonode callbacks
* use new signature of node_readdir
2007-04-11 21:04:51 +00:00
plunky a7ea3f4e89 add const to the data for hid_use_report_desc() since it does
not modify the memory.
2007-04-11 20:56:20 +00:00
scw 5764a76889 Remove support for NetBSD/{,evb}sh5. 2007-04-08 09:35:21 +00:00
plunky 93d3f2eebc be nice, and linger to let the L2CAP connection close down gracefully 2007-04-07 21:08:46 +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
christos 79fa594887 Coverity CID/4454: Avoid double fclose. 2007-04-04 21:54:45 +00:00
christos 28712ce84b bring in FreeBSD's vfscanf() to gain multi-byte/collation support.
Unfortunately it is too difficult to make vfwscanf and this share
the same code like I did with printf, because for string parsing
the code is too different.
2007-04-01 19:23:55 +00:00
tnozaki fd2dd8ec0d add new encoding support to iconv(3):
- RISCOS-LATIN1
	- DEC-MCS
	- DEC-HANYU(libDECHanyu)
2007-04-01 18:52:28 +00:00
tnozaki a224676694 oops, fix miss-increment fp->_p. 2007-04-01 18:35:53 +00:00
tnozaki 4e9a549847 mbrtowc(3) never return correct multibyte length of L'\0'. 2007-04-01 17:49:10 +00:00
tnozaki 61c3ab2f95 don't use __sgetc() to avoid overwriting fwide(3) orientation
(__srget() call by __sgetc() uses _SET_ORIENTATION macro).
2007-04-01 17:11:40 +00:00
skrll bd529f8818 MD_DO_NOT_NEED_FALLTHRU for sh5. Compile tested only. 2007-03-31 21:12:37 +00:00
ghen 1c80da3072 Re-add missing file (removed by cvs import because it was added manually by
christos).

Hi Veego!
2007-03-30 20:40:52 +00:00
ghen 225c5452c3 Resolve conflicts. 2007-03-30 20:23:03 +00:00
ghen e0bee3891d Import bind 9.4.0. 2007-03-30 20:16:18 +00:00