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.
Nikolaus Rath [Sun, 2 Oct 2016 18:30:43 +0000 (11:30 -0700)]
Turn struct fuse_chan into an implementation detail
The only struct fuse_chan that's accessible to the user application is
the "master" channel that is returned by fuse_mount and stored in struct
fuse_session.
When using the multi-threaded main loop with the "clone_fd" option, each
worker thread gets its own struct fuse_chan. However, none of these are
available to the user application, nor do they hold references to struct
fuse_session (the pointer is always null).
Therefore, any presence of struct fuse_chan can be removed
without loss of functionality by relying on struct fuse_session instead.
This reduces the number of API functions and removes a potential source
of confusion (since the new API no longer looks as if it might be
possible to add multiple channels to one session, or to share one
channel between multiple sessions).
fuse_lowlevel_notify_*: take struct fuse_session instead of struct fuse_chan
The only struct fuse_chan that's available to the user application is
the one that is returned by fuse_mount. However, this is also
permanently available from struct fuse_session.
A later patch will therefore remove struct fuse_chan from the
public API completely. This patch prepares for this by changing the
fuse_lowlevel_notify_* functions to take a struct fuse_session
parameter instead of a struct fuse_chan parameter.
bobrofon [Thu, 4 Aug 2016 19:46:38 +0000 (02:46 +0700)]
Don't hardcode /sbin, /lib & /etc
Default values for MOUNT_FUSE_PATH, UDEV_RULES_PATH and INIT_D_PATH should be based on directory variables from GNU Coding Standarts.
Directory variables left unexpanded because installation directory options may be changed via "make install prefix=/foo".
There's no point in having tests failing all the time,
we will re-enable thread sanitizer once we have figured
out if the errors are bugs or false positives (and, if they
are bugs, fixed them).