aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-02 11:30:43 -0700
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-02 13:56:40 -0700
commit5698ee09cf7a8495da70659ffae1eaec9f57db27 (patch)
tree798a58a4f49d7f82e3f948463daad4405173483e /doc
parentf164e9b8ca319dd1279384ff495b5fa91e778d9e (diff)
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). Fixes issue #17.
Diffstat (limited to 'doc')
-rw-r--r--doc/developer-notes.rst28
1 files changed, 0 insertions, 28 deletions
diff --git a/doc/developer-notes.rst b/doc/developer-notes.rst
index 4e9b31a..1df082a 100644
--- a/doc/developer-notes.rst
+++ b/doc/developer-notes.rst
@@ -5,31 +5,3 @@
If you are working on libfuse itself (rather than using it for a
different project) this file should be of interest to you. Otherwise
you should ignore it entirely.
-
-Channel Interface
-=================
-
-From the API, it may appear as if every fuse session (`struct
-fuse_session`) is associated with a single fuse channel (`struct
-fuse_chan`) that is created by `fuse_mount()` and assigned to the
-session in `fuse_session_add_chan()`. Therefore, one may wonder why
-there are two separate structs in the first place, and why the channel
-structure has a reference counter and mutex.
-
-The answer is that when using the multi-threaded session loop with the
-*clone_fd* option enabled, there are actually multiple channel objects
-per session. The session only holds a reference to the first one, and
-the additional channel objects don't actually hold references to the
-session object -- but they still exist. The additional channels are
-created by duplicating the fd (in `fuse_clone_chan()`, called by
-`fuse_loop_start_thread`). When processing a request,
-`fuse_session_process_buf()` records the active channel in the request
-object (`struct fuse_req`) so that it can be retrieved by e.g. the
-``fuse_reply_*`` functions. Since the request object can potentially
-live longer than the worker thread that created it, we need to keep a
-reference count for the channel.
-
-The reason for not having references to the session object from the
-extra channels is not clear, but with the current implementation this
-would not work because `fuse_session_remove_chan` always attempts to
-remove the channel from the session.