History log of /haiku/src/add-ons/kernel/file_systems/bfs/Volume.h
Revision Date Author Comments
# aa775038 05-Jul-2012 ahenriksson <sausageboy@gmail.com>

bfs: split checkfs code into FileSystemVisitor and CheckVisitor

Another FileSystemVisitor implementation will be used for resizing

Change-Id: I2d5f47dcbefb4c76834487b194a99c6f5ae7de50
Reviewed-on: https://review.haiku-os.org/c/923
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# 447f97ce 15-Nov-2014 Jessica Hamilton <jessica.l.hamilton@gmail.com>

bfs: minor refactoring of hrev48308

- also additional error checks added, as suggested
by Axel Dörfler


# cce8cb8c 15-Nov-2014 Jessica Hamilton <jessica.l.hamilton@gmail.com>

bfs: only erase first sector when initializing

f9ac1e93fb1ba12163bff4128efb54d8e548e4a8 didn't take
into account that the superblock gets written back
from places other than Initialize(), resulting in
unbootable volumes.

Now the first sector will only be erased if the volume
is being initialized.


# 29a73026 03-Mar-2012 Axel Dörfler <axeld@pinc-software.de>

Added Volume::IsValidInodeBlock().

* The method checks whether a block may be occupied by an inode, ie. is neither
part of the bitmap nor of the log, and would also fit on the disk.
* Also made disk_super_block::IsValid() const.


# c87c4796 01-Nov-2011 François Revol <revol@free.fr>

Pass an existing or created transaction to CreateVolumeID(). Hopefully it's correct this time. Axel?


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


# 9b7ff360 31-Oct-2011 François Revol <revol@free.fr>

Add creation of a be:volume_id attribute on the root node as BeOS did, based on a patch by phcoder. Thanks!


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


# 1a1a8f33 10-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Applied patch by Janito that solves a TODO and utilizes the actual device
block size to align the file map.
* This closes ticket #5707, thanks!


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


# fd91cf4d 16-Feb-2010 Axel Dörfler <axeld@pinc-software.de>

* Replaced the specialized inode in transaction mechanism with a generic one.
That costs 12 more bytes per inode on 32 bit platforms, though.


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


# 4ea6fb8b 27-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Changed the query code again to send B_ENTRY_REMOVED/B_ENTRY_CREATED
notifications if an inode in a query result was moved/renamed - this time all
the information is correct, though.
* While I did not introduce B_ENTRY_MOVED for queries yet, this should make
adding it very simple (left as an excercise for the reader ;-))


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


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

* There is now a list of removed vnodes in Volume - while asking the VFS for
this seemed to be a good idea, there is one race condition that cannot be
solved otherwise (the vnode must be added/removed to that list while holding
the transaction lock, and we cannot guarantee that in the VFS).
* We are using an unused area of the in-memory bfs_inode to store the list
links (bfs_inode::pad - this will also work on 64 bit platforms).
* Inode no longer adds a singly linked list link - the transaction list now
shares the doubly linked list with the removed vnodes list.
* Added an in-memory flag INODE_IN_TRANSACTION to avoid searching an inode
to be added in the list.
* Removing an attribute directory did not hold its write lock.
* If removing an attribute failed for some reason, the INODE_DELETED flag
was not removed (the transaction would not have failed because of that).


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


# 64e0d084 02-Jan-2009 Axel Dörfler <axeld@pinc-software.de>

* Inodes are no longer trimmed from the checking thread. This should fix bug
#3190.


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


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

* Replaced Chain with the new SinglyLinkedList.
* Renamed openModeToAccess() to open_mode_to_access().
* Cleanup.


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


# 03fa417b 07-Jul-2008 Axel Dörfler <axeld@pinc-software.de>

* Removed the home-brewn locking classes in BFS besides the read/write lock
(for now).
* Inode::fSmallDataLock is now a recursive_lock, Journal::fLock is now
a recursive_lock, too, Journal::fEntriesLock is now a mutex, as is
BPlusTree::fIteratorLock.


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


# 0dc57dbe 12-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

The log replay code now checks if a super block is valid before the current
one gets overwritten; if the log contains invalid data, it will no longer
render the whole disk unreadable. This should have helped to prevent bug #1911
(but of course the problem that there is invalid data in the log in the first
place remains).


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


# 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


# 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


# 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


# ec3d3e05 25-Oct-2004 Axel Dörfler <axeld@pinc-software.de>

Implemented the Disk Device Manager Scanning API. It's currently exported
as a separate module, but might be merged with the standard FS API.


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


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

We're now using fs_interface.h instead of fsproto.h - doesn't change much here :)


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


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

Moved the functionality of Volume::IsSuperBlockValid() into the new
disk_super_block::IsValid() method.
There is now a disk_super_block::Initialize() method that sets up
a super block for creating a new file system on it - it's currently
hard coded to produce correct results for 10 MB images, though;
the allocation group stuff has to be done a bit more flexible :)

Added a DeviceOpener class that simplifies Volume::Mount() a bit and
fixes some problems of it (forgot to call close() once or twice).
Implemented the new Volume::Initialize() method that completely
covers the mkbfs functionality.

Fixed the broken Volume::ToBlockRun() method - AFAICT it has only
be used by Volume::CreateIndicesRoot() and in dump_bplustree_node
so far (should not have been critical, as the former was probably
never called yet [only if you had tried to create an index on a
BFS volume that didn't have indices yet]).


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


# cb94280c 16-Sep-2003 Axel Dörfler <axeld@pinc-software.de>

The file system is now almost endian-aware.
Used lazy unreadable conversion: ==, !=, == 0, != 0 are endian-safe
and don't need byte swapping.
If the platform endian differs from the one selected at compile time,
it will mount all volumes read-only for now.
Uncomment BFS_BIG_ENDIAN_ONLY in the Jamfile to build the big endian
version under x86.
No matter on what platform, the compilation defaults to build BFS as
little endian file system (see bfs_endian.h for details).


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


# 4a9d9dfa 18-Jun-2003 Axel Dörfler <axeld@pinc-software.de>

Added new RecursiveLock and RecursiveLocker classes.
Added file system global locking around creating, deleting, and renaming
inodes - that's not nice, but since we have only sequential journal access,
it won't hurt concurrency much. The locks are needed to prevent certain
things from happening like two threads could theoretically create the same
file twice (one of them would have failed, but relatively late in the process).
Anyway, a better locking scheme will be implemented at a later date, but maybe
not for R1.
Small cleanup.


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


# dbba7407 17-Nov-2002 Axel Dörfler <axeld@pinc-software.de>

Renamed Volume::IsValidBlockRun() to Volume::ValidateBlockRun() because it
returns a status_t, not a boolean value.


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


# dab62fa3 08-Nov-2002 Axel Dörfler <axeld@pinc-software.de>

Fixed a big stupid bug that can cause lots of trouble: all locks created
weren't moved to the kernel (as owner), so they would be deleted after
the team which almost randomly created them died.
Benaphores are now only used if USE_BENAPHORES is defined - I have renamed
the Benaphore class to Semaphore to take the changed behaviour into account.
Added a Status() method to the Locker class.


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


# 05f02d9b 22-Oct-2002 Axel Dörfler <axeld@pinc-software.de>

Volume::Ummount() now use the NO_WRITES mode for remove_cached_device_blocks()
if the volume is read-only.
Some style changes.


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


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

Volume::Free(), and BlockAllocator::Free() now pass the block_run by value
rather than by reference.


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


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

Implemented the basics to allow uncached file access under BeOS.
This is needed for the VM swap file and if you want to mount disk images
located on the BFS volume.
There is now a BufferPool class that manages a pool of buffers, so that
Inode::ReadAt()/Inode::WriteAt() can access a file without having to use
the cache or malloc()/free().
The real uncached file access is not yet implemented, though.


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


# 447f97ced14b006722854347897b1bfd96902089 15-Nov-2014 Jessica Hamilton <jessica.l.hamilton@gmail.com>

bfs: minor refactoring of hrev48308

- also additional error checks added, as suggested
by Axel Dörfler


# cce8cb8ca3418fd4f5840ceda0cce90ee14e09d5 15-Nov-2014 Jessica Hamilton <jessica.l.hamilton@gmail.com>

bfs: only erase first sector when initializing

f9ac1e93fb1ba12163bff4128efb54d8e548e4a8 didn't take
into account that the superblock gets written back
from places other than Initialize(), resulting in
unbootable volumes.

Now the first sector will only be erased if the volume
is being initialized.


# 29a73026aa2a0dd097a5b89954722fd1fbf89fb8 03-Mar-2012 Axel Dörfler <axeld@pinc-software.de>

Added Volume::IsValidInodeBlock().

* The method checks whether a block may be occupied by an inode, ie. is neither
part of the bitmap nor of the log, and would also fit on the disk.
* Also made disk_super_block::IsValid() const.


# c87c47960cfad10e8bff6ec921def3e8d61383c6 01-Nov-2011 François Revol <revol@free.fr>

Pass an existing or created transaction to CreateVolumeID(). Hopefully it's correct this time. Axel?


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


# 9b7ff360a0be19bb16d926df971e802ea7d5c742 31-Oct-2011 François Revol <revol@free.fr>

Add creation of a be:volume_id attribute on the root node as BeOS did, based on a patch by phcoder. Thanks!


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


# 1a1a8f33d14eaedeb0847d5cf4f07d5b948cc2d2 10-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Applied patch by Janito that solves a TODO and utilizes the actual device
block size to align the file map.
* This closes ticket #5707, thanks!


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


# fd91cf4d189f91ecca91e6704796beeeee692cb5 16-Feb-2010 Axel Dörfler <axeld@pinc-software.de>

* Replaced the specialized inode in transaction mechanism with a generic one.
That costs 12 more bytes per inode on 32 bit platforms, though.


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


# 4ea6fb8bd4961cdd6177dcfa90a14ec09c94c3e4 27-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Changed the query code again to send B_ENTRY_REMOVED/B_ENTRY_CREATED
notifications if an inode in a query result was moved/renamed - this time all
the information is correct, though.
* While I did not introduce B_ENTRY_MOVED for queries yet, this should make
adding it very simple (left as an excercise for the reader ;-))


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


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

* There is now a list of removed vnodes in Volume - while asking the VFS for
this seemed to be a good idea, there is one race condition that cannot be
solved otherwise (the vnode must be added/removed to that list while holding
the transaction lock, and we cannot guarantee that in the VFS).
* We are using an unused area of the in-memory bfs_inode to store the list
links (bfs_inode::pad - this will also work on 64 bit platforms).
* Inode no longer adds a singly linked list link - the transaction list now
shares the doubly linked list with the removed vnodes list.
* Added an in-memory flag INODE_IN_TRANSACTION to avoid searching an inode
to be added in the list.
* Removing an attribute directory did not hold its write lock.
* If removing an attribute failed for some reason, the INODE_DELETED flag
was not removed (the transaction would not have failed because of that).


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


# 64e0d0841b2276f67a953dd09e900743b7cb5a2b 02-Jan-2009 Axel Dörfler <axeld@pinc-software.de>

* Inodes are no longer trimmed from the checking thread. This should fix bug
#3190.


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


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

* Replaced Chain with the new SinglyLinkedList.
* Renamed openModeToAccess() to open_mode_to_access().
* Cleanup.


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


# 03fa417b706f63305263982a61eb1002e6ff9d96 07-Jul-2008 Axel Dörfler <axeld@pinc-software.de>

* Removed the home-brewn locking classes in BFS besides the read/write lock
(for now).
* Inode::fSmallDataLock is now a recursive_lock, Journal::fLock is now
a recursive_lock, too, Journal::fEntriesLock is now a mutex, as is
BPlusTree::fIteratorLock.


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


# 0dc57dbece497e28b8ab0560ba2eca862ff7c578 12-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

The log replay code now checks if a super block is valid before the current
one gets overwritten; if the log contains invalid data, it will no longer
render the whole disk unreadable. This should have helped to prevent bug #1911
(but of course the problem that there is invalid data in the log in the first
place remains).


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


# 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


# 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


# 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


# ec3d3e05fe484c061ea1fe1b4aa59d8f679b66cd 25-Oct-2004 Axel Dörfler <axeld@pinc-software.de>

Implemented the Disk Device Manager Scanning API. It's currently exported
as a separate module, but might be merged with the standard FS API.


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


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

We're now using fs_interface.h instead of fsproto.h - doesn't change much here :)


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


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

Moved the functionality of Volume::IsSuperBlockValid() into the new
disk_super_block::IsValid() method.
There is now a disk_super_block::Initialize() method that sets up
a super block for creating a new file system on it - it's currently
hard coded to produce correct results for 10 MB images, though;
the allocation group stuff has to be done a bit more flexible :)

Added a DeviceOpener class that simplifies Volume::Mount() a bit and
fixes some problems of it (forgot to call close() once or twice).
Implemented the new Volume::Initialize() method that completely
covers the mkbfs functionality.

Fixed the broken Volume::ToBlockRun() method - AFAICT it has only
be used by Volume::CreateIndicesRoot() and in dump_bplustree_node
so far (should not have been critical, as the former was probably
never called yet [only if you had tried to create an index on a
BFS volume that didn't have indices yet]).


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


# cb94280c6b8450b48764df889cdf0a8fd19af64b 16-Sep-2003 Axel Dörfler <axeld@pinc-software.de>

The file system is now almost endian-aware.
Used lazy unreadable conversion: ==, !=, == 0, != 0 are endian-safe
and don't need byte swapping.
If the platform endian differs from the one selected at compile time,
it will mount all volumes read-only for now.
Uncomment BFS_BIG_ENDIAN_ONLY in the Jamfile to build the big endian
version under x86.
No matter on what platform, the compilation defaults to build BFS as
little endian file system (see bfs_endian.h for details).


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


# 4a9d9dfa146df5d8a5b0c118501e3662dcd02239 18-Jun-2003 Axel Dörfler <axeld@pinc-software.de>

Added new RecursiveLock and RecursiveLocker classes.
Added file system global locking around creating, deleting, and renaming
inodes - that's not nice, but since we have only sequential journal access,
it won't hurt concurrency much. The locks are needed to prevent certain
things from happening like two threads could theoretically create the same
file twice (one of them would have failed, but relatively late in the process).
Anyway, a better locking scheme will be implemented at a later date, but maybe
not for R1.
Small cleanup.


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


# dbba7407de79a2f5ad134ca8d782455e1188b931 17-Nov-2002 Axel Dörfler <axeld@pinc-software.de>

Renamed Volume::IsValidBlockRun() to Volume::ValidateBlockRun() because it
returns a status_t, not a boolean value.


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


# dab62fa391ea4aca5e0aded1f390a8e7553e1c34 08-Nov-2002 Axel Dörfler <axeld@pinc-software.de>

Fixed a big stupid bug that can cause lots of trouble: all locks created
weren't moved to the kernel (as owner), so they would be deleted after
the team which almost randomly created them died.
Benaphores are now only used if USE_BENAPHORES is defined - I have renamed
the Benaphore class to Semaphore to take the changed behaviour into account.
Added a Status() method to the Locker class.


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


# 05f02d9b9ab2bc1a4b7322155f550ac611bf0b4e 22-Oct-2002 Axel Dörfler <axeld@pinc-software.de>

Volume::Ummount() now use the NO_WRITES mode for remove_cached_device_blocks()
if the volume is read-only.
Some style changes.


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


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

Volume::Free(), and BlockAllocator::Free() now pass the block_run by value
rather than by reference.


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


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

Implemented the basics to allow uncached file access under BeOS.
This is needed for the VM swap file and if you want to mount disk images
located on the BFS volume.
There is now a BufferPool class that manages a pool of buffers, so that
Inode::ReadAt()/Inode::WriteAt() can access a file without having to use
the cache or malloc()/free().
The real uncached file access is not yet implemented, though.


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