History log of /haiku/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp
Revision Date Author Comments
# 425ac1b6 20-Jun-2023 Alexander von Gluck IV <kallisti5@unixzen.com>

refactor: Swap %Ld for %lld in all format usages

* %Ld is an undocumented alias for %lld in glibc.
* muslc doesn't implement it for this reason.
* While we will likely never drop %Ld support,
lets clean house and set a better example.

Change-Id: Id46dad3104abae483e80cc5c05d1464d3ecd8030
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6636
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


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


# 2ca13760 20-Aug-2021 Coldfirex <sakison@gmail.com>

Mass updating of OpenBeOS text to Haiku

No functional code altered.

https://dev.haiku-os.org/ticket/17197

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


# d7690f68 22-Dec-2019 Jérôme Duval <jerome.duval@gmail.com>

userlandfs: ReadAttr() with user_memcpy()

should fix #14969

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


# cf6760f2 30-Nov-2018 Jérôme Duval <jerome.duval@gmail.com>

userlandfs: Read()/Write() with user_memcpy().

Change-Id: I8be72d5fb18228c0ee0394a3f906f7a50113d7ea
Reviewed-on: https://review.haiku-os.org/741
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>


# cd6365c7 17-May-2018 Jérôme Duval <jerome.duval@gmail.com>

style fixes


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


# a0d87686 11-Jul-2014 Julian Harnath <julian.harnath@rwth-aachen.de>

Adapt userlandfs kernel-addon to atomic_* API changes.

* Remove volatile qualifiers, use atomic_get() for safe access

* Fixes build of userlandfs


# 4535495d 10-Jan-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged the signals branch into trunk, with these changes:
* The team and thread kernel structures have been renamed to Team and Thread
respectively and moved into the new BKernel namespace.
* Several (kernel add-on) sources have been converted from C to C++ since
private kernel headers are included that are no longer C compatible.

Changes after merging:
* Fixed gcc 2 build (warnings mainly in the scary firewire bus manager).


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


# 88e38c17 16-Dec-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Replace uses of obsolescent BReference[able] API.


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


# 0a1dabca 22-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Added public io_request_is_vip(), returning whether the given request has the
VIP flag set.


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


# ae3bba85 19-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Volume::Link(): Also unwrap the target vnode. The client FS would get a wrong
vnode pointer.


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


# 8af6418b 19-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented support for the recently introduced I/O request calls
io_request_{offset,length}(), {read_from,write_to}_io_request().


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


# 07745f2a 30-Jul-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added support for new notify_io_request() function.


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


# 533cba7e 28-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

bonefish + axeld:
* Reverted r31809 as it introduced a race condition; if the I/O request had been
notified, it could already been deleted at that point.
* Instead, we need to notify the request in each file system/driver that uses
it. Added new notify_io_request() function that does that exactly.
* Added a TODO comment to the userlandfs where the request notification needs
a bit more thought.


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


# 5147963d 26-Jul-2009 Stephan Aßmus <superstippi@gmx.de>

headers/private/kernel/util/OpenHashTable.h, Hugo's version, is a bit nicer than
Tracker's OpenHashTable.h which it should eventually replace. We've renamed the
class to BOpenHashTable and changed the interface slightly so that HashTableLink
became superfluous.
Adapted all the code that used it. Since the OpenHashTables no longer clash,
this should fix the GCC4 build.


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


# 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


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

Ugh, apparently I forgot to implement HasVNodeCapability(). Now we're actually
saving the trips to userland for hooks that aren't implemented there.


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


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

Remove and delete the VNode in _WriteVNode()/RemoveVNode() after the client FS
is done with it, since we still need to serve file cache requests.


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


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

PutVNode(): Switch order of put_vnode() and _DecrementVNodeCount(). After the
put_vnode() might be removed from our map, if that was the last reference to
the node, so _DecrementVNodeCount() would emit an error message -- harmless
but annoying. :-)


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


# e3820a0e 17-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed several problems related to vnode reference count tracking:
* Increment the vnode reference count in NewVNode().
* Introduced a VNode::published flag that allows PublishVNode() (a) to discard
the node on error and (b) not to increment the node's reference count in case
the node had been created by NewVNode() before.
* Added missing fVNodeCountingEnabled check in _RemoveInvalidVNode().
* _PutAllPendingVNodes():
- nodeFound was never reset, so it would loop forever, if there was at
least one node that needed to be put.
- VNode::useCount needs to be set to 0 explicitely. Since vnode reference
count tracking is already disabled PutVNode() doesn't decrement it and
thus we would loop forever, respectively cause the VFS to panic() first.
- If the node has not been published, we need to publish it before putting
it, since otherwise the VFS would complain that the node is busy.


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


# 4649fe05 17-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Haiku kernel interface emulation: Retrieve the capabilities for each vnode.
We do some caching using a hash table indexed by the operations vector.
* Pass the vnode capabilities to the kernel module.
* In the kernel tailor the operation vectors for volumes and vnodes passed to
the VFS according to the respective capabilities. This way those vectors look
pretty much like those from the client FS. This saves unnecessary calls when
hooks are not implemented and should also fix compatibility problems in cases
where not implementing a hook and returning an error don't mean the same to
the VFS.
* Inlined some of the kernel module Volume class getters.


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


# 6747f715 15-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

ReadVNode(): We need to create the VNode object before sending the request
to userland, since typically the file cache for the node is created there
and our FileCacheCreate() method requires and existing VNode object.


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


# c76e8d36 15-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Implemented forwarding the do_iterative_fd_io() callbacks to userland.
* Pass the request offset and length with the DoIORequest. This allows us to
already get the first vecs for do_iterative_fd_io() in userland, saving a
trip back and forth.


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


# 687e02f9 14-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Forward the io() and cancel_io() hooks. Implemented the missing kernel
part.
* Implemented a good part of the kernel part for the support of
do_iterative_fd_io(). The forwarding of the callbacks are missing yet.


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


# 4e597152 08-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Completed file cache support.


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


# 6880c193 07-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

We do now store a VNode object per node in a hash table. This allowed us to get
rid of the vnode count hash map and the mount vnode maps. Furthermore it will
allows us to easily associate a file cache with each node.


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


# 0f90efc3 07-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Detach the AutoLocker before deleting the locked object.


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


# c0509ccc 05-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed several shared userlandfs classes that exist as Haiku shared or kernel
util classes as well.


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


# 97b7c9a0 05-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Handle file cache related requests in the kernel. The actual calls to the
file cache are missing yet -- requires some refactoring in Volume.


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


# 02347947 03-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented acquire_vnode() forwarding.


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


# cdebdeb0 25-Feb-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Some more work towards adjusting the UserlandFS to the current FS interface:
* Split the FSCapabilities bit mask into three bit masks for the FS, the
volume, and the vnodes, since we have three independent FS interface
structures, now. The latter is not supported in the kernel add-on, yet.
* Server:
- Temporarily removed some things from the build (the BeOS interface
and the cache implementations).
- Some WIP in HaikuKernelVolume and [haiku_]kernel_emu.{h,cpp}.
- Added HaikuKernelNode, which wraps fs_vnode for the client FS.
The server is still quite a bit away from being buildable again.


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


# 2bcdce29 24-Feb-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

First work towards adjusting the UserlandFS to the changed FS API. The
kernel module compiles again, though newer features like VM file support,
asynchronous I/O, and FS layers aren't supported yet. The userland code is
still completely out of sync and won't even compile.


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


# 636bfc08 02-Oct-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Renamed fs/vfs_select.cpp to wait_for_objects.cpp and got rid of
vfs_select.h, respectively moved most of it into the new kernel
private header wait_for_objects.h.
* Added new experimental API functions wait_for_objects[_etc](). They
work pretty much like poll(), but also for semaphores, ports, and
threads.
* Removed the "ref" parameter from notify_select_events() and the
select_sync_pool functions as well as from fd_ops::fd_[de]select(). It
is no longer needed. The FS interface select() hook still has it,
though -- the VFS will always pass 0.
* de]select_fd() take a select_info* instead of a select_sync* + ref
pair, now. Added respective functions for semaphores, ports, and
threads.



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


# 245aecda 21-Jun-2007 Axel Dörfler <axeld@pinc-software.de>

Got rid of vnode_id and mount_id, replaced with ino_t and dev_t.


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


# ed07b9c7 02-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

The last missing hooks -- get_vnode_name(), write_attr_stat() and
rewind_query() -- are passed to the userland. get_vnode_name() has an
emulation in userland, in case the client FS doesn't implement it.


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


# 4e0e80ed 04-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

We analyze a client FS's capabilities -- i.e. which hooks it provides or
can be emulated -- and pass this info to the kernel add-on. Thus we can
avoid passing requests to the userland that can't be serviced anyway.


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


# cc0bac7f 02-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

We fake read_stat() on the root node and read_fs_info() when the
connection to the server is lost. The former is required by our mount
command (it stat()s the mount point for some reason unknown to me). The
latter is just to be a good citizen.


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


# 5a31d77f 01-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

read_attr() was broken. We passed a pointer to the node instead of the
cookie.


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


# 97dd0fe3 01-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Adjusted according to the is_vnode_removed() -> get_vnode_removed()
change.
* The new notification functions are used instead of send_notification()
and notify_listener() now. Mapped them in the BeOS kernel emulation
accordingly. RamFS node monitoring seems to work now.


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


# 042eb168 28-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* More debug output in the kernel module.
* Made publish_vnode() available in userland. For old style FS add-ons
publish_vnode() is used when they request a new_vnode(). The semantics
of new_vnode() changed considerably in Haiku, but publish_vnode()
seems to do pretty much what the old new_vnode() did.
* The UserlandFS hosted RamFS begins to work under Haiku. It runs pretty
soon out of memory though (under vmware with 256 MB) and node
monitoring is broken ATM.


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


# 617ed3e4 28-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented the new attribute open/close/... FS hooks. The mapping to the
old interface is completely done in userland ATM.

It becomes more and more obvious that we probably need to provide
the kernel add-on with a bit more information about what the client FS
interface supports in the first place, so we can save unnecessary trips to
the userland. Opening/closing attributes for a FS using the old style
interface could be handled completely in the kernel add-on, for instance
(even if we lose a bit of accuracy wrt to open modes etc.).


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


# 9ce869f4 28-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Welcome back, is_vnode_removed(), old friend!


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


# b12d25d1 25-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

First walk through the userlandfs kernel add-on to port it to the Haiku
FS interface. Adjusted old hooks, but didn't add the new ones yet. The
module builds now at least.


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


# 83812f67 23-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Copied userlandfs code from the test tree to the haiku source tree,
where it will be ported to Haiku.


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


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


# a0d87686f4884c31d86e65b81889bf3d26fab703 11-Jul-2014 Julian Harnath <julian.harnath@rwth-aachen.de>

Adapt userlandfs kernel-addon to atomic_* API changes.

* Remove volatile qualifiers, use atomic_get() for safe access

* Fixes build of userlandfs


# 4535495d80c86e19e2610e7444a4fcefe3e0f8e6 10-Jan-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged the signals branch into trunk, with these changes:
* The team and thread kernel structures have been renamed to Team and Thread
respectively and moved into the new BKernel namespace.
* Several (kernel add-on) sources have been converted from C to C++ since
private kernel headers are included that are no longer C compatible.

Changes after merging:
* Fixed gcc 2 build (warnings mainly in the scary firewire bus manager).


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


# 88e38c178a96634d52920e2de8bb3cbd49869f93 16-Dec-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Replace uses of obsolescent BReference[able] API.


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


# 0a1dabca7eb05baaf2f865fbf0012ef9f78060f2 22-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Added public io_request_is_vip(), returning whether the given request has the
VIP flag set.


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


# ae3bba85bbc54255563ce94d6844693884027ed6 19-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Volume::Link(): Also unwrap the target vnode. The client FS would get a wrong
vnode pointer.


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


# 8af6418b5c35c7c7b4a008783ffde29448b01f99 19-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented support for the recently introduced I/O request calls
io_request_{offset,length}(), {read_from,write_to}_io_request().


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


# 07745f2a0b9f21a8c92326dd8a39d5a8d9a0049c 30-Jul-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added support for new notify_io_request() function.


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


# 533cba7eff7465e14de98036c8a2a0aeeba2bdf9 28-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

bonefish + axeld:
* Reverted r31809 as it introduced a race condition; if the I/O request had been
notified, it could already been deleted at that point.
* Instead, we need to notify the request in each file system/driver that uses
it. Added new notify_io_request() function that does that exactly.
* Added a TODO comment to the userlandfs where the request notification needs
a bit more thought.


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


# 5147963dcd57fefa4f63c484eb88e9eaf4002976 26-Jul-2009 Stephan Aßmus <superstippi@gmx.de>

headers/private/kernel/util/OpenHashTable.h, Hugo's version, is a bit nicer than
Tracker's OpenHashTable.h which it should eventually replace. We've renamed the
class to BOpenHashTable and changed the interface slightly so that HashTableLink
became superfluous.
Adapted all the code that used it. Since the OpenHashTables no longer clash,
this should fix the GCC4 build.


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


# 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


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

Ugh, apparently I forgot to implement HasVNodeCapability(). Now we're actually
saving the trips to userland for hooks that aren't implemented there.


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


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

Remove and delete the VNode in _WriteVNode()/RemoveVNode() after the client FS
is done with it, since we still need to serve file cache requests.


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


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

PutVNode(): Switch order of put_vnode() and _DecrementVNodeCount(). After the
put_vnode() might be removed from our map, if that was the last reference to
the node, so _DecrementVNodeCount() would emit an error message -- harmless
but annoying. :-)


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


# e3820a0e5e85c1e3117597b7cf0d026a2fd16034 17-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed several problems related to vnode reference count tracking:
* Increment the vnode reference count in NewVNode().
* Introduced a VNode::published flag that allows PublishVNode() (a) to discard
the node on error and (b) not to increment the node's reference count in case
the node had been created by NewVNode() before.
* Added missing fVNodeCountingEnabled check in _RemoveInvalidVNode().
* _PutAllPendingVNodes():
- nodeFound was never reset, so it would loop forever, if there was at
least one node that needed to be put.
- VNode::useCount needs to be set to 0 explicitely. Since vnode reference
count tracking is already disabled PutVNode() doesn't decrement it and
thus we would loop forever, respectively cause the VFS to panic() first.
- If the node has not been published, we need to publish it before putting
it, since otherwise the VFS would complain that the node is busy.


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


# 4649fe05ef03c9981231538121df35aab32f2bc0 17-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Haiku kernel interface emulation: Retrieve the capabilities for each vnode.
We do some caching using a hash table indexed by the operations vector.
* Pass the vnode capabilities to the kernel module.
* In the kernel tailor the operation vectors for volumes and vnodes passed to
the VFS according to the respective capabilities. This way those vectors look
pretty much like those from the client FS. This saves unnecessary calls when
hooks are not implemented and should also fix compatibility problems in cases
where not implementing a hook and returning an error don't mean the same to
the VFS.
* Inlined some of the kernel module Volume class getters.


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


# 6747f715cffc13e8effe4cd87a892bfc85e540e8 15-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

ReadVNode(): We need to create the VNode object before sending the request
to userland, since typically the file cache for the node is created there
and our FileCacheCreate() method requires and existing VNode object.


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


# c76e8d36fb69fa88a01ff734f45523c36629af17 15-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Implemented forwarding the do_iterative_fd_io() callbacks to userland.
* Pass the request offset and length with the DoIORequest. This allows us to
already get the first vecs for do_iterative_fd_io() in userland, saving a
trip back and forth.


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


# 687e02f9457b4cf0a13495467d561f5c08d84868 14-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Forward the io() and cancel_io() hooks. Implemented the missing kernel
part.
* Implemented a good part of the kernel part for the support of
do_iterative_fd_io(). The forwarding of the callbacks are missing yet.


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


# 4e5971527e106464c327ac02d3bd431ed156d209 08-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Completed file cache support.


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


# 6880c193621869daeccd4b7c81768f9689b7122c 07-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

We do now store a VNode object per node in a hash table. This allowed us to get
rid of the vnode count hash map and the mount vnode maps. Furthermore it will
allows us to easily associate a file cache with each node.


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


# 0f90efc3bfbd1551d19932776670c99619129599 07-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Detach the AutoLocker before deleting the locked object.


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


# c0509ccc2954628faa943034feab9e3fe15e3df1 05-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed several shared userlandfs classes that exist as Haiku shared or kernel
util classes as well.


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


# 97b7c9a09199e3597c55bb03c4da1a0fb03c4c23 05-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Handle file cache related requests in the kernel. The actual calls to the
file cache are missing yet -- requires some refactoring in Volume.


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


# 023479477067cfbce3a46c496d6fbc82c1a98e6c 03-Mar-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented acquire_vnode() forwarding.


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


# cdebdeb0aa35c9eabf093024474c865ce9bd6840 25-Feb-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Some more work towards adjusting the UserlandFS to the current FS interface:
* Split the FSCapabilities bit mask into three bit masks for the FS, the
volume, and the vnodes, since we have three independent FS interface
structures, now. The latter is not supported in the kernel add-on, yet.
* Server:
- Temporarily removed some things from the build (the BeOS interface
and the cache implementations).
- Some WIP in HaikuKernelVolume and [haiku_]kernel_emu.{h,cpp}.
- Added HaikuKernelNode, which wraps fs_vnode for the client FS.
The server is still quite a bit away from being buildable again.


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


# 2bcdce290bc2207256d093b4fd06b3535daa4676 24-Feb-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

First work towards adjusting the UserlandFS to the changed FS API. The
kernel module compiles again, though newer features like VM file support,
asynchronous I/O, and FS layers aren't supported yet. The userland code is
still completely out of sync and won't even compile.


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


# 636bfc08aeaaa7f1bab813c5aa2e8e666b40ec64 02-Oct-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Renamed fs/vfs_select.cpp to wait_for_objects.cpp and got rid of
vfs_select.h, respectively moved most of it into the new kernel
private header wait_for_objects.h.
* Added new experimental API functions wait_for_objects[_etc](). They
work pretty much like poll(), but also for semaphores, ports, and
threads.
* Removed the "ref" parameter from notify_select_events() and the
select_sync_pool functions as well as from fd_ops::fd_[de]select(). It
is no longer needed. The FS interface select() hook still has it,
though -- the VFS will always pass 0.
* de]select_fd() take a select_info* instead of a select_sync* + ref
pair, now. Added respective functions for semaphores, ports, and
threads.



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


# 245aecda8ac43fc2c0c0bac6a7e4016efa9b71e1 21-Jun-2007 Axel Dörfler <axeld@pinc-software.de>

Got rid of vnode_id and mount_id, replaced with ino_t and dev_t.


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


# ed07b9c7e338367449b81e28a8d2114f07666c1c 02-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

The last missing hooks -- get_vnode_name(), write_attr_stat() and
rewind_query() -- are passed to the userland. get_vnode_name() has an
emulation in userland, in case the client FS doesn't implement it.


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


# 4e0e80ed6cbc449889d81464a9c67e11d8b76ff3 04-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

We analyze a client FS's capabilities -- i.e. which hooks it provides or
can be emulated -- and pass this info to the kernel add-on. Thus we can
avoid passing requests to the userland that can't be serviced anyway.


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


# cc0bac7f51fdecf0ff21b55cf75c793177a7fc3b 02-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

We fake read_stat() on the root node and read_fs_info() when the
connection to the server is lost. The former is required by our mount
command (it stat()s the mount point for some reason unknown to me). The
latter is just to be a good citizen.


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


# 5a31d77f2c8b9cc493039edee24b29029905bdd9 01-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

read_attr() was broken. We passed a pointer to the node instead of the
cookie.


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


# 97dd0fe3c8a9d971b75753a40e9d0f4278b46d66 01-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Adjusted according to the is_vnode_removed() -> get_vnode_removed()
change.
* The new notification functions are used instead of send_notification()
and notify_listener() now. Mapped them in the BeOS kernel emulation
accordingly. RamFS node monitoring seems to work now.


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


# 042eb168965cf38c32b9355c199ebc197672bd2d 28-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* More debug output in the kernel module.
* Made publish_vnode() available in userland. For old style FS add-ons
publish_vnode() is used when they request a new_vnode(). The semantics
of new_vnode() changed considerably in Haiku, but publish_vnode()
seems to do pretty much what the old new_vnode() did.
* The UserlandFS hosted RamFS begins to work under Haiku. It runs pretty
soon out of memory though (under vmware with 256 MB) and node
monitoring is broken ATM.


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


# 617ed3e4a9ea91cf5be9b9e55d465840c36b1639 28-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented the new attribute open/close/... FS hooks. The mapping to the
old interface is completely done in userland ATM.

It becomes more and more obvious that we probably need to provide
the kernel add-on with a bit more information about what the client FS
interface supports in the first place, so we can save unnecessary trips to
the userland. Opening/closing attributes for a FS using the old style
interface could be handled completely in the kernel add-on, for instance
(even if we lose a bit of accuracy wrt to open modes etc.).


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


# 9ce869f45f6612f2e2f6fd2157ea9a5de9e83bd1 28-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Welcome back, is_vnode_removed(), old friend!


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


# b12d25d15dd11b61fae5f49bfa21d3c884cfdf63 25-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

First walk through the userlandfs kernel add-on to port it to the Haiku
FS interface. Adjusted old hooks, but didn't add the new ones yet. The
module builds now at least.


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


# 83812f67529c88d4fb4b942162a9f21142e683fa 23-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Copied userlandfs code from the test tree to the haiku source tree,
where it will be ported to Haiku.


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