Consus [Thu, 20 Oct 2016 13:08:49 +0000 (16:08 +0300)]
Do not close stdout on fuse_session_destroy()
If fuse_session_mount() fails (or was never called in the first place)
we end up with the default fd value which happens to be 0. It hurts
long-running processes, which lifetime extends beyond session's
lifetime.
Nikolaus Rath [Sun, 16 Oct 2016 21:28:47 +0000 (14:28 -0700)]
Inlined fuse_mount_help() into fuse_lowlevel_help().
Both the BSD and Linux implementation actually accept mostly the same
FUSE-specific mount options. Up to now, the BSD help function appended
the output of ``mount_fusefs --help``, but looking at
http://www.unix.com/man-page/freebsd/8/mount_fusefs/ this is likely more
confusing than helpful (since the user is not actually invoking
mount_fusefs directly, most of the options don't make sense).
Nikolaus Rath [Sun, 16 Oct 2016 21:12:39 +0000 (14:12 -0700)]
Updated man-pages.
* Removed -o nonempty
* Added -o noforget
* Split into high-level / low-level
* Added warning that most options should be chosen by file system
internally.
* Updated maintainer.
Nikolaus Rath [Sun, 16 Oct 2016 02:46:57 +0000 (19:46 -0700)]
Make --help output more suitable for end-user
We now only list options that are potentially useful for an
end-user (and unlikely to accidentally break a file system). The full
list of FUSE options has been moved to the documentation of the
fuse_new() and fuse_session_new() functions.
Nikolaus Rath [Sat, 15 Oct 2016 23:09:16 +0000 (16:09 -0700)]
Unify handling of fuse_conn_info options
Instead of using command line options to modify struct fuse_conn_info
before and after calling the init() handler, we now give the file system
explicit control over this.
Nikolaus Rath [Mon, 10 Oct 2016 22:52:15 +0000 (15:52 -0700)]
do_init(): treat command line options consistently
Previously, some command line options would change the FUSE defaults
but leave the final value to the file systems `init` handler while
others would override any changes made by `init`. Now, command line
options do both: they modify the default, *and* take precedence.
Nikolaus Rath [Tue, 11 Oct 2016 03:21:45 +0000 (20:21 -0700)]
Move session options into sub-struct
The session options are used only once to determine the proper
conn->want flags. It is nice to have them clearly separated from the
other struct fuse_session members that are used throughout the life of
the file system.
Nikolaus Rath [Mon, 10 Oct 2016 18:18:00 +0000 (11:18 -0700)]
Fix race condition in notify_* examples
The fix in commit cf4159156b was incomplete. While some false positives
are caused by sleep() in the file system taking longer than expected,
there was also a race condition where the file system would run before
the contents are initialized properly.
Nikolaus Rath [Mon, 10 Oct 2016 16:38:20 +0000 (09:38 -0700)]
fuse_main(): extend support for printing help
There's now a way to inhibit the "usage" line (which actually got lost
in commit 225c12aebf2d), which makes it easier for simply file-systems
to generate good-looking --help output.
Nikolaus Rath [Mon, 10 Oct 2016 04:05:54 +0000 (21:05 -0700)]
Renamed cuses example and added test program
An earlier version of the fioclient.c example was intended to be
used together with cusexmp.c. The former has since evolved into
ioctl_client.c and no longer has the function necessary to test
CUSE. Therefore, we've added a new cuse_client.c that is clearly
associated with the cuse.c example file system.
Nikolaus Rath [Sat, 8 Oct 2016 04:08:40 +0000 (21:08 -0700)]
Removed ``-o big_writes`` option
This option is obsolete and should always be enabled. File systems that
want to limit the size of write requests should use the
``-o max_write=<N>`` option instead.
Nikolaus Rath [Wed, 5 Oct 2016 04:04:18 +0000 (21:04 -0700)]
Merge struct fuse_ll into struct fuse_session.
This merge merges struct fuse_ll into struct fuse_session. Since
there is always a one-to-one correspondence between the two,
there is little reason to keep them separate. By merging them,
we save pointers and lines of code.
Nikolaus Rath [Tue, 4 Oct 2016 03:23:42 +0000 (20:23 -0700)]
fuse_lowlevel_notify_poll(): use master channel
In theory, a poll handle could hang around much longer than the worker
thread that creates it. Furthermore, the thread that created the
pollhandle is no more likely to call fuse_lowlevel_notify_poll() than
any other thread.
In theory, this would have kept the channel alive for much longer than
necessary. In practice, there seems to have been a bug that prevented
this - and instead allowed the channel to be destroyed while there
was still a pollhandle referring to it.
Instead of fixing this by calling fuse_chan_get() and fuse_chan_put() in
do_poll() and fuse_pollhandle_destroy(), we simply transmit poll
notifications over the master channel now.
Nikolaus Rath [Mon, 3 Oct 2016 04:22:02 +0000 (21:22 -0700)]
Merged fuse_session.c into fuse_lowlevel.c
This distinction no longer makes sens. fuse_lowlevel.c already contains
several session related functions, and fuse_session.c contains various
stuff that is more related to the channel interface.
Nikolaus Rath [Mon, 3 Oct 2016 03:52:33 +0000 (20:52 -0700)]
Don't handle --help and --version in fuse_session_new().
Help and version messages can be generated using the new
fuse_lowlevel_help(), fuse_lowlevel_version(), fuse_mount_help(), and
fuse_mount_version() functions.
The fuse_parse_cmdline() function has been made more powerful
to do this automatically, and is now explicitly intended only
for low-level API users.
This is a code simplication patch. We don't have to parse for --help and
--version in quite as many places, and we no longer have a low-level
initialization function be responsible for the (super-high level) task
of printing a program usage message.
In the high-level API, we can now handle the command line parsing
earlier and avoid running other initialization code if we're just going
to abort later on.