History log of /haiku/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.h
Revision Date Author Comments
# 49a00a12 20-Jul-2022 PulkoMandy <pulkomandy@pulkomandy.tk>

userlandfs: implement get_fs_info using ioctl

This avoids introducing an entirely custom hook in FUSE.
It uses the ioctl hook in an unconventional way (calling it with no
valid fuse_file_info) but this can be fixed if a filesystem requires it
(by opening a file handle on /, doing the ioctl, then closing again).

An updated version of fusesmb-haiku is available and confirmed working:
https://github.com/haikuarchives/fusesmb-haiku

Change-Id: If1268113874363fa035e5340be75e9f5198216d6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5199
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 0604d554 06-Jun-2022 PulkoMandy <pulkomandy@pulkomandy.tk>

userlandfs: compatibility with FUSE 2.9 and FUSE lowlevel API

- Import latest version of files from FUSE 2.9.9 (our last
synchronization was with 2.7.4)
- Adjust fuse pkgconfig file to use the POSIX error mapper
automatically, since that's required for all FUSE software
- Implement the lowlevel API in addition to the highlevel one. The
lowlevel API uses inode numbers to identify files, rather than paths,
making it a better fit to the userlandfs architecture.

The FUSE 2.x branch is not maintained anymore by FUSE developers,
however, pretty much no one migrated to FUSE 3.x. So it is more
interesting to implement, rather than 3.x.

Confirmed still working with sshfs and curlftpfs.

Example use:

I tested this with github.com/whoozle/android-file-transfer-linux

- Build the fuse library and copy it to ~/config/non-packaged/add-ons/userlandfs/
- Start the server: /system/servers/userlandfs_server aft-mtp-mount
- Connect your Android phone and put it in USB file transfer mode
- Mount the device: mount -t userlandfs -p 'aft-mtp-mount /boot/home/MyPhone -d -o use_ino' ~/MyPhone
- You can now access your phone data

Change-Id: Ic3efda7ffbc33737e6f4958428fb3ec9939ef105
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5198
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 861dbb48 08-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented more of the detailed FUSE initialization functions for file systems
that use them directly instead of fuse_main().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30024 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e66cd9d7 02-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* For every request to userland we also send the team/thread/user/group ID of
the current thread, now. Implemented by introducing a new base class
KernelRequest which has respective attributes.
* Server: RequestThreadContext does now also save the request that is being
processed. Furthermore some space has been reserved for file system specific
data, which can be initialized by the new
FileSystem::InitRequestThreadContext().
* FUSE library: Implemented fuse_get_context() using the new
RequestThreadContext feature.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29872 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a7731138 02-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Initialize fuse_config before parsing the arguments.
* Implemented fuse_is_lib_option() more correctly.
* Actually use the value of the "use_ino" option.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29871 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 39f2d9e6 31-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Parse the FUSE library options. They aren't used yet, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29844 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f06f7337 19-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* More work on the file system initialization. Mounting/unmounting works now
with sshfs.
* Added basic node and entry management, which we need, since the FUSE
interface works with paths only, while our VFS plays with node IDs and
node cookies.
* Implemented most of the mandatory hooks (vnode operations, lookup, read stat,
open/close/read dir). I was hoping to get directory listings with sshfs now,
but as I had to find out, it implements the deprecated getdir() while we
only support the new {open,read,release}dir() interface yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29619 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1d077f83 19-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added "fuse_api.h" header wrapping the inclusion of <fuse.h>.
* Implemented the fuse_fs_*() functions.
* More work on the initialization procedure for the client file system. We do
now start a separate thread which calls the main() function. It won't return
from fuse_main_real() until unmounting the FS. We create a fuse_fs structure
and call the client FS initialization and cleanup hooks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29613 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 69cd702b 19-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Pass the file system name to the FileSystem base class and store it there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29610 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c9323289 18-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added FileSystem and Volume subclasses for the FUSE interface. ATM they are
mostly skeletons, doing a bit of initialization.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29604 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 861dbb4810c94214c9e00837e4a1704f8050e62e 08-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented more of the detailed FUSE initialization functions for file systems
that use them directly instead of fuse_main().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30024 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e66cd9d71b0ae8fe311674bf7b87cb26d7452b61 02-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* For every request to userland we also send the team/thread/user/group ID of
the current thread, now. Implemented by introducing a new base class
KernelRequest which has respective attributes.
* Server: RequestThreadContext does now also save the request that is being
processed. Furthermore some space has been reserved for file system specific
data, which can be initialized by the new
FileSystem::InitRequestThreadContext().
* FUSE library: Implemented fuse_get_context() using the new
RequestThreadContext feature.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29872 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a7731138040434ec1fccf01e6c09c70311e550e3 02-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Initialize fuse_config before parsing the arguments.
* Implemented fuse_is_lib_option() more correctly.
* Actually use the value of the "use_ino" option.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29871 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 39f2d9e66b76c701467bb211a0229ee63fced5a5 31-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Parse the FUSE library options. They aren't used yet, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29844 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f06f733751a4f6013ba903906e0b6302f37e3413 19-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* More work on the file system initialization. Mounting/unmounting works now
with sshfs.
* Added basic node and entry management, which we need, since the FUSE
interface works with paths only, while our VFS plays with node IDs and
node cookies.
* Implemented most of the mandatory hooks (vnode operations, lookup, read stat,
open/close/read dir). I was hoping to get directory listings with sshfs now,
but as I had to find out, it implements the deprecated getdir() while we
only support the new {open,read,release}dir() interface yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29619 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1d077f8397a3a222cf62d3c197ad5af5bfb48967 19-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added "fuse_api.h" header wrapping the inclusion of <fuse.h>.
* Implemented the fuse_fs_*() functions.
* More work on the initialization procedure for the client file system. We do
now start a separate thread which calls the main() function. It won't return
from fuse_main_real() until unmounting the FS. We create a fuse_fs structure
and call the client FS initialization and cleanup hooks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29613 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 69cd702b39187815d61ca260bb08df759f2f352e 19-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Pass the file system name to the FileSystem base class and store it there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29610 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c93232896fd255f40f571e1a88c66bd34ebbef16 18-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added FileSystem and Volume subclasses for the FUSE interface. ATM they are
mostly skeletons, doing a bit of initialization.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29604 a95241bf-73f2-0310-859d-f6bbb57e9c96