Commit Graph

21 Commits

Author SHA1 Message Date
dillo 2a16dc1a4e Add API version 2.6 variant of fuse_setup.
Reviewed by agc.
2008-08-01 15:54:09 +00:00
pooka 86499e8154 Remove puffs_ops from fuse_operations, no reason for it to be there. 2008-01-14 20:46:11 +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
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 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
agc 950c7ae274 Revert the most recent changes I made - they weren't ready for primetime. 2007-03-13 22:47:03 +00:00
agc e7d3032061 + Only use EXIT_SUCCESS and EXIT_FAILURE for the return code to the
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.
2007-03-13 20:50:47 +00:00
xtraeme c7b91b596f * Move fuse_opt* defs and prototypes into fuse_opt.h.
* 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.
2007-02-28 16:23:00 +00:00
pooka 03c5e15dc2 Refactor a few interfaces a bit to look more like fuse. fuse_args
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.
2007-02-26 15:57:33 +00:00
pooka 1b5f35a8e4 Implement readdir properly, or at least as close to possible to how
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.
2007-02-26 13:52:16 +00:00
pooka 838ac147aa Implement a very very stubby fuse_unmount(), which does ... nothing.
Pending some puffs changes that are in the queue, this is the best way
currently.
2007-02-19 23:12:29 +00:00
pooka a24db39ba5 move getdir() location to match layout of real fuse operations 2007-02-18 18:47:40 +00:00
agc 3d88835937 Added extra functionality:
fuse_opt_free_args()

	fuse_exit()

Both from Juan RP - thanks!
2007-02-18 17:44:57 +00:00
pooka 99f9488df4 Implement a very very hacky fuse_get_context(), needs to be visited once
threading is added (and probably otherwise also).
2007-02-15 10:54:40 +00:00
pooka f3a3462b84 implement getdir, used by some older fuse file systems instead of readdir 2007-02-11 11:57:41 +00:00
agc 4cccedc203 Add an implementation of the file system in userspace functionality,
based on top of libpuffs.  This version is still barebones and
incomplete, but will benefit from others working on it, rather than
just me.

The option code has still to be implemented, but this gets far enough
to run hellofs (from the fuse web page):

	% priv ./hellofs ~/hellofs/mnt &
	% l ~/hellofs/mnt
	total 2
	drwxr-xr-x  2 root  wheel    0 Jan  1  1970 .
	drwxr-xr-x  4 agc   agc    512 Feb  9 18:05 ..
	-r--r--r--  1 root  wheel   13 Jan  1  1970 hello
	% cat ~/hellofs/mnt/hello
	Hello World!
	% df ~/hellofs/mnt
	Filesystem           1K-blocks      Used     Avail Capacity  Mounted on
	/dev/dk0              28101396  18946682   7749646    70%    /
	kernfs                       1         1         0   100%    /kern
	procfs                       4         4         0   100%    /proc
	ptyfs                        1         1         0   100%    /dev/pts
	puffs:refuse:hellofs  28101396  18946682   7749646    70%    /home/agc/hellofs/mnt
	% mount -v -v
	...
	mount: mount_puffs not found for /home/agc/hellofs/mnt
	puffs:refuse:hellofs on /home/agc/hellofs/mnt type puffs (nosuid, nodev, fsid: 0xcb01/0x6acb, reads: sync 0 async 0, writes: sync 0 async 0)
	%

This code is not enabled by default. Yet.
2007-02-11 10:31:37 +00:00