Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

Fuse::Channel Class Reference

Collaboration diagram for Fuse::Channel:

Collaboration graph
[legend]
List of all members.

Detailed Description

Communication channel to FUSE kernel module.

Fuse.Channel communicates with the FUSE kernel module. Each Channel instance is tied to a filesystem mount point.

When a channel receives a request from the kernel, it decodes the request header and emits the Channel.OnNewCommand event. The event contains one argument - an Operation. The Operation specifies which filesystem is involved, the command header, and the buffer of further data related to the request.

OnNewCommand is emitted using an asynchronous callback, so subscribers should be thread safe. TODO: this might be configureable in the future..

A Channel controls a single mount-point. Multiple Channel instances may be created and served by either a single Reactor, or multiple Reactor instances. A separate thread will be required for each Channel instance's event loop, since there is currently no support for multiplexing Channel event loops.

Author:
Valient Gough


Public Member Functions

delegate object ProcessCommand (Operation op)
delegate void SignalingEvent (Channel ch)
 Channel (string mountPoint, FileSystem fs)
bool EventLoop ()
void Mount (params string[] options)
void Unmount ()

Static Public Member Functions

static void Usage ()

Public Attributes

event ProcessCommand OnNewCommand
event SignalingEvent ShutdownEvent
 emitted when channel is shutting down

Properties

string MountPoint


Constructor & Destructor Documentation

Fuse::Channel::Channel string  mountPoint,
FileSystem  fs
[inline]
 

Instanciate a channel for the given filesystem mount point.

This tells FUSE that we will implement the filesystem at the specified mount point.

Parameters:
mountPoint A fully qualified directory name which will be the root of the filesystem.
fs The filesystem this channel will serve. One channel per filesystem.


Member Function Documentation

bool Fuse::Channel::EventLoop  )  [inline]
 

Waits for events, and does not return until the filesystem is unmounted.

Normally this should not be used directly - see Reactor which provides a higher level interface.

Returns true if exited normally.

delegate object Fuse::Channel::ProcessCommand Operation  op  ) 
 

Command processing delegate.

Process an operation and return a result object. What's done with the result will depend on its type. The following are handled:

  • (null) : no result sent for operation
  • (int) : an error code to return to the caller
  • (BufferWritable) : error code 0, encode buffer as reply
  • (Transactional) : play transaction, send result
  • anything else: return generic error code to caller

Warning:
The kernel expects particular types for each request. Not every request can return every possible type. Commands which do result in a return value return either an error code (int), or a writable object (either BufferWritable or Transactional).

static void Fuse::Channel::Usage  )  [inline, static]
 

abuse fuse_main to have it show usage information. Unfortunatly, libfuse will then directly call exit(), so we can't continue after this..


Member Data Documentation

event ProcessCommand Fuse::Channel::OnNewCommand
 

event handler for new commands.. Every time a command is received from the kernel, it is emitted using this event.


The documentation for this class was generated from the following file:
Generated on Wed May 18 23:16:50 2005 for SULF by  doxygen 1.4.3