On Tue, Sep 3, 2013 at 11:06 AM, Goswin von Brederlow <goswin-v-b@...> wrote:
> On Fri, Aug 30, 2013 at 12:22:46PM +0200, Miklos Szeredi wrote:
>> On Thu, Aug 22, 2013 at 5:49 PM, Goswin von Brederlow <goswin-v-b@...> wrote:
>> > I imagine the following should work:
>> > - fuse_file_info::fh is the fusemod's own private data
>> > - on open the fuse_file_info::fh from the real filesystem (or other
>> > modules) is passed back to the fusemod for encapsulation in the
>> > fusemods private data.
>> > - the fusemod must register an un-encapsulate function. This is used
>> > to restore the original fuse_file_info::fh for the real filesystem or
>> > next module in the sack on unimplemented callbacks.
>> > - on callbacks the fusemod has to un-encapsulate the fuse_file_info::fh
>> > (or should that use the registered un-encapsulate function automatically?
>> > Note: If no un-encapsulate function is registered then the fuse_file_info::fh
>> > must not be altered by the fusemod and is simply passed through.
>> No need to register anything. The fusemod can encapsulate the next
>> filesystem's fh in its own private data in ->open() and in all the
>> rest it can decapsulate it and set fi->fh before calling
>> fuse_fs_foo(..., fi).
> Then it has to implement every callback, including future ones, just to
> decapsulate the fh. The registering is ment for callbacks the module
> does not implement but the filesystem does.
There's no default pass-through behavior on module callbacks. If an
operation is not implemented in a module, the behavior is the same as
if the operation was not implemented in the filesystem.