History log of /haiku/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEVolume.cpp
Revision Date Author Comments
# 41a1732d 30-Jan-2024 Augustin Cavalier <waddlesplash@gmail.com>

userlandfs: Disable use of the file cache in FUSE for now.

It still needs more work, it appears.

Fixes #18746.


# d385686c 30-Jan-2024 Augustin Cavalier <waddlesplash@gmail.com>

userlandfs: Make DoIO handle IO smaller than the request size properly.

When _InternalIO returns with "bytes" smaller than the
original request, this isn't an error (or something we
should retry), but just something we need to pass on.

Fixes part of #18746. However, even after this commit,
file reads don't work quite right: reading past the end
of a file returns errors instead of just no data.


# 55f3abb4 28-Mar-2023 Trung Nguyen <trungnt282910@gmail.com>

userlandfs: Support mapping FUSE files to memory

- Create a file cache for FUSE mounted files on open to allow
memory mapping these files unless direct_io is specified.
- Implement DoIO for FUSE mounted files.

This patch enables files mounted through FUSE filesystems such as
sshfs or vmhgfs to be `mmap`ed, allowing remotely cross-compiled
executables to be directly run on Haiku.

Change-Id: I364b8225eae5b1d586280c2b3301fb661581caed
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6277
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 35212f7b 25-Mar-2023 Trung Nguyen <trungnt282910@gmail.com>

userlandfs: Fix GetVNodeName

- VNode names are now allowed to have a length of 1. This is
common for Windows drives mounted through a shared filesystem.
- Empty VNode names are now checked from the userland side,
preventing the kernel driver to reject and not ACK a false
B_OK from the userland server.

Change-Id: If0a6fcea1387367d1492c9b94c62c03e381ce1c1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6276
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 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>


# f0ee02b2 17-Jul-2022 PulkoMandy <pulkomandy@pulkomandy.tk>

userlandfs_fuse_lowlevel: fix opening directories in Tracker

- It is possible to call open() on a directory, but FUSE lowlevel
filesystems don't implement that and expect it to be re-routed to the
opendir call. BRoster uses this to read the dir/file attributes to
identify it, so it could not identify directories properly.
- In ReadDir, make sure to not return more entries than asked, as this
confuses the userlandfs protocol communication (the kernel does not
acknowledge the readdir reply, and then the server hits an assert when
receiving the next request instead of the ack).

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


# 03f7a184 16-Jul-2022 PulkoMandy <pulkomandy@pulkomandy.tk>

userlandfs-fuse: improve fuse_ll_readdir

The previous implementation needed a temporary buffer to store entries
and then sent them to the actual readdir buffer. This is now fixed, the
actual buffer is filled directly.

Also fixes problems with reading the same directory multiple times, and
reading large directories.

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


# 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>


# 711e2dc0 01-Dec-2021 Augustin Cavalier <waddlesplash@gmail.com>

Adjust all struct dirent creations (again), this time to use offsetof().

The dirent struct is not packed, so offsetof(dirent, d_name) != sizeof(dirent).
Thus in order not to waste the alignment bytes (which are significant,
on x86_64 at least, sizeof(dirent)==32, but offsetof(...)=26.)

This is also the most portable way to handle things, and should
work just fine in cross-platform code that has a non-zero-sized d_name.


# d9df2567 18-Nov-2021 Augustin Cavalier <waddlesplash@gmail.com>

FUSEVolume: Add a ROUNDUP() macro and use it.

No functional change intended, but this should make the code
easier to read.


# 9d242fb9 18-Nov-2021 Augustin Cavalier <waddlesplash@gmail.com>

file_systems & Tracker: Do not assume sizeof(dirent) contains 1 byte for the name.

At present, it does, but that is an oddity we have preserved from BeOS
that the next commit is going to remove. (This commit thus wastes 1 byte
without the following one.)

Most changes are pretty straightforward: only a +1 is needed,
and a few removed from sizing calculations. Some filesystems like UDF
originally passed back the length with the \0 included, so they have
been adjusted further. UFS2 had some other sizing problems which are also
corrected in this commit.


# 69d16976 15-Jun-2020 Murai Takashi <tmurai01@gmail.com>

userlandfs/server/fuse: Fix PVS V773

Fix FUSEVolume::OpenAttr() was exited
without releasing the 'cookie' pointer.

Change-Id: I8bf08268c77e1c9704227b1d4c7c94ddcc8b09a3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2947
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# d938c711 13-Feb-2019 Murai Takashi <tmurai01@gmail.com>

userlandfs/server/fuse: Fix potential memory leak

* Fix potential leak of 'cookie' at line 2206, which is allocated
at line 2203. Pointed out by Clang Static Analyzer.
* Add NULL check to 'cookie'.

Change-Id: Ibfdbe3a52ceb0d29adf1acca51fb7b27d2c532f3
Reviewed-on: https://review.haiku-os.org/c/1065
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 6ced9245 11-Feb-2017 Julian Harnath <julian.harnath@rwth-aachen.de>

FUSE compat: add MIME type faking

* Add special handling for reading the BEOS:TYPE attribute to supply
on-the-fly fake MIME types for FUSE module filesystems, the same
way it's done in our FAT and NTFS FS modules

* Reuse the mime_ext_table which we already have and put it into a
shared location so we don't get further extra copies of it


# 5adf34b0 11-Feb-2017 Julian Harnath <julian.harnath@rwth-aachen.de>

FUSE compat: add support for attribute reading

* Implement reading extended file attributes in FUSE modules,
using getxattr()

getxattr() is a quite limited API, not allowing to specify a read
offset. So we read in the entire attribute value into a buffer and
store in the cookie. This shouldn't be a problem memory-wise, since
xattr implementions usually have limitations regarding attribute size
anyway, so it'll rarely be more than a few kilobytes.

* Writing, renaming, and removing attributes is not yet implemented


# 1b4f5f9b 11-Feb-2017 Julian Harnath <julian.harnath@rwth-aachen.de>

FUSE compat: fall back to truncate if no ftruncate

* As defined by the FUSE interface: if the FUSE module doesn't
implement ftruncate(), fall back to using truncate() instead


# 6297d6c7 11-Feb-2017 Julian Harnath <julian.harnath@rwth-aachen.de>

FUSE compat: fill in some stat infos for getattr

* Prefill struct stat with some information which the FUSE module
doesn't necessarily fill in


# 1263be8f 11-Feb-2017 Julian Harnath <julian.harnath@rwth-aachen.de>

FUSE compat: add Haiku extension

* Add a way for a FUSE module to supply Haiku-specific extensions.
This allows it to integrate better with Haiku while only requiring
minimal changes on the FUSE module itself.

* For now, there is only one extension: another function pointer for
"get_fs_info", which lets the FUSE module fill in an fs_info struct.
FUSE provides no good way to otherwise communicate extra information,
such as the volume flags (e.g. B_FS_IS_SHARED).

* A FUSE module can signal that it supports the Haiku extensions by
a) defining HAS_HAIKU_FUSE_EXTENSIONS before including the fuse
headers
b) setting the global variable gHasHaikuFuseExtensions to 1 in
its initialization
Otherwise, the Haiku extensions are completely invisible to the
FUSE module.


# eebdc855 18-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

userlandfs: Fix 64 bit debug build.


# ffba6606 29-Mar-2015 Michael Lotz <mmlr@mlotz.ch>

UserlandFS: Make 64 bit clean and enable build for x86_64.

I did not bother to fix the BeOS kernel emulation, so this part is
still left out of the x86_64 build.


# 3386d398 20-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed warning.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34145 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


# 1000f8b2 27-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Fixed double-lock in RemoveDir() spotted by Stippi.
* Added node monitoring support. For the changes we make at least. Changes made
by other peer in network file systems are not recognized.


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


# c8722a1e 27-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed WriteFSInfo(). It's used only for changing the volume name and we
can't implement that with the FUSE interface.
* We now mark nodes dirty after a write operation.
* Implemented Sync() by fsync()ing all dirty nodes.


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


# 3ed1a753 26-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Make gcc 4 happy.


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


# 40b0400d 26-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Fixed incorrect loop check in _UnlockNodeChainInternal() nothing would ever
be unlocked.
* Fixed incorrect array indexing in _FindCommonAncestor().
* Fixed copy and paste bugs in _LockNodeChainsInternal().
* Added MultiNodeLocker class, a RAII frontend for _{Lock,Unlock}NodeChains().
* Implemented entry renaming and hard linking.


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


# 85ea1e09 26-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Refactored node locking methods. There's now a LockIterator class which helps
with locking.
* Implemented methods for locking two directories. It's a bit complex, since
we need to enforce a global locking order on the node tree to avoid
deadlocks. Untested yet.


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


# edae667b 26-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed the asynchronous I/O methods. We won't implement them for the time
being.
* Introduced locking for FileCookie.
* Implemented SetFlags() and FSync().


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


# b747212f 25-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented WriteStat() (backend for chown(), chmod(), utime(), truncate()).


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


# 3cf43c26 25-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed the fs_vnode_ops::create_dir() parameter for returning the ID of the
newly created dir. The VFS really doesn't need it and for some file systems
it might not be easy to get by. Several file systems (e.g. rootfs and fat)
were ignoring the parameter anyway.


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


# cd4ee847 25-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added support for symlink and directory creation, as well as entry deletion
(directories and other nodes).
* Removed methods we can't possibly implement, since the FUSE interface doesn't
provide them and we can't emulate them.
* A FUSEEntry does now also own a reference to its parent directory.


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


# d16ba4b9 24-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added support for O_TRUNC, file creation, and writing to files.


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


# fde6bf44 24-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Preparations for write support: Added a locking to the existing hooks. We
need to make sure that the paths of nodes don't change while we're meddling
with them. We read-lock the directories up to the root directory for that
purpose.
* Added missing locking for directory and attribute directory cookies.
We have to do that, since concurrent readdir()s on the same dir handle are
possible and we write-access the cookie data in such a case.


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


# f11f1730 22-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented the attribute directory methods. Untested yet -- sshfs doesn't
support the respective xattr hooks.


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


# fd4f53a7 22-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented ReadSymlink() and Access().


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


# b5884f05 22-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Got rid of from_fuse_error(). The client FS hooks are supposed to return
negative error codes now (e.g. using the new error mapping mechanism). This
is necessary since the read() and write() hooks have to return a size or a
negative error code.
* Implemented Read(). We can now read sshfs files.


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


# be070362 21-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

A non-empty volume name looks much better in Tracker.


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


# fe24dc3d 21-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Fixed the directory filler callbacks. It is possible that it is passed a NULL
struct stat (new callback) or a 0 type. So if we don't have a node type, we
need to stat the node.
* Added simple opening/closing of files (no reading/writing yet).

It's now possible to browse sshfs volumes.


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


# 41464387 20-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

As per the documentation of the statfs() hook, some statvfs members are
ignored. So we must not use them.


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


# 8d0f474c 20-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added support for the zero offset method for the readdir() hook's filler
callback.
* Added support for the deprecated getdir() hook.
* Fixed various bugs.

Listing the root directory with sshfs does now work. For subdirectories
stat()ing the entries seems to fail, which might be due to the yet missing
open() support.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29623 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


# 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


# eebdc855b82519c7fec6f58255784ace21267b2a 18-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

userlandfs: Fix 64 bit debug build.


# ffba66060b0155c987fc2232b803b243610c6430 29-Mar-2015 Michael Lotz <mmlr@mlotz.ch>

UserlandFS: Make 64 bit clean and enable build for x86_64.

I did not bother to fix the BeOS kernel emulation, so this part is
still left out of the x86_64 build.


# 3386d3985cb6d9dcfbce5ea4a301d5b0142610c0 20-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed warning.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34145 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


# 1000f8b2128aa579abfb72294f067b9a87b9784a 27-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Fixed double-lock in RemoveDir() spotted by Stippi.
* Added node monitoring support. For the changes we make at least. Changes made
by other peer in network file systems are not recognized.


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


# c8722a1e821590c60271c58bce3c2f505f42dd98 27-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed WriteFSInfo(). It's used only for changing the volume name and we
can't implement that with the FUSE interface.
* We now mark nodes dirty after a write operation.
* Implemented Sync() by fsync()ing all dirty nodes.


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


# 3ed1a753c5046ba304a7f38c8120937e60d864b6 26-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Make gcc 4 happy.


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


# 40b0400da7f99fd4822113ddda275e49368aa690 26-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Fixed incorrect loop check in _UnlockNodeChainInternal() nothing would ever
be unlocked.
* Fixed incorrect array indexing in _FindCommonAncestor().
* Fixed copy and paste bugs in _LockNodeChainsInternal().
* Added MultiNodeLocker class, a RAII frontend for _{Lock,Unlock}NodeChains().
* Implemented entry renaming and hard linking.


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


# 85ea1e09d364bbc3c9b97bf07e2a44afe1a6ec86 26-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Refactored node locking methods. There's now a LockIterator class which helps
with locking.
* Implemented methods for locking two directories. It's a bit complex, since
we need to enforce a global locking order on the node tree to avoid
deadlocks. Untested yet.


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


# edae667b947f29e55a2e6b4ae084b068970d8354 26-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed the asynchronous I/O methods. We won't implement them for the time
being.
* Introduced locking for FileCookie.
* Implemented SetFlags() and FSync().


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


# b747212f50e5d0656ca37fc0481dc5c54a98102e 25-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented WriteStat() (backend for chown(), chmod(), utime(), truncate()).


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


# 3cf43c26516b695e35b7433196a530f7541c4ca8 25-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed the fs_vnode_ops::create_dir() parameter for returning the ID of the
newly created dir. The VFS really doesn't need it and for some file systems
it might not be easy to get by. Several file systems (e.g. rootfs and fat)
were ignoring the parameter anyway.


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


# cd4ee847c4fab357b09c6beb021f5b13d0672f07 25-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added support for symlink and directory creation, as well as entry deletion
(directories and other nodes).
* Removed methods we can't possibly implement, since the FUSE interface doesn't
provide them and we can't emulate them.
* A FUSEEntry does now also own a reference to its parent directory.


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


# d16ba4b9575c3699cb3dd3d1519cb009ffec66f8 24-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added support for O_TRUNC, file creation, and writing to files.


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


# fde6bf44b10d066b34bb97daa5c4a62417df995e 24-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Preparations for write support: Added a locking to the existing hooks. We
need to make sure that the paths of nodes don't change while we're meddling
with them. We read-lock the directories up to the root directory for that
purpose.
* Added missing locking for directory and attribute directory cookies.
We have to do that, since concurrent readdir()s on the same dir handle are
possible and we write-access the cookie data in such a case.


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


# f11f17301f8a6cc93f53733653cd0bda1b5a1c8c 22-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented the attribute directory methods. Untested yet -- sshfs doesn't
support the respective xattr hooks.


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


# fd4f53a7a02495d3dfcd5b41d053aff41ca609e5 22-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented ReadSymlink() and Access().


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


# b5884f05a3df604904dd19da67c435cd55a58b75 22-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Got rid of from_fuse_error(). The client FS hooks are supposed to return
negative error codes now (e.g. using the new error mapping mechanism). This
is necessary since the read() and write() hooks have to return a size or a
negative error code.
* Implemented Read(). We can now read sshfs files.


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


# be070362912fcef179ede483d00ecbfa3a361276 21-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

A non-empty volume name looks much better in Tracker.


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


# fe24dc3df4436d9d110aee801def086bbd9f47f8 21-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Fixed the directory filler callbacks. It is possible that it is passed a NULL
struct stat (new callback) or a 0 type. So if we don't have a node type, we
need to stat the node.
* Added simple opening/closing of files (no reading/writing yet).

It's now possible to browse sshfs volumes.


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


# 41464387bd2a6940f6a6ea0b7c9b0288ec12787b 20-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

As per the documentation of the statfs() hook, some statvfs members are
ignored. So we must not use them.


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


# 8d0f474ca185e643a8140b4ff6628009f23a2cd8 20-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added support for the zero offset method for the readdir() hook's filler
callback.
* Added support for the deprecated getdir() hook.
* Fixed various bugs.

Listing the root directory with sshfs does now work. For subdirectories
stat()ing the entries seems to fail, which might be due to the yet missing
open() support.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29623 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


# 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