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
%
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
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)
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.
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.
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.
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.
- 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.
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>
+ 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 >
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--
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.
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().
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.
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.
so avoid making them.
- When parking an LWP on a condition variable, point the hint argument at
the mutex's waiters queue. Chances are we will be awoken from that later.
the mutex that the waiters are using to synchronise, then transfer them
to the mutex's waiters list so that the wakeup is deferred until release
of the mutex. Improves the timings for CV sleep/wakeup by between 30-100%
in tests conducted locally on a UP system. There can be a penalty for MP
systems when only one thread is being awoken, but in practice I think it
won't be be an issue.
- pthread_signal: search for a thread that does not have a pending wakeup.
Threads can have a pending wakeup and still be on the waiters list if we
clash with an earlier pthread_cond_broadcast().
be used only as as a hint. Clear the pointer when releasing the mutex.
- When releasing a mutex, wake all waiters. Makes it possible to tranfer
waiters from another object to a mutex.
CPPPICFLAGS obly affect *.s sources only,
but we want -D_I18N_DYNAMIC flag for *.c source
(src/lib/libc/citrus_module.c and so on).
use CPICFLAGS instead.
this fix suggested by tsutsui-san in current-users@, thanks.
shell in the fuse_opt functions
+ add new debugging functions:
+ __fuse_debug(), which is used to set and retrieve the
debugging level, so that debugging information can be turned
on and off from the user-level filesystem, and
+ __fuse_pargs(), which prints out an argv vector
+ put the comment about pu_privdata back with the code it references
+ put the code to place the refuse name back into the fuse_new()
function - we have access to all the arguments there.
+ specifically include <fuse_opt.h> in <fuse.h> - this would seem to
be what FUSE itself does, judging by the number of fuse-based
filesystems I've patched to include <fuse_opt.h> specifically
+ do away with the forward reference to struct fuse_args in fuse.h,
since it is defined just after the forward reference without being
referenced in between
+ fill in the missing refuse_opt args functionality - add an arg to the
args structure in fuse_opt_add_arg() and fuse_opt_insert_arg(), and
free allocated memory in fuse_opt_free_args().
+ get rid of spurious forward declarations and prototypes.
+ if REFUSE_INHERIT_FS_CHARACTERISTICS is defined when refuse is built,
file systems inherit the vfs characteristics of their mountpoints. The
default value is NOT to inherit the vfs characteristics.
+ perform a deep copy of the fuse_args structure in fuse_mount() -
this is so that existing FUSE filesystems still DTRT when arguments
are zeroed out.
* Move fuse_opt* funcs from refuse.c into refuse_opt.c.
Implement fuse_opt_parse() and fuse_opt_match(). And make the other
functions just dummy, always returning 0 (I added debugging printfs
to see what the application is trying to do).
For now there are two things that do not work in fuse_opt:
* options accepting arguments, i.e -otimeout=%u or -ofile=%s.
* options without arguments are not enabled, just parsed.
At least now curlftpfs works, even with verbose mode! :-)
Ok'ed by pooka.
is implemented as a very dummy version (i.e. totally unimplemented),
so some effort is still needed there.
After this change it is possible to compile and run ntfs-3g. It
works read/write for ntfs images and shows no faults at least with
superficial testing. I did not test it against a block device,
only an image.
Thanks to Tracy and Jason for help with the test image.
fuse does it: read directory completely into refuse buffers if starting
from read offset 0 and for later calls trickle results from the buffers
to the kernel without consulting the fuse file system.
conflict with C99 functions which are builtins in newer gcc
(actually, the old cabs() is ABI compatible with the new _complex one
on i386, but this is purely accidental)
remove public prototypes and manpages, move the code into a compat
subdirectory as libc does so that binary compatibility is kept
-add a manpage for the isgreater() etc macros, borrowed from FreeBSD
through fuse_file_info to the fuse open operation.
* reference count opens for each node and do release once the count
drops to zero (instead of waiting for inactive). I'm still not sure
if this exactly matches linux/fuse behaviour, but at least we do
open when a new file descriptor is opened for each node and a do
a release when the reference to the last file descriptor for a
node is closed, so it ought to be pretty close
cryptofs works after these changes
* make set/getattr easily callable from interface functions and sprinkle
calls to locations which require them
* use libpuffs routine for stat->vattr translation instead of homegrown one
* I have concluded that we really want to do release/releasedir in
inactive instead of reclaim. make it so. we'll tweak it for the next
file system which decides it doesn't want to work
after these changes lzofs works, at least for most parts
(I'd assume the non-working parts to fail also on fuse/linux)
ops specified in the fuse op vector (or, if they're missing,
we're SOL)
* great return value overhaul: return -ret to get linuxy -errno
right for the kernel
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
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