History log of /haiku/src/add-ons/kernel/file_systems/bfs/Index.cpp
Revision Date Author Comments
# ae3a28be 26-Jun-2012 Andreas Henriksson <sausageboy@gmail.com>

BFS: Forgotten initialization in Index constructor

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


# a2703be2 12-Jan-2017 Axel Dörfler <axeld@pinc-software.de>

bfs: Update old modified time if index is missing.

* This is required to avoid spurious last modified time change
notifications on file systems without index.
* This closes ticket #9834.


# de9c0613 03-Jul-2014 Axel Dörfler <axeld@pinc-software.de>

bfs: Use the QueryParserUtils instead of its own copy.

* Ingo copied the methods into a shared location, and then obviously
"forgot" to let BFS use them. As a side note for Ingo: the complete
error GCC reported was "std::fssh_size_t" not defined with the macro
wrapper as code location. The actual problem was a "using std::size_t"
in some C++ header that accidentally got included after the wrapper.
* The shared Query code is not yet used. That'll be done another time.
* Renamed BFS_SHELL define to FS_SHELL, such that QueryParserUtils can be
used in any file system shell, not just the bfs_shell.


# a54f7dc2 08-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Move B_MIME_STRING_TYPE to <TypeConstants.h>


# 3e292446 08-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Move B_MIME_STRING_TYPE to <TypeConstants.h>


# 60334dc8 03-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* Got rid of the type == 0 feature in Update(); it does not really serve any
purpose anymore, and was just confusing.
* Minor cleanup.


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


# 1a60fd72 06-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Replaced the Inode::GetTree() method with a simple getter - the tree is
always created for directories since quite some time now.


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


# e4944941 15-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup of how the time is converted between bfs_inode and the outside world:
there is now a couple of conversion functions, and I changed the type from
bigtime_t to int64, as it's not what a bigtime_t would usually contain, but
some shift magic in order to make duplicate index entries less likely.
* We now correctly fill in the timespec in struct stat as good as possible; the
12 of the 16 possible bits are used for the nano second value. The lower 8
bits are used to avoid the duplicate index entries. Only if the nano second
time is 0, the lower 12 bits are used to achieve that.


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


# a26a409a 26-Nov-2008 Axel Dörfler <axeld@pinc-software.de>

* Minor cleanup.


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


# 57b9debf 13-Sep-2008 Axel Dörfler <axeld@pinc-software.de>

* Some index updating functions did not take into account that not all nodes
are put into all indices. For example, symlinks aren't part of the size
index. This fixes bug #2704.
* Also, Inode::NeedsTrimming() now ignores symlinks that have no data stream,
it's const now, too.
* Added helper methods Inode::In{Name|Size|LastModified}Index(), and use it
where appropriate.
* Clarified Inode::Create() description with regards to name vs. parent.


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


# 02c8f6c8 02-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Coding style cleanups, no functional changes.


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


# 2e3477e3 31-Jul-2008 Axel Dörfler <axeld@pinc-software.de>

* Changed the inode write locking to be held as long as the transaction is
running - this fixes several cases where someone could see outdated data
when a transaction had to be reverted (the time between unlocking the inode
and actually reverting the blocks). For that, Inodes can now be put into a
singly linked list.
* Added a TODO in Inode::WriteAt() which explains why it cannot use the above
method: seems that our VFS/VM locking model isn't really that good.
* Fixed a possible deadlock in Attribute::_Truncate() where the inode write
lock was held before starting the transaction.
* Added an InodeReadLocker convenience class, that should be used instead
of ReadLocker - Inode::Lock() only still exists because of the needs of
bfs_io().
* Moved the bfs_io() callback hooks out of the exported module API region,
and removed their bfs_ prefix.
* Added a Volume::IsInitializing() method that should be used rather than
checking if Volume::ID() is >= 0.
* Removed the MultiInodeLocker again, as it's pretty much superfluous now.
* Moved openModeToAccess() to the Utility.h header.
* Minor cleanup.


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


# b99521f2 30-Jul-2008 Axel Dörfler <axeld@pinc-software.de>

First round of locking fixes:
* Moved locking the data stream out of the BPlusTree methods; this fixes at
least two locations where another thread could have seen outdated/incorrect
data.
* Removed some superfluous code in bfs_rename(): we don't have to revert to the
previous situation, the transaction does this for us automatically.
* Added a simple MultiWriteLocker, even though it's not really necessary anymore
(since we always hold the transaction lock first when we lock more than one
inode at a time).
* Inode::Create() called InodeAllocator::Keep() a bit too early, the file cache
and map wasn't created and assigned yet.
* InodeAllocator now keeps the inode write locked.


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


# 1bde8b03 08-Jul-2008 Axel Dörfler <axeld@pinc-software.de>

* Replaced BFS's ReadWriteLock implementation with the kernel's rw_lock.
* The BlockAllocator now uses the new mutex_transfer_lock() function instead
of clobbering the mutex directly.
* Removed Lock.h - it's no longer needed.
* Minor white space cleanup.


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


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

Corrected patch to fix warnings when compiled with GCC 4, thanks Vasilis!


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


# 065e3184 22-May-2007 Axel Dörfler <axeld@pinc-software.de>

* Inode::Create() now has a "_created" parameter that will be set to true in case a
node has been created - this is now used in bfs_create() to suppress the new entry
notification in case the file already existed.
* Implemented parameter parsing in bfs_initialize() - does not work in the new bfs_shell
though, as it currently misses driver_settings functionality.
* Attribute::Create() and Attribute::Open() will now honour O_TRUNC correctly.
* Note: Inode::WriteAttribute() still follows R5 semantics for small_data attributes
in this regard and must be fixed (I've opened ticket #1242 for this).
* Some cleanup.


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


# 9d6c014f 29-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Added very basic volume initialization support.


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


# c391f84b 26-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Prepared the BFS sources to be used with the new FS shell:
- Moved all inclusions of system headers into a new
system_dependencies.h header, which conditionally either includes
these or the FS shell headers.
- Fixed compiler warnings related to printf-like functions (int32 is
int, not long on non-BeOS platforms).
* Build a new bfs_shell. Compiles and links, but does nothing ATM.


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


# cb0572ca 25-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

* Changed Inode::WriteAttribute() so that it no longer reads from the old
attribute when its size was 0 - this also fixes calling Index::Update()
with invalid values, and therefore bug #1178.
* Style cleanup: honour 80 column limit a bit more, use doxygen style comments.


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


# 378218a4 25-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

Added some ASSERTs that the Index::Update*/Insert*/Remove*() methods are used
only for inodes that maintain those indices.


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


# 3c70366a 23-Feb-2006 Jérôme Duval <korli@users.berlios.de>

fix for changes in revision 16498, pointed by Marcus


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


# 866d738a 22-Feb-2006 Jérôme Duval <korli@users.berlios.de>

added error tracing to help on bug #106


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


# 3bb591ce 30-May-2005 Axel Dörfler <axeld@pinc-software.de>

We don't want to drop into the kernel debugger for that right now
(FATAL() would be okay, but it's currently configured to panic).


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


# fb02804a 19-Nov-2004 Axel Dörfler <axeld@pinc-software.de>

Big update while moving over completely to the Haiku kernel:
- Ported over BFS to the new cache API
- Inode no longer inherits from CachedBlock, and therefore, no longer
keeps the whole inode block in memory. It now has a copy of the bfs_inode
structure in memory instead. This has a number of advantages but also some
disadvantages, so it might be reverted later, even if it's unlikely.
- Added a NodeGetter class that can be used whenever the real block needs
to be accessed (ie. for attributes)
- Changed *transaction to &transaction where possible
- Removed support for KEEP_WRONG_DIRENT_RECLEN
- Removed support for uncached file access since that's no longer needed
- Fixed some endian issues in bfs_write_stat()
- Removed the install BFS rules, since they don't make any sense anymore
(unless you are running Haiku ;-))

Note, logged streams are not supported anymore right now. Also, the
transaction code is pretty simple and slow - it will be improved later
on. Attribute code is pretty much untested in the new environment.


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


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

It's now <util/kernel_cpp.h> rather than <kernel_cpp.h>.
Forgot to commit that...


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


# 36660c5e 29-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

Switched from direct get_vnode() usage to the Vnode class.
Now acquires the volume lock always before get_vnode() is called as long
as UNSAFE_GET_VNODE is defined (which now is by default).
May cause some unwanted side-effects; it still has to be thorougly tested.


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


# 403d1302 29-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

Minor cleanup.


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


# 54343bbc 25-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

Switched to kernel_cpp.h/cpp.


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


# fbe89ed6 25-Jan-2004 Bruno G. Albuquerque <bga@bug-br.org.br>

We forgot about the B_MIME_STRING_TYPE when creating indices and the BEOS:APP_SIG index was failing to be created. It looks the registrar calls the index creation with that type although it is not directly available in the command line tool mkindex, for example.


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


# 8ea8d0c2 31-May-2003 Axel Dörfler <axeld@pinc-software.de>

Fixed queries a bit more (maybe even completely...). In several situations,
the old attribute value wasn't evaluated at all.
Also, Index::Update() got a type code of zero, instead of the real value
in situations where this didn't make any sense.
Minor cleanup in kernel_interface.cpp.
New method Volume::CheckForLiveQuery() that checks if there is a live query
depending on the specified attribute - not yet implemented, but already used;
always returns "true" right now, which doesn't cause any harm but reducing
the speed lightly.


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


# ab47860c 25-May-2003 Axel Dörfler <axeld@pinc-software.de>

Index::SetTo() now sets fName even if the index initialization failed (for
whatever reason).
Index::Update() is now allowed to be called for those indices - in this case
it will just update all live queries.
Added some comments.


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


# 697df461 05-Dec-2002 Axel Dörfler <axeld@pinc-software.de>

Style clean-ups *and* Index::Update() now correctly converts B_MIME_STRING_TYPE
to B_STRING_TYPE for the lower layers - should probably find a better solution
to handle this.


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


# 68ca164d 19-Nov-2002 Axel Dörfler <axeld@pinc-software.de>

Switched from Inode::IsDirectory() to Inode::IsContainer() where necessary.
Now makes use of the changed Inode::Create() logic.


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


# ae38c6e9 12-Aug-2002 Axel Dörfler <axeld@pinc-software.de>

Fixed a bug that could lead to the wrong last_modified time in an inode;
bfs_close() updated the last_modified time & index, but it didn't write
the inode back to disk.
Furthermore, bfs_write() should have already updated the last_modified
time, not bfs_close.


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


# c42ee134 07-Aug-2002 Axel Dörfler <axeld@pinc-software.de>

Initial revision


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


# de9c0613398645390b8d450089051b2888e2e15b 03-Jul-2014 Axel Dörfler <axeld@pinc-software.de>

bfs: Use the QueryParserUtils instead of its own copy.

* Ingo copied the methods into a shared location, and then obviously
"forgot" to let BFS use them. As a side note for Ingo: the complete
error GCC reported was "std::fssh_size_t" not defined with the macro
wrapper as code location. The actual problem was a "using std::size_t"
in some C++ header that accidentally got included after the wrapper.
* The shared Query code is not yet used. That'll be done another time.
* Renamed BFS_SHELL define to FS_SHELL, such that QueryParserUtils can be
used in any file system shell, not just the bfs_shell.


# a54f7dc2506cd315ef499129b1f44ec96e8c1e10 08-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Move B_MIME_STRING_TYPE to <TypeConstants.h>


# 3e29244600395a0cea91cfc0a0323016fc0f3253 08-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Move B_MIME_STRING_TYPE to <TypeConstants.h>


# 60334dc831b1e6c9ba9a5d8f6d15dfcf2daf91f1 03-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* Got rid of the type == 0 feature in Update(); it does not really serve any
purpose anymore, and was just confusing.
* Minor cleanup.


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


# 1a60fd72cf588ed0d25028da354261b4d8409c08 06-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Replaced the Inode::GetTree() method with a simple getter - the tree is
always created for directories since quite some time now.


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


# e49449412249a5175d2e69da8a3830121379b46c 15-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup of how the time is converted between bfs_inode and the outside world:
there is now a couple of conversion functions, and I changed the type from
bigtime_t to int64, as it's not what a bigtime_t would usually contain, but
some shift magic in order to make duplicate index entries less likely.
* We now correctly fill in the timespec in struct stat as good as possible; the
12 of the 16 possible bits are used for the nano second value. The lower 8
bits are used to avoid the duplicate index entries. Only if the nano second
time is 0, the lower 12 bits are used to achieve that.


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


# a26a409acc3f81ea4541de2bc4dc10532eef9d1f 26-Nov-2008 Axel Dörfler <axeld@pinc-software.de>

* Minor cleanup.


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


# 57b9debf766c370dff725412c27ab09701f1d05f 13-Sep-2008 Axel Dörfler <axeld@pinc-software.de>

* Some index updating functions did not take into account that not all nodes
are put into all indices. For example, symlinks aren't part of the size
index. This fixes bug #2704.
* Also, Inode::NeedsTrimming() now ignores symlinks that have no data stream,
it's const now, too.
* Added helper methods Inode::In{Name|Size|LastModified}Index(), and use it
where appropriate.
* Clarified Inode::Create() description with regards to name vs. parent.


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


# 02c8f6c89d13b94c5507012eaadddc79982c976f 02-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Coding style cleanups, no functional changes.


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


# 2e3477e3d851cc46fa682712c3f73dbb82d64fd9 31-Jul-2008 Axel Dörfler <axeld@pinc-software.de>

* Changed the inode write locking to be held as long as the transaction is
running - this fixes several cases where someone could see outdated data
when a transaction had to be reverted (the time between unlocking the inode
and actually reverting the blocks). For that, Inodes can now be put into a
singly linked list.
* Added a TODO in Inode::WriteAt() which explains why it cannot use the above
method: seems that our VFS/VM locking model isn't really that good.
* Fixed a possible deadlock in Attribute::_Truncate() where the inode write
lock was held before starting the transaction.
* Added an InodeReadLocker convenience class, that should be used instead
of ReadLocker - Inode::Lock() only still exists because of the needs of
bfs_io().
* Moved the bfs_io() callback hooks out of the exported module API region,
and removed their bfs_ prefix.
* Added a Volume::IsInitializing() method that should be used rather than
checking if Volume::ID() is >= 0.
* Removed the MultiInodeLocker again, as it's pretty much superfluous now.
* Moved openModeToAccess() to the Utility.h header.
* Minor cleanup.


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


# b99521f213e60f88b3d7700f395fb0c4bf99f63a 30-Jul-2008 Axel Dörfler <axeld@pinc-software.de>

First round of locking fixes:
* Moved locking the data stream out of the BPlusTree methods; this fixes at
least two locations where another thread could have seen outdated/incorrect
data.
* Removed some superfluous code in bfs_rename(): we don't have to revert to the
previous situation, the transaction does this for us automatically.
* Added a simple MultiWriteLocker, even though it's not really necessary anymore
(since we always hold the transaction lock first when we lock more than one
inode at a time).
* Inode::Create() called InodeAllocator::Keep() a bit too early, the file cache
and map wasn't created and assigned yet.
* InodeAllocator now keeps the inode write locked.


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


# 1bde8b03e7789d10cdc063a8a4b23ce3cba6f2e1 08-Jul-2008 Axel Dörfler <axeld@pinc-software.de>

* Replaced BFS's ReadWriteLock implementation with the kernel's rw_lock.
* The BlockAllocator now uses the new mutex_transfer_lock() function instead
of clobbering the mutex directly.
* Removed Lock.h - it's no longer needed.
* Minor white space cleanup.


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


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

Corrected patch to fix warnings when compiled with GCC 4, thanks Vasilis!


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


# 065e31842971a008888c578c2c1f1a35c75de40e 22-May-2007 Axel Dörfler <axeld@pinc-software.de>

* Inode::Create() now has a "_created" parameter that will be set to true in case a
node has been created - this is now used in bfs_create() to suppress the new entry
notification in case the file already existed.
* Implemented parameter parsing in bfs_initialize() - does not work in the new bfs_shell
though, as it currently misses driver_settings functionality.
* Attribute::Create() and Attribute::Open() will now honour O_TRUNC correctly.
* Note: Inode::WriteAttribute() still follows R5 semantics for small_data attributes
in this regard and must be fixed (I've opened ticket #1242 for this).
* Some cleanup.


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


# 9d6c014f662e29cc6f21aafce95609fb996ef1b9 29-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Added very basic volume initialization support.


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


# c391f84b2c732398288276bc8354ac4060dc5a4d 26-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

* Prepared the BFS sources to be used with the new FS shell:
- Moved all inclusions of system headers into a new
system_dependencies.h header, which conditionally either includes
these or the FS shell headers.
- Fixed compiler warnings related to printf-like functions (int32 is
int, not long on non-BeOS platforms).
* Build a new bfs_shell. Compiles and links, but does nothing ATM.


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


# cb0572cac5f7cd3541cc1a95a02073a73487c6d5 25-Apr-2007 Axel Dörfler <axeld@pinc-software.de>

* Changed Inode::WriteAttribute() so that it no longer reads from the old
attribute when its size was 0 - this also fixes calling Index::Update()
with invalid values, and therefore bug #1178.
* Style cleanup: honour 80 column limit a bit more, use doxygen style comments.


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


# 378218a43256373dda734d4445213151522d546e 25-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

Added some ASSERTs that the Index::Update*/Insert*/Remove*() methods are used
only for inodes that maintain those indices.


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


# 3c70366ab9daa1b34839be055d103557f339feff 23-Feb-2006 Jérôme Duval <korli@users.berlios.de>

fix for changes in revision 16498, pointed by Marcus


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


# 866d738a052dec5802a8992ad4d2bc6d44470544 22-Feb-2006 Jérôme Duval <korli@users.berlios.de>

added error tracing to help on bug #106


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


# 3bb591ce9a8849620742e6be1af5fa57e085c07d 30-May-2005 Axel Dörfler <axeld@pinc-software.de>

We don't want to drop into the kernel debugger for that right now
(FATAL() would be okay, but it's currently configured to panic).


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


# fb02804a89b1100c0f20c3e3c28be28215103c44 19-Nov-2004 Axel Dörfler <axeld@pinc-software.de>

Big update while moving over completely to the Haiku kernel:
- Ported over BFS to the new cache API
- Inode no longer inherits from CachedBlock, and therefore, no longer
keeps the whole inode block in memory. It now has a copy of the bfs_inode
structure in memory instead. This has a number of advantages but also some
disadvantages, so it might be reverted later, even if it's unlikely.
- Added a NodeGetter class that can be used whenever the real block needs
to be accessed (ie. for attributes)
- Changed *transaction to &transaction where possible
- Removed support for KEEP_WRONG_DIRENT_RECLEN
- Removed support for uncached file access since that's no longer needed
- Fixed some endian issues in bfs_write_stat()
- Removed the install BFS rules, since they don't make any sense anymore
(unless you are running Haiku ;-))

Note, logged streams are not supported anymore right now. Also, the
transaction code is pretty simple and slow - it will be improved later
on. Attribute code is pretty much untested in the new environment.


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


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

It's now <util/kernel_cpp.h> rather than <kernel_cpp.h>.
Forgot to commit that...


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


# 36660c5e9996909146d3872baa555115357f9267 29-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

Switched from direct get_vnode() usage to the Vnode class.
Now acquires the volume lock always before get_vnode() is called as long
as UNSAFE_GET_VNODE is defined (which now is by default).
May cause some unwanted side-effects; it still has to be thorougly tested.


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


# 403d1302de1b1d3de4d2a67a79c00819c31e9435 29-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

Minor cleanup.


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


# 54343bbc2d49684c7d85169ba9a4bab7fc53fac8 25-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

Switched to kernel_cpp.h/cpp.


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


# fbe89ed67be38ba790a0d540275f346a11cd7439 25-Jan-2004 Bruno G. Albuquerque <bga@bug-br.org.br>

We forgot about the B_MIME_STRING_TYPE when creating indices and the BEOS:APP_SIG index was failing to be created. It looks the registrar calls the index creation with that type although it is not directly available in the command line tool mkindex, for example.


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


# 8ea8d0c2bb1270149813f29b7cda0fba06f2210a 31-May-2003 Axel Dörfler <axeld@pinc-software.de>

Fixed queries a bit more (maybe even completely...). In several situations,
the old attribute value wasn't evaluated at all.
Also, Index::Update() got a type code of zero, instead of the real value
in situations where this didn't make any sense.
Minor cleanup in kernel_interface.cpp.
New method Volume::CheckForLiveQuery() that checks if there is a live query
depending on the specified attribute - not yet implemented, but already used;
always returns "true" right now, which doesn't cause any harm but reducing
the speed lightly.


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


# ab47860c37a36b0eca0b65b94ebb3adc1c9fae54 25-May-2003 Axel Dörfler <axeld@pinc-software.de>

Index::SetTo() now sets fName even if the index initialization failed (for
whatever reason).
Index::Update() is now allowed to be called for those indices - in this case
it will just update all live queries.
Added some comments.


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


# 697df4613d087ab37914e4dd229c35d3a00f3278 05-Dec-2002 Axel Dörfler <axeld@pinc-software.de>

Style clean-ups *and* Index::Update() now correctly converts B_MIME_STRING_TYPE
to B_STRING_TYPE for the lower layers - should probably find a better solution
to handle this.


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


# 68ca164dc31cdd523830f8875ffa42ac963039b6 19-Nov-2002 Axel Dörfler <axeld@pinc-software.de>

Switched from Inode::IsDirectory() to Inode::IsContainer() where necessary.
Now makes use of the changed Inode::Create() logic.


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


# ae38c6e93d625dc75f719411c39ab57557ce81b7 12-Aug-2002 Axel Dörfler <axeld@pinc-software.de>

Fixed a bug that could lead to the wrong last_modified time in an inode;
bfs_close() updated the last_modified time & index, but it didn't write
the inode back to disk.
Furthermore, bfs_write() should have already updated the last_modified
time, not bfs_close.


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


# c42ee13401be80c431846910959d587949a1ad10 07-Aug-2002 Axel Dörfler <axeld@pinc-software.de>

Initial revision


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