History log of /haiku/headers/os/drivers/fs_interface.h
Revision Date Author Comments
# 92030a4a 22-Mar-2022 Augustin Cavalier <waddlesplash@gmail.com>

Revert "vfs: functions to change a vnode busy status and ID"

This reverts commit 8497a2cc289f6d991147995507e4efc0ae189147.

The VFS layer is not at all ready for this. Many places in the
code implicitly assume ino_t values will never change. This
functionality is only necessary for live shrinking of partitions,
which is a feature niche enough we do not need to worry about
implementing it in the first round of resizing (if ever.)


# 8497a2cc 12-Jul-2012 ahenriksson <sausageboy@gmail.com>

vfs: functions to change a vnode busy status and ID

The kernel version is only partially tested.

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


# 6f7fc220 07-Mar-2016 Axel Dörfler <axeld@pinc-software.de>

NodeMonitor: Added B_WATCH_CHILDREN flag.

* Added a directory argument for notify_{stat/attribute}_changed().
* This allows to watch only a directory, and get the notifications for
all of its files, not just add/remove entry notifications.


# 5a95af70 25-Oct-2014 Axel Dörfler <axeld@pinc-software.de>

vfs/{b|btr|package|b}fs/ext2/exfat: common access check.

* Added VFS helper function check_access_permissions() that combines
several partially correct versions to the one true version (tm).
* All but BFS (since recently) missed the S_IXOTH for root on directories,
and all but packagefs missed proper group handling.


# 5163e1c6 27-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Revert "Introduce vnode op supports_operation(), fix devfs_io()"

This reverts commit 98a5231fe5497c526849f2d84b1a9bbcbdfd2dbc.


# 98a5231f 27-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Introduce vnode op supports_operation(), fix devfs_io()

devfs_io() can't fall back to calling vfs_synchronous_io(), if the
device driver doesn't support handling requests asynchronously. The
presence of the io() hook leads the VFS (do_iterative_fd_io()) to
believe that asynchronous handling is supported and set a
finished-callback on the request which calls the io() hook to start the
next chunk. Thus, instead of iterating through the request in a loop
the iteration happens recursively. For sufficiently fragmented requests
the stack may overflow (ticket #9900).

* Introduce a new vnode operation supports_operation(). It can be called
by the VFS to determine whether a present hook is actually currently
supported for a given vnode.
* devfs: implement the new hook and remove the fallback handling in
devfs_io().
* vfs_request_io.cpp: use the new hook to determine whether the io()
hook is really supported.


# d764d148 27-Jun-2012 Pawel Dziepak <pdziepak@quarnos.org>

Allow file systems to manage file locks

Haiku implements file locking at vfs level. That would not work for remote
and shared file systems, since they need to negotiate locks with peers.
This patch introduces three additional hooks in fs_interface that allow
file system module to take over the management of file locks.


# 90ade5e2 12-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added file_system_module_info::uninitialize() analogously to
partition_module_info::uninitialize().
* Implemented the hook for BFS.
* Implemented KFileSystem::Uninitialize().

Fixes failure to initialize a BFS initialized device with an intel partition
map.


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


# 4a5a077f 24-Oct-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Add a private B_ATTR_CHANGE_NOTIFICATION flag to the open query syscall to tell the query to send notifications when an entry attribute changed and the entry stays in the query. Previously you only get created and removed messages, now you can also get updated messages. Only implement it for bfs.
Fix copy right.



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


# d63f4274 18-Oct-2010 Jérôme Duval <korli@users.berlios.de>

added a file system call preallocate() as described in #6285, currently unused


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


# 9d570af7 24-May-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed the type of the "op" parameter of the fs_vnode_ops::ioctl() hook and
the _kern_ioctl() syscall from ulong to uint32.


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


# 78e7cdae 16-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* Removed the get_next_removed_vnode() call again - besides the problems Ingo
pointed out, there is also an unsolvable race condition with BFS that other
file systems should share.


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


# 4e98292b 15-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* Introduced new call get_next_removed_vnode() to be able to iterate over
removed but not yet deleted vnodes.
* Simplified get_vnode_removed().
* Header cleanup.


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


# 49004dc7 19-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

Remove the additional fs_vnode_ops arugment from get_vnode() again as it's not
needed at all when used as intended. Thanks Ingo for the explanation on how this
is intended to work. Adjusted the overlay fs accordingly and updated/reverted
the changes to the other filesystems.


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


# b1a58597 18-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

Add a new fs_volume op all_layers_mounted() that is called when all layers have
been mounted. This is to allow layered filesystems to setup internal data that
requires all the sub/super volumes to be available.


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


# a26c2439 14-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Adding volume ops to the overlay filesystem.
* Remove the previous method of applying the overlay by flags. In the future the
overlay can just be mounted as a filesystem layer. This is probably how layers
were intended to work in the first place.
* Move the filesystem module info and filesystem name from the fs_mount to the
fs_volume structure. Filesystem layering is done by having multiple layered
volumes and we want to be able to have a different fs per layer.
* Adapt VFS code to this move.
* Implement mounting layered filesystems. Specifying multiple filesystems
separated by a colon on mount will cause the layers to be set up and the
corresponding filesystems to be mounted at that layer.


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


# 00405f22 09-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Add an additional argument to get_vnode() that gets the fs_vnode_ops of the
node. That is needed for a layered filesystem to be able to construct a full
fs_vnode out of a volume/inode pair.
* Adapt places where get_vnode is used. Sadly this is a C API and we can't just
use a default NULL for that argument.
* Introduce a flag B_VNODE_WANTS_OVERLAY_SUB_NODE that can be returned in the
flags field of a fs get_vnode call. A filesystem can use this flag to indicate
that it doesn't support the full set of fs features (attributes, write support)
and it'd like to have unsupported calls emulated by an overlay sub node.
* Add a perliminary overlay filesystem that emulates file attributes using files
on a filesystem where attributes aren't supported. It does currently only
support reading attributes/attribute directories though. All other calls are
just passed through to the super filesystem.
* Adjust places where a HAS_FS_CALL() is taken as a guarantee that the operation
is supported. For the overlay filesystem we may later return a B_UNSUPPORTED,
so make sure that in that case proper fallback options are taken.
* Make the iso9660 filesystem request overlay sub nodes. This can be fine tuned
later to only trigger where there are features on a CD that need emulation
at all.

If you happened to know the attribute file format and location you could build
an iso with read-only attribute support now. Note that this won't be enough to
get a bootable iso-only image as the query and index support is yet missing.


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


# 9f6ae76f 01-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Added acquire_vnode() call that you can use to get another reference to an
inode - unlike get_vnode() the busy flag won't prevent you from getting that
reference.
* Changed put_vnode() to return an error in case the vnode couldn't be found.


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


# 7f12cc54 30-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* It is now supported that I/O operations and requests are only handled
partially (e.g. due to hitting the end of file). The respective
classes have grown new methods and attributes to deal with that. The
"finished" callbacks have got additional parameters to indicate
whether the transfer was only partial and how much has been
transferred. Other callbacks and functions have a size_t* in/out
parameter instead of a simple size_t, now.
* vfs_{read,write}_pages() do now use the I/O request framework instead
of the underlying FS's {read,write}_pages() hooks (those should be
unused now). Furthermore they've got an additional "flags" parameter,
which is passed to IORequest::Init(), i.e. it allows to specify that
the given vecs refer to physical addresses.
* The file cache's read_into_cache() reads directly into physical
pages, now.
* Fixed bug in DoIO::IO(): The offset was not adjusted, so that all
pages were incorrectly transferred from/to the same location.
* Fixed broken subrequest scheduling loop head in
do_iterative_fd_io_iterate().
* Adjusted the test driver and implemented its io() hook. Using this
driver I/O requests are passed all the way from the VFS/VM to the
driver and through the I/O scheduler. It even seems to work. :-)
* Added missing const to the iovec* parameter of the IORequest::Init()
methods.
* Disabled some debug output by default. Added new optional debug
output.


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


# 7df40c23 28-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added handy function volume_for_vnode() which returns the fs_volume for
a given given fs_vnode.


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


# ec598fe4 27-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added FS interface hooks io() and cancel_io(). The former is supposed
to provide asynchrounous (or only synchronous, if asynchronous is not
supported) I/O request support. It will eventually replace
{read,write}_pages(). None of the FS implementations implement them
yet.
* Implemented some support functions for request-based I/O. File system
implementations can use do_fd_io() which passes an I/O request to the
layer responsible for a given FD, and do_iterative_fd_io(), which
translates a request for a file to subrequests for the underlying
device and passes them on. Both fall back to synchrounous processing
when the io() hook is not supported.
Furthermore added vfs_synchronous_io() which should be handy for the
devfs to perform io_requests synchronously for devices that don't
support the io() hook.


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


# e6bd90c5 23-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* bfs_fsync() was the only place which could cause the
fs_vnode_ops::write_pages() to be called with fsReenter = true. Since
this is no longer the case, the argument has become superfluous. For
read_pages() it always was. Removed the argument from the functions
and all functions that propagated it.
* Some whitespace at the end of lines was removed.


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


# 60f2ef17 12-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added "partition_id partition" field to fs_volume, so that file
systems can get the partition they reside on easily.
* Updated TODO.


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


# 1da9f5ce 10-May-2008 Axel Dörfler <axeld@pinc-software.de>

* Added BDiskSystem::ShortName() and everything needed to get it there.
* Added BDiskDeviceRoster::GetDiskSystem() method, that can get a disk system
by short/pretty/module name - since they should all be unique, I put them
in a single namespace, please complain if you don't like that :-)
* Cleaned up DiskSystem.h and DiskDeviceRoster.h according to the updated
header guidelines.
* Renamed ntfs pretty name from "ntfs File System" to "Windows NT File System".


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


# 24280972 29-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed superfluous uint32 ref parameter from select() FS hook.


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


# 7ffafac8 05-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Reorganized the FS interface a little:
- Moved most file_system_module_info hooks into separate structures.
Those that operate on mounted volumes to fs_volume_ops, those
operating on a vnode to fs_vnode_ops.
- Got rid of the fs_volume, fs_cookie, fs_vnode typedefs. We use void*
again.
- Instead of a void* volume and node cookie hooks are passed a
fs_volume and fs_vnode structure pointer, which contain the cookie
and an ops pointer (fs_volume a few more things).
- The VFS {new,publish,get,...}_vnode() functions take a fs_volume*
instead of the volume ID. So does vfs_get_fs_node_from_path().
- Added type and flags arguments to publish_vnode() and the
get_vnode() hook and removed the type argument from lookup() hook.
Added vnode::type using formerly unused bits to store the node type.
Simplified a few things in the VFS due to the now always available
node type.
- Added fs_volume_ops::{create,delete}_sub_vnode() and
fs_vnode_ops::get_super_vnode() hooks. They are used to support file
system layers, e.g. allowing to extend an FS not supporting BeOS
attribute with attribute support. Needs some more work in the VFS.
- Added fs_vnode_ops::create_special_node() hook for creating special
nodes (e.g. FIFOs).
* Adjusted the built-in file systems and BFS according to the interface
changes. Removed all other FSs from the image for the time being.
We'll see whether further API changes are necessary before porting
them.
* Adjusted the bfs_shell accordingly.
* Implemented create_special_node() in rootfs to support special nodes.
* Added support for FIFOs:
- Added syscall _kern_create_fifo() (used by mkfifo()), which creates
a special node (type S_IFIFO) in the respective file system.
- When a special node is published the VFS creates a respective sub
node. Currently only FIFOs are supported.
- Added a little support for FIFO subnodes by using functionality from
the pipefs.
- Added mkfifo to the image. It can create FIFOs in the rootfs, but
the FIFOs aren't really usable ATM, since they still work like
pipes, i.e. readers and writers need to have them open at the same
time.
* Some smaller changes in the VFS:
- Made the *_CALL macros nicer to use (vargs).
- Refactored FS entry lookup into new function lookup_dir_entry().
- create_vnode() no longer just calls the FS create() hook. First it
looks up the entry and uses open_vnode(), if it already exists. This
is necessary for two reasons: 1) The FS might not support create()
while still allowing to open() entries. 2) When the FS has other
layers on to of it (or the respective node) it might not be
responsible for opening the node.


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


# a121b8c8 24-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Added a new flag for write stat: B_STAT_SIZE_INSECURE that allows a
file system to not fill newly created space with zeros.
BFile::SetSize() now uses this, while [f]truncate() does not. This
is only a temporary work-around until BFS supports sparse files.
* Apps that want to reserve space to fill up later should use
BFile::SetSize() for now, as this will be a lot faster than
[f]truncate().
* cache_io() and the functions below now use a special mode when you
pass in a NULL buffer: for read access, the cache is only populated
(useful for prefetching), for write access, the file is filled with
zeros.
* Implemented BFS's Inode::FillGapWithZeros() using this method now.
* Removed extraneous white space.


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


# 5e2ef462 23-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Got rid of the duality of FS_WRITE_STAT_* vs. B_STAT_* flags (removed
the former ones).
* Removed extraneous white space.
* net_server settings are now also updated when the size of the
file changed.


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


# 3d268eda 10-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

* Extracted file_map API out of the file cache - it's now an optional service
that can be used by file systems.
* Changed the way the file cache works: instead of reading/writing to the
underlying device directly, it can now be used for any data source, ie.
also network file systems.
* As a result, the former pages_io() moved to the VFS layer, and can now be
called by a file system via {read|write}_file_io_vec_pages() (naming
suggestions are always welcomed :-)). It now gets an FD, and uses that to
communicate with the device (via its fs_{read|write}_pages() hooks).
* The file_cache_{read|write}() functions must now be called without holding
an I/O relevant file system lock. That allows the file cache to prepare the
pages without colliding with the page writer, IOW the "mayBlock" flag can
go into the attic again (yay!).
* This also results in a much better performance when the system does I/O and
is low on memory, as the page writer can now finally write back some pages,
and that even without maxing out the CPU :)
* The API changes put slightly more burden on the fs_{read|write}_pages()
hooks, but in combination with the file_map it's still pretty straight
forward. It just will have to dispatch the call to the underlying device
directly, usually it will just call its fs_{read|write}_pages() hooks
via the above mentioned calls.
* Ported BFS and FAT to the new API, the latter has not been tested, though.
* Also ported the API changes to the fs_shell. I also completely removed its
file cache level page handling - the downside is that device access is no
longer cached (ie. depends on the host OS now), the upside is that the code
is greatly simplified.


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


# bf95c9ae 07-Oct-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* The shadow_changed() FS and partitioning system hooks take an
additional partition_data* child parameter now.
* _user_get_partitionable_spaces() doesn't need to copy the buffer into
the kernel, since it is no input parameter. It also copies back the
actual partitionable spaces count on error, now -- B_BUFFER_OVERFLOW
is returned when the buffer was too small, but then the count must be
returned too.
* Fixed several instances of syscall implementations that unloaded a disk
system, although they didn't load it in the first place. This screwed
up the load count with undesirable consequences.
* _user_create_child_partition() would set the size to the supplied
offset.
* Fixed broken loop in KPhysicalPartition::CreateShadowPartition().
* KPartition::RemoveChild() notified the listeners about the wrong
event.
* Intel partitioning module:
- The *_get_partitionable_spaces() correctly return B_BUFFER_OVERFLOW
now, if the supplied buffer is too small.
- Implemented a part of pm_shadow_changed(), which creates and updates
the PartitionMap, so that the validate_*() hooks have a chance to
work at all.



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


# db5c68ca 04-Oct-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added the partition size as parameter to the file and partitioning
system initialize() hooks. It's often the only info about the
partition one needs and thus locking the partition just to get it is
no longer necessary.
* intel partitioning system:
- Removed passing around block sizes. We require 512 byte sectors
anyway. In fact using the parent partition's block size was even
wrong.
- Simplified writing the partition map sector.
- Simplified and corrected the partition map initialization.
- We don't fail identifying a partition anymore, if the partition map
contains no partitions. We would never identify a freshly
initialized partition map before.
- Made pm_identify() more intelligent: It determines the priority to
return depending on whether the partition is the device itself and
whether we have recognized child partitions.


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


# 3e9513aa 03-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* fs_{write|read}_pages() now has an additional argument "mayBlock".
* the page writer don't allow to block, while all other writers do. This fixes
bug #1509. The reason the page writer needs this is because it marks several
pages from different caches as busy.
* Fixed a warning about ASSERT being defined already in BFS, since
util/DoublyLinkedList.h now includes debug.h.


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


# 76a8ec23 22-Aug-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added disk system flags for whether a partition name and partition
content name are supported.
* Added file_system_module_info::flags (analogously to
partition_module_info::flags) which indicate which disk device
features the FS supports.
* Replaced the
file_system_module_info/partition_module_info::supports_*()
hooks by a get_supported_operations() hook and for partitioning
systems additionally a get_supported_child_operations() hook.
* Updated file and partitioning systems accordingly.
* Updated fs_shell accordingly.
* Updated the DDM accordingly. The syscall interface remains unchanged,
though.
* _user_supports_initializing_partition() also checks whether the parent
partitioning system is content now.


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


# 9e12e9a7 01-Aug-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added mapping of dup() in the FS shell.
* Adjusted the FS initialize() hook to have FD and partition_id
parameters like the other hooks instead of the partition path.
* Adjusted initialization in BFS accordingly.
* Implemented the FS initialization method in KFileSystem.


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


# 7a1b4ef3 05-Jul-2007 Axel Dörfler <axeld@pinc-software.de>

Obviously forgot to commit these; they were part of the mount_id/vnode_id to dev_t/ino_t
conversion.


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


# 2f925372 05-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

One unremove_vnode() prototype shall suffice.


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


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

Renamed the FS interface hook read_link() to read_symlink().


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


# 12d359b8 04-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed write_link from the FS module interface. Adjusted all FS
add-ons accordingly and removed the syscall.
* Removed send_notification().
* Reimplemented notify_listener(). It used the unimplemented
send_notification(). Now it has a chance to work. Note that
notify_listener() is obsolete. I would already have removed it, if
there weren't lots of FS implementations still using it (Hint!).


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


# 9481e62b 01-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

is_vnode_removed() is now known as get_vnode_removed() and returns its
answer through a reference parameter.


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


# 223bba10 28-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Resurrected is_vnode_removed().


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


# 1fbe3ccd 24-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Reformatted to honor 80 chars/line limit.
* Renamed a few parameters of the FS module hooks:
- *file in the attribute functions to *vnode
- v to vnode
- I could barely restrain myself from renaming the "_*" parameters. I
understand this marks return parameters, but I'd prefer a nicer prefix
or suffix (that doesn't makes you think this is a private/internal
identifier) like "out", "ret", "return", "result", or something similar.

I'd also like to propose renaming {read,write}_link() to
{read,write}_symlink(). Er, and do we need write_link() at all?


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


# 97e06971 12-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

Added a "reenter" parameter to the {read|write}_pages() functions to give file
systems a chance to know if they have locked already.
This fixes a locking problem in BFS where one thread tried to acquire two read
locks (where someone else trying to acquire a write lock would have caused a
dead lock).


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


# 47f39c93 23-May-2005 Axel Dörfler <axeld@pinc-software.de>

Merged the disk device manager module interface for file systems with the
VFS's interface, so that a file system only has to implement one interface.
As a side effect, the automatic file system detection may now work (not yet
tested, though).


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


# 219dacab 06-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

Changed our read link syscall and FS interface call to make it easily possible to be POSIX compliant.
Also changed readlink() to be POSIX compliant with those changes.
"ls -l" does now resolve links properly again (the new coreutils version outlined the problems).


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


# cbc6d404 17-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added missing select()/deselect() Hooks to the file system interface
and made sure they are called by the VFS, if existent.


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


# bade75a5 13-Mar-2005 Axel Dörfler <axeld@pinc-software.de>

Added prototype for the new function publish_vnode().


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


# 98f9f2bf 02-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added parameters to notify_{stat,attribute}_change() that will give more information on what actually happened.


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


# 5207cc7a 29-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Proposal for a replacement of the notify_listener() and
send_notification() interface, which I personally find quite ugly.
Each notification type gets its own function, which makes very clear,
which parameters are to be supplied. Also note the addition of the
`name' parameter for the `entry removed' notification and `fromName'
for `entry moved'.


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


# 58e12c8d 12-Nov-2004 Axel Dörfler <axeld@pinc-software.de>

Changed fs_mount() function: "args" is now const char instead of void,
added flags parameter (for example for B_MOUNT_READ_ONLY).


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


# 4ee37a6c 29-Oct-2004 Axel Dörfler <axeld@pinc-software.de>

fs_read_link() returns status_t, not ssize_t anymore (ie. the size of the
link is not returned anymore).


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


# 752c2e98 05-Oct-2004 Axel Dörfler <axeld@pinc-software.de>

The set_flags() call was missing from the FS interface.


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


# be4e2191 02-Oct-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

Added small note.
BTW shouldn't those constants have the B_ prefix now that they are in a
public header?


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


# 8384cc5c 30-Sep-2004 Axel Dörfler <axeld@pinc-software.de>

Moved the select stuff into its own header file for now which is now included
from both, Drivers.h, and fs_interface.h.
The latter no longer includes vfs_types.h for iovecs, but <sys/uio.h> for iovec.


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


# ba84415a 06-Sep-2004 Axel Dörfler <axeld@pinc-software.de>

Added a "cookie" parameter to the fs_read|write|has_page[s]().
Changed the fs_get_file_map() call a bit - the requested file offset and size
were missing.


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


# 7af4ca8a 04-Sep-2004 Axel Dörfler <axeld@pinc-software.de>

Changed the VM hooks a bit to better match the corresponding driver hooks.
Added file cache hook function that gets the extents of a file.


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


# 61b8f5f2 01-Jul-2004 Axel Dörfler <axeld@pinc-software.de>

Fixed some return types.


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


# 34c763c9 07-Jun-2004 Axel Dörfler <axeld@pinc-software.de>

File systems are modules now.
Added prototype for unremove_vnode(), some other minor changes.


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


# d0da374b 07-Jun-2004 Axel Dörfler <axeld@pinc-software.de>

Moved the public fs functions from vfs.h to this file.
Renamed them to match other exported BeOS functions as well (removed the vfs_ prefix).


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


# 80a9c4f4 02-Aug-2003 shatty <shatty@nowhere.fake>

include OS.h directly from fs_interface.h in prep for removal from sys/stat.h


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


# 136805bc 26-Jun-2003 Axel Dörfler <axeld@pinc-software.de>

The C++ "C" export now contains the send_notification() and notify_listener()
prototypes.


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


# 6d16fb1d 18-Jan-2003 Axel Dörfler <axeld@pinc-software.de>

Added some file system private function prototypes (for node monitoring/live queries).


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


# 8f0cd8cd 17-Jan-2003 Axel Dörfler <axeld@pinc-software.de>

Added header for node monitor calls for kernel add-ons.
Moved fs_interface.h to this location.


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


# 5a95af70a2c45a103b96046b5dae5c2b5a303dfa 25-Oct-2014 Axel Dörfler <axeld@pinc-software.de>

vfs/{b|btr|package|b}fs/ext2/exfat: common access check.

* Added VFS helper function check_access_permissions() that combines
several partially correct versions to the one true version (tm).
* All but BFS (since recently) missed the S_IXOTH for root on directories,
and all but packagefs missed proper group handling.


# 5163e1c62dc454d84d5cfbd4558b84b8195a44fa 27-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Revert "Introduce vnode op supports_operation(), fix devfs_io()"

This reverts commit 98a5231fe5497c526849f2d84b1a9bbcbdfd2dbc.


# 98a5231fe5497c526849f2d84b1a9bbcbdfd2dbc 27-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Introduce vnode op supports_operation(), fix devfs_io()

devfs_io() can't fall back to calling vfs_synchronous_io(), if the
device driver doesn't support handling requests asynchronously. The
presence of the io() hook leads the VFS (do_iterative_fd_io()) to
believe that asynchronous handling is supported and set a
finished-callback on the request which calls the io() hook to start the
next chunk. Thus, instead of iterating through the request in a loop
the iteration happens recursively. For sufficiently fragmented requests
the stack may overflow (ticket #9900).

* Introduce a new vnode operation supports_operation(). It can be called
by the VFS to determine whether a present hook is actually currently
supported for a given vnode.
* devfs: implement the new hook and remove the fallback handling in
devfs_io().
* vfs_request_io.cpp: use the new hook to determine whether the io()
hook is really supported.


# d764d148b10b8b0f84bbf344ccc9cf35fdb2c99d 27-Jun-2012 Pawel Dziepak <pdziepak@quarnos.org>

Allow file systems to manage file locks

Haiku implements file locking at vfs level. That would not work for remote
and shared file systems, since they need to negotiate locks with peers.
This patch introduces three additional hooks in fs_interface that allow
file system module to take over the management of file locks.


# 90ade5e2987f2b3fa617d09630c1398bf238d955 12-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added file_system_module_info::uninitialize() analogously to
partition_module_info::uninitialize().
* Implemented the hook for BFS.
* Implemented KFileSystem::Uninitialize().

Fixes failure to initialize a BFS initialized device with an intel partition
map.


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


# 4a5a077ff79e1b1ffb2571fdfc5ea8218a64196c 24-Oct-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Add a private B_ATTR_CHANGE_NOTIFICATION flag to the open query syscall to tell the query to send notifications when an entry attribute changed and the entry stays in the query. Previously you only get created and removed messages, now you can also get updated messages. Only implement it for bfs.
Fix copy right.



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


# d63f4274b665d32065f24a7a01a025578c8a43c9 18-Oct-2010 Jérôme Duval <korli@users.berlios.de>

added a file system call preallocate() as described in #6285, currently unused


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


# 9d570af7c878ba30043b23e6dce5f3ae5578aa7c 24-May-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed the type of the "op" parameter of the fs_vnode_ops::ioctl() hook and
the _kern_ioctl() syscall from ulong to uint32.


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


# 78e7cdaedefec77f0b0d7cb145c34736c3553600 16-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* Removed the get_next_removed_vnode() call again - besides the problems Ingo
pointed out, there is also an unsolvable race condition with BFS that other
file systems should share.


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


# 4e98292b8ee6eabfff9fd01a39e0aaf9da9a1fba 15-Apr-2009 Axel Dörfler <axeld@pinc-software.de>

* Introduced new call get_next_removed_vnode() to be able to iterate over
removed but not yet deleted vnodes.
* Simplified get_vnode_removed().
* Header cleanup.


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


# 49004dc730f842ea3c162b56dee63696c51d17c7 19-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

Remove the additional fs_vnode_ops arugment from get_vnode() again as it's not
needed at all when used as intended. Thanks Ingo for the explanation on how this
is intended to work. Adjusted the overlay fs accordingly and updated/reverted
the changes to the other filesystems.


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


# b1a58597b94bdc047e3587cf730577210db6aefb 18-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

Add a new fs_volume op all_layers_mounted() that is called when all layers have
been mounted. This is to allow layered filesystems to setup internal data that
requires all the sub/super volumes to be available.


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


# a26c24392042ca7bfad2e78f73a0b75c463c0455 14-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Adding volume ops to the overlay filesystem.
* Remove the previous method of applying the overlay by flags. In the future the
overlay can just be mounted as a filesystem layer. This is probably how layers
were intended to work in the first place.
* Move the filesystem module info and filesystem name from the fs_mount to the
fs_volume structure. Filesystem layering is done by having multiple layered
volumes and we want to be able to have a different fs per layer.
* Adapt VFS code to this move.
* Implement mounting layered filesystems. Specifying multiple filesystems
separated by a colon on mount will cause the layers to be set up and the
corresponding filesystems to be mounted at that layer.


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


# 00405f2286fd370a0bd264d0bbac0cfa120e7646 09-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Add an additional argument to get_vnode() that gets the fs_vnode_ops of the
node. That is needed for a layered filesystem to be able to construct a full
fs_vnode out of a volume/inode pair.
* Adapt places where get_vnode is used. Sadly this is a C API and we can't just
use a default NULL for that argument.
* Introduce a flag B_VNODE_WANTS_OVERLAY_SUB_NODE that can be returned in the
flags field of a fs get_vnode call. A filesystem can use this flag to indicate
that it doesn't support the full set of fs features (attributes, write support)
and it'd like to have unsupported calls emulated by an overlay sub node.
* Add a perliminary overlay filesystem that emulates file attributes using files
on a filesystem where attributes aren't supported. It does currently only
support reading attributes/attribute directories though. All other calls are
just passed through to the super filesystem.
* Adjust places where a HAS_FS_CALL() is taken as a guarantee that the operation
is supported. For the overlay filesystem we may later return a B_UNSUPPORTED,
so make sure that in that case proper fallback options are taken.
* Make the iso9660 filesystem request overlay sub nodes. This can be fine tuned
later to only trigger where there are features on a CD that need emulation
at all.

If you happened to know the attribute file format and location you could build
an iso with read-only attribute support now. Note that this won't be enough to
get a bootable iso-only image as the query and index support is yet missing.


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


# 9f6ae76f020cd6cf1fca7a3ae21ee7819581307d 01-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Added acquire_vnode() call that you can use to get another reference to an
inode - unlike get_vnode() the busy flag won't prevent you from getting that
reference.
* Changed put_vnode() to return an error in case the vnode couldn't be found.


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


# 7f12cc54a729622cd04940ee9400958413d99b21 30-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* It is now supported that I/O operations and requests are only handled
partially (e.g. due to hitting the end of file). The respective
classes have grown new methods and attributes to deal with that. The
"finished" callbacks have got additional parameters to indicate
whether the transfer was only partial and how much has been
transferred. Other callbacks and functions have a size_t* in/out
parameter instead of a simple size_t, now.
* vfs_{read,write}_pages() do now use the I/O request framework instead
of the underlying FS's {read,write}_pages() hooks (those should be
unused now). Furthermore they've got an additional "flags" parameter,
which is passed to IORequest::Init(), i.e. it allows to specify that
the given vecs refer to physical addresses.
* The file cache's read_into_cache() reads directly into physical
pages, now.
* Fixed bug in DoIO::IO(): The offset was not adjusted, so that all
pages were incorrectly transferred from/to the same location.
* Fixed broken subrequest scheduling loop head in
do_iterative_fd_io_iterate().
* Adjusted the test driver and implemented its io() hook. Using this
driver I/O requests are passed all the way from the VFS/VM to the
driver and through the I/O scheduler. It even seems to work. :-)
* Added missing const to the iovec* parameter of the IORequest::Init()
methods.
* Disabled some debug output by default. Added new optional debug
output.


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


# 7df40c23f6259559b97604ba66d0384311c51e0b 28-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Added handy function volume_for_vnode() which returns the fs_volume for
a given given fs_vnode.


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


# ec598fe493579e3d522453cb407ca3c6b57d715a 27-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added FS interface hooks io() and cancel_io(). The former is supposed
to provide asynchrounous (or only synchronous, if asynchronous is not
supported) I/O request support. It will eventually replace
{read,write}_pages(). None of the FS implementations implement them
yet.
* Implemented some support functions for request-based I/O. File system
implementations can use do_fd_io() which passes an I/O request to the
layer responsible for a given FD, and do_iterative_fd_io(), which
translates a request for a file to subrequests for the underlying
device and passes them on. Both fall back to synchrounous processing
when the io() hook is not supported.
Furthermore added vfs_synchronous_io() which should be handy for the
devfs to perform io_requests synchronously for devices that don't
support the io() hook.


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


# e6bd90c58dbae64f3b464edcff90dcb06e63a716 23-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* bfs_fsync() was the only place which could cause the
fs_vnode_ops::write_pages() to be called with fsReenter = true. Since
this is no longer the case, the argument has become superfluous. For
read_pages() it always was. Removed the argument from the functions
and all functions that propagated it.
* Some whitespace at the end of lines was removed.


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


# 60f2ef17be7b98a2a30b95e6a7a33a2bde8e17e5 12-Jul-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added "partition_id partition" field to fs_volume, so that file
systems can get the partition they reside on easily.
* Updated TODO.


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


# 1da9f5cea5ea4d32c539a01cd94a7b605e941beb 10-May-2008 Axel Dörfler <axeld@pinc-software.de>

* Added BDiskSystem::ShortName() and everything needed to get it there.
* Added BDiskDeviceRoster::GetDiskSystem() method, that can get a disk system
by short/pretty/module name - since they should all be unique, I put them
in a single namespace, please complain if you don't like that :-)
* Cleaned up DiskSystem.h and DiskDeviceRoster.h according to the updated
header guidelines.
* Renamed ntfs pretty name from "ntfs File System" to "Windows NT File System".


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


# 24280972976f3e70bd4357b646a3647e1c4fa131 29-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed superfluous uint32 ref parameter from select() FS hook.


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


# 7ffafac8d76aa50ea68667e61038022220a90256 05-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Reorganized the FS interface a little:
- Moved most file_system_module_info hooks into separate structures.
Those that operate on mounted volumes to fs_volume_ops, those
operating on a vnode to fs_vnode_ops.
- Got rid of the fs_volume, fs_cookie, fs_vnode typedefs. We use void*
again.
- Instead of a void* volume and node cookie hooks are passed a
fs_volume and fs_vnode structure pointer, which contain the cookie
and an ops pointer (fs_volume a few more things).
- The VFS {new,publish,get,...}_vnode() functions take a fs_volume*
instead of the volume ID. So does vfs_get_fs_node_from_path().
- Added type and flags arguments to publish_vnode() and the
get_vnode() hook and removed the type argument from lookup() hook.
Added vnode::type using formerly unused bits to store the node type.
Simplified a few things in the VFS due to the now always available
node type.
- Added fs_volume_ops::{create,delete}_sub_vnode() and
fs_vnode_ops::get_super_vnode() hooks. They are used to support file
system layers, e.g. allowing to extend an FS not supporting BeOS
attribute with attribute support. Needs some more work in the VFS.
- Added fs_vnode_ops::create_special_node() hook for creating special
nodes (e.g. FIFOs).
* Adjusted the built-in file systems and BFS according to the interface
changes. Removed all other FSs from the image for the time being.
We'll see whether further API changes are necessary before porting
them.
* Adjusted the bfs_shell accordingly.
* Implemented create_special_node() in rootfs to support special nodes.
* Added support for FIFOs:
- Added syscall _kern_create_fifo() (used by mkfifo()), which creates
a special node (type S_IFIFO) in the respective file system.
- When a special node is published the VFS creates a respective sub
node. Currently only FIFOs are supported.
- Added a little support for FIFO subnodes by using functionality from
the pipefs.
- Added mkfifo to the image. It can create FIFOs in the rootfs, but
the FIFOs aren't really usable ATM, since they still work like
pipes, i.e. readers and writers need to have them open at the same
time.
* Some smaller changes in the VFS:
- Made the *_CALL macros nicer to use (vargs).
- Refactored FS entry lookup into new function lookup_dir_entry().
- create_vnode() no longer just calls the FS create() hook. First it
looks up the entry and uses open_vnode(), if it already exists. This
is necessary for two reasons: 1) The FS might not support create()
while still allowing to open() entries. 2) When the FS has other
layers on to of it (or the respective node) it might not be
responsible for opening the node.


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


# a121b8c83ceba34954e7c187e84c206539207b3c 24-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Added a new flag for write stat: B_STAT_SIZE_INSECURE that allows a
file system to not fill newly created space with zeros.
BFile::SetSize() now uses this, while [f]truncate() does not. This
is only a temporary work-around until BFS supports sparse files.
* Apps that want to reserve space to fill up later should use
BFile::SetSize() for now, as this will be a lot faster than
[f]truncate().
* cache_io() and the functions below now use a special mode when you
pass in a NULL buffer: for read access, the cache is only populated
(useful for prefetching), for write access, the file is filled with
zeros.
* Implemented BFS's Inode::FillGapWithZeros() using this method now.
* Removed extraneous white space.


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


# 5e2ef462ec217bde96ca3facd40711db324b1126 23-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Got rid of the duality of FS_WRITE_STAT_* vs. B_STAT_* flags (removed
the former ones).
* Removed extraneous white space.
* net_server settings are now also updated when the size of the
file changed.


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


# 3d268eda3d0ca504c865533347decf27b54025b6 10-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

* Extracted file_map API out of the file cache - it's now an optional service
that can be used by file systems.
* Changed the way the file cache works: instead of reading/writing to the
underlying device directly, it can now be used for any data source, ie.
also network file systems.
* As a result, the former pages_io() moved to the VFS layer, and can now be
called by a file system via {read|write}_file_io_vec_pages() (naming
suggestions are always welcomed :-)). It now gets an FD, and uses that to
communicate with the device (via its fs_{read|write}_pages() hooks).
* The file_cache_{read|write}() functions must now be called without holding
an I/O relevant file system lock. That allows the file cache to prepare the
pages without colliding with the page writer, IOW the "mayBlock" flag can
go into the attic again (yay!).
* This also results in a much better performance when the system does I/O and
is low on memory, as the page writer can now finally write back some pages,
and that even without maxing out the CPU :)
* The API changes put slightly more burden on the fs_{read|write}_pages()
hooks, but in combination with the file_map it's still pretty straight
forward. It just will have to dispatch the call to the underlying device
directly, usually it will just call its fs_{read|write}_pages() hooks
via the above mentioned calls.
* Ported BFS and FAT to the new API, the latter has not been tested, though.
* Also ported the API changes to the fs_shell. I also completely removed its
file cache level page handling - the downside is that device access is no
longer cached (ie. depends on the host OS now), the upside is that the code
is greatly simplified.


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


# bf95c9aee6c36516e5e98a4f8953659c402bbf74 07-Oct-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* The shadow_changed() FS and partitioning system hooks take an
additional partition_data* child parameter now.
* _user_get_partitionable_spaces() doesn't need to copy the buffer into
the kernel, since it is no input parameter. It also copies back the
actual partitionable spaces count on error, now -- B_BUFFER_OVERFLOW
is returned when the buffer was too small, but then the count must be
returned too.
* Fixed several instances of syscall implementations that unloaded a disk
system, although they didn't load it in the first place. This screwed
up the load count with undesirable consequences.
* _user_create_child_partition() would set the size to the supplied
offset.
* Fixed broken loop in KPhysicalPartition::CreateShadowPartition().
* KPartition::RemoveChild() notified the listeners about the wrong
event.
* Intel partitioning module:
- The *_get_partitionable_spaces() correctly return B_BUFFER_OVERFLOW
now, if the supplied buffer is too small.
- Implemented a part of pm_shadow_changed(), which creates and updates
the PartitionMap, so that the validate_*() hooks have a chance to
work at all.



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


# db5c68ca46ce6f291fa5c047035418f6ccc89817 04-Oct-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added the partition size as parameter to the file and partitioning
system initialize() hooks. It's often the only info about the
partition one needs and thus locking the partition just to get it is
no longer necessary.
* intel partitioning system:
- Removed passing around block sizes. We require 512 byte sectors
anyway. In fact using the parent partition's block size was even
wrong.
- Simplified writing the partition map sector.
- Simplified and corrected the partition map initialization.
- We don't fail identifying a partition anymore, if the partition map
contains no partitions. We would never identify a freshly
initialized partition map before.
- Made pm_identify() more intelligent: It determines the priority to
return depending on whether the partition is the device itself and
whether we have recognized child partitions.


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


# 3e9513aa4a8bf5f2fb2b86a767ffe46f6e626acc 03-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* fs_{write|read}_pages() now has an additional argument "mayBlock".
* the page writer don't allow to block, while all other writers do. This fixes
bug #1509. The reason the page writer needs this is because it marks several
pages from different caches as busy.
* Fixed a warning about ASSERT being defined already in BFS, since
util/DoublyLinkedList.h now includes debug.h.


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


# 76a8ec23db391176bac91f33c5f1fc6e8e41866c 22-Aug-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added disk system flags for whether a partition name and partition
content name are supported.
* Added file_system_module_info::flags (analogously to
partition_module_info::flags) which indicate which disk device
features the FS supports.
* Replaced the
file_system_module_info/partition_module_info::supports_*()
hooks by a get_supported_operations() hook and for partitioning
systems additionally a get_supported_child_operations() hook.
* Updated file and partitioning systems accordingly.
* Updated fs_shell accordingly.
* Updated the DDM accordingly. The syscall interface remains unchanged,
though.
* _user_supports_initializing_partition() also checks whether the parent
partitioning system is content now.


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


# 9e12e9a72e7fde25482302f2d9a6a680fd2c0e6a 01-Aug-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added mapping of dup() in the FS shell.
* Adjusted the FS initialize() hook to have FD and partition_id
parameters like the other hooks instead of the partition path.
* Adjusted initialization in BFS accordingly.
* Implemented the FS initialization method in KFileSystem.


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


# 7a1b4ef3fd2b9002c4eba1160d459eff3a27664d 05-Jul-2007 Axel Dörfler <axeld@pinc-software.de>

Obviously forgot to commit these; they were part of the mount_id/vnode_id to dev_t/ino_t
conversion.


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


# 2f92537221e98066820c90108eddee33745e8b6f 05-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

One unremove_vnode() prototype shall suffice.


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


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

Renamed the FS interface hook read_link() to read_symlink().


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


# 12d359b85a22246a568569b09b6587534e98aacc 04-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed write_link from the FS module interface. Adjusted all FS
add-ons accordingly and removed the syscall.
* Removed send_notification().
* Reimplemented notify_listener(). It used the unimplemented
send_notification(). Now it has a chance to work. Note that
notify_listener() is obsolete. I would already have removed it, if
there weren't lots of FS implementations still using it (Hint!).


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


# 9481e62bdbacde8797ed4ab1f1208fc7ba786a7c 01-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

is_vnode_removed() is now known as get_vnode_removed() and returns its
answer through a reference parameter.


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


# 223bba10f3cd044b904fa91cc0271d34faaf700b 28-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Resurrected is_vnode_removed().


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


# 1fbe3ccd4eb6f5388a2dc4ab2907a49acc24bd88 24-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Reformatted to honor 80 chars/line limit.
* Renamed a few parameters of the FS module hooks:
- *file in the attribute functions to *vnode
- v to vnode
- I could barely restrain myself from renaming the "_*" parameters. I
understand this marks return parameters, but I'd prefer a nicer prefix
or suffix (that doesn't makes you think this is a private/internal
identifier) like "out", "ret", "return", "result", or something similar.

I'd also like to propose renaming {read,write}_link() to
{read,write}_symlink(). Er, and do we need write_link() at all?


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


# 97e069713b80839b9dd5441b9f4d37d891b452d8 12-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

Added a "reenter" parameter to the {read|write}_pages() functions to give file
systems a chance to know if they have locked already.
This fixes a locking problem in BFS where one thread tried to acquire two read
locks (where someone else trying to acquire a write lock would have caused a
dead lock).


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


# 47f39c93cbd7db06e72642b047f1fc327852684c 23-May-2005 Axel Dörfler <axeld@pinc-software.de>

Merged the disk device manager module interface for file systems with the
VFS's interface, so that a file system only has to implement one interface.
As a side effect, the automatic file system detection may now work (not yet
tested, though).


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


# 219dacab3cbce36004f4fe91f6c0ef2dbff1feb9 06-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

Changed our read link syscall and FS interface call to make it easily possible to be POSIX compliant.
Also changed readlink() to be POSIX compliant with those changes.
"ls -l" does now resolve links properly again (the new coreutils version outlined the problems).


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


# cbc6d404f9cf85f3b5c63217b514744413564fd4 17-Mar-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added missing select()/deselect() Hooks to the file system interface
and made sure they are called by the VFS, if existent.


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


# bade75a525942d53b7bed830365900f9df8bcfff 13-Mar-2005 Axel Dörfler <axeld@pinc-software.de>

Added prototype for the new function publish_vnode().


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


# 98f9f2bf07a610dcae98450bfaf94a5b8518932c 02-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added parameters to notify_{stat,attribute}_change() that will give more information on what actually happened.


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


# 5207cc7a8ce26c1b5c420ad21017db0194e5d48a 29-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Proposal for a replacement of the notify_listener() and
send_notification() interface, which I personally find quite ugly.
Each notification type gets its own function, which makes very clear,
which parameters are to be supplied. Also note the addition of the
`name' parameter for the `entry removed' notification and `fromName'
for `entry moved'.


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


# 58e12c8d52fa23196864906c8f02cdcec73c4471 12-Nov-2004 Axel Dörfler <axeld@pinc-software.de>

Changed fs_mount() function: "args" is now const char instead of void,
added flags parameter (for example for B_MOUNT_READ_ONLY).


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


# 4ee37a6c5c82389660f899baee45417cee73909c 29-Oct-2004 Axel Dörfler <axeld@pinc-software.de>

fs_read_link() returns status_t, not ssize_t anymore (ie. the size of the
link is not returned anymore).


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


# 752c2e981efb830325921f02aef01d990db73b1a 05-Oct-2004 Axel Dörfler <axeld@pinc-software.de>

The set_flags() call was missing from the FS interface.


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


# be4e2191b112bc41276dfd99d475fab8e35f4abb 02-Oct-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

Added small note.
BTW shouldn't those constants have the B_ prefix now that they are in a
public header?


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


# 8384cc5c92fabafc1e06d22a1eadeebdb57c2d3f 30-Sep-2004 Axel Dörfler <axeld@pinc-software.de>

Moved the select stuff into its own header file for now which is now included
from both, Drivers.h, and fs_interface.h.
The latter no longer includes vfs_types.h for iovecs, but <sys/uio.h> for iovec.


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


# ba84415a028254fee7951c155620c592ed14c165 06-Sep-2004 Axel Dörfler <axeld@pinc-software.de>

Added a "cookie" parameter to the fs_read|write|has_page[s]().
Changed the fs_get_file_map() call a bit - the requested file offset and size
were missing.


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


# 7af4ca8acf7d938391ef574bb2f9706a37a7888b 04-Sep-2004 Axel Dörfler <axeld@pinc-software.de>

Changed the VM hooks a bit to better match the corresponding driver hooks.
Added file cache hook function that gets the extents of a file.


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


# 61b8f5f2a7811e667ec5cf1fc9a58f06c43ee23f 01-Jul-2004 Axel Dörfler <axeld@pinc-software.de>

Fixed some return types.


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


# 34c763c98ffc857ea01356b3a68d43c0a9a8f636 07-Jun-2004 Axel Dörfler <axeld@pinc-software.de>

File systems are modules now.
Added prototype for unremove_vnode(), some other minor changes.


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


# d0da374bc3f28afed57b001b92bedb77afe6a0b5 07-Jun-2004 Axel Dörfler <axeld@pinc-software.de>

Moved the public fs functions from vfs.h to this file.
Renamed them to match other exported BeOS functions as well (removed the vfs_ prefix).


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


# 80a9c4f4c3c4b5e4b42c8309d174fdaf3b04b129 02-Aug-2003 shatty <shatty@nowhere.fake>

include OS.h directly from fs_interface.h in prep for removal from sys/stat.h


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


# 136805bc6a2377a3e8b6ae33ac8f2099bd36502f 26-Jun-2003 Axel Dörfler <axeld@pinc-software.de>

The C++ "C" export now contains the send_notification() and notify_listener()
prototypes.


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


# 6d16fb1d30bbf8cef5f25a0b802a8f9ab98f25c0 18-Jan-2003 Axel Dörfler <axeld@pinc-software.de>

Added some file system private function prototypes (for node monitoring/live queries).


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


# 8f0cd8cdee2bee6f19296201f4c48fefb014593f 17-Jan-2003 Axel Dörfler <axeld@pinc-software.de>

Added header for node monitor calls for kernel add-ons.
Moved fs_interface.h to this location.


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