History log of /haiku/src/add-ons/kernel/file_systems/bfs/Volume.cpp
Revision Date Author Comments
# d72239d2 17-Apr-2020 Suhel Mehta <mehtasuhel@gmail.com>

Move DeviceOpener class to a separate file.

It is used by several of the filesystems, so it seems a good idea to
move it to the shared/ directory.

UFS2, BFS, XFS, EXT2 and EXFAT are adjusted.

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


# e8f5d1ca 30-Aug-2019 Adrien Destugues <pulkomandy@pulkomandy.tk>

bfs: erase ext2 superblock when initializing

Having valid superblocks from multiple filesystems on the same disk is
confusing, let's try to avoid that.

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


# 1418cade 11-Jul-2019 Augustin Cavalier <waddlesplash@gmail.com>

file_systems: Pass size argument to ioctl in a lot more places.


# 7b117899 13-Jun-2019 Axel Dörfler <axeld@pinc-software.de>

bfs: Fixed missing block allocator uninit in case of error

* If Volume::Mount() failed opening the root node, the Volume would be
destroyed regardless of the fact that the block allocator was
initializing the bitmap asynchronously.
* For a proper shutdown, the block allocator needs to be uninitialized
first.
* This should fix #15015.

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


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


# c71d928e 07-Aug-2012 ahenriksson <sausageboy@gmail.com>

bfs: Print diagnostic message when disk size is too small

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


# 91cdfd96 19-Jan-2017 Axel Dörfler <axeld@pinc-software.de>

bfs: Never publish the index root node.

* This caused the volume to be un-unmountable when you created an index
on a non-indexed volume.


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


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

bfs: erase first sector when initialising new partition

* When writing the superblock, because it's at sector 1,
sector 0 doesn't get erased. As a result, if an
existing file system was present, identifying details
in sector 0 could cause the partition identifying code
to detect an old file system instead.

Fixes #11136.


# 46cf7a5a 14-Nov-2012 Przemysław Buczkowski <przemub@yahoo.pl>

Fix typos: super block -> superblock (#8974)

Signed-off-by: Przemysław Buczkowski <przemub@yahoo.pl>
Signed-off-by: Matt Madia <mattmadia@gmail.com>


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


# f2b71a14 09-Nov-2011 Michael Lotz <mmlr@mlotz.ch>

Revert the part of r43033 that tries to write the "be:volume_id" on mount. The
use of an attribute may cause an attribute directory access, causing a get_vnode
call that leads to KDL due to the mount not yet having completed as seen in
#8090. Moving the volume_ops initialization in bfs_mount earlier might make this
work, but it is a hack at most, as we can't really know what state the VFS is in
during a mount.


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


# 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


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

Abide by the Coding Style Police.


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


# bdce1498 06-Aug-2011 Jérôme Duval <korli@users.berlios.de>

added std::nothrow for some new calls, and initialize fCheckCookie


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


# 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


# f1d9ec98 26-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Always drop into the debugger if KDEBUG is used when BFS detects a corruption
that causes it switch to read-only mode.


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


# 66ae5b2d 26-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* The block allocator will no longer try to fix a missing allocation on a
read-only volume. This fixes bug #3432.
* Journal::ReplayLog() will now return an error on a read-only device, rendering
read-only dirty volumes unmountable.


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


# 3e69a3c2 26-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* BFS allocated always full allocation groups in the bitmap, even if the last
group was a partial one. This caused bug #3963 (Be's BFS didn't do that).
* Added new BlockAllocator::CheckBlocks() that does not depend on allocation
group limits - this fixes the problematic check in
BlockAllocator::_Initialize() to see if the super block, the block bitmap,
and the log area are all allocated - this only worked if they all fit into
the first allocation group (which happens only with partitions with more
than 1 billion blocks, ie. 2 TB would already be problematic with a 2K block
size).


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


# 076cc460 25-Mar-2009 Rene Gollent <anevilyak@gmail.com>

Have BFS create the BEOS:APP_SIG index by default also. Otherwise launching applications by signature off any partition other than one created via the build system will fail by default (since that one currently adds the index manually in build_haiku_image).



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


# 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


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

* Minor cleanup.


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


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

* Removed no longer needed IOCTL_FILE_UNCACHED_IO definition.
* Some cleanup, no functional change.


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


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

* Unmounting a volume didn't wait for the block allocator's initializer thread.
* This fixed bug #2541.


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


# 6eeea348 17-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

Also destroy the query lock in the Volume destructor.


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


# 08aba34e 28-Jun-2008 Axel Dörfler <axeld@pinc-software.de>

* Removed a now unnecessary stat() on the device to be mounted.
* Minor cleanup.


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


# 797a92d8 07-Apr-2008 Axel Dörfler <axeld@pinc-software.de>

* Made super block log handling endian-safe.
* Made all debugging functions endian-safe.
* Added tracing for log entries.
* Added new KDL command "bfs_journal" to dump all pending log entries.
* When BFS_DEBUGGER_COMMANDS is defined, the LogEntry class will also track
the transaction ID it belonged to.
* The "bfs" KDL command now sets some useful debugger variables.
* The "bfs_allocator" KDL command now accepts the group index as 3rd argument.
* Renamed Journal::_TransactionListener() to _TransactionIdle(), as that's
all it is for.
* Removed TODO comment in Volume::WriteSuperBlock(), as it's actually not true.


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


# d6e60839 04-Apr-2008 Axel Dörfler <axeld@pinc-software.de>

* Resolved a TODO: determine the log size depending on the size of the volume.


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


# 64b7ef1d 04-Apr-2008 Axel Dörfler <axeld@pinc-software.de>

* As briefly discussed in ticket #2024, I've changed BFS to allow to mount
volumes with a broken log. It will only allow the volume read-only then,
though (unlike Be's BFS), as your disk could be corrupt.
* Added InitCheck() method to the RecursiveLock class, and now only check
this one in Journal::InitCheck() instead of also replaying the log there;
this is now done directly in Volume::Mount().


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


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

* The DeviceOpener class was leaking its block cache; RemoveCache()
would never do anything as fBlockCache was never set.
* DeviceOpener::InitCache() did not always correctly propagate the
read-only flag.


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


# 6cc58858 15-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Improved error reporting when mounting a volume failed, especially when
the log couldn't be replayed.
* Minor cleanup.


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


# 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


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

* Ever since I added O_NOCACHE to the flags BFS is using to open its
device, the read-only detection did not work anymore; I've now added
handy methods to correctly check for this. This fixes bug #1829.
* Volume::Initialize() now also checks if the device could really be
opened read/write.
* Minor cleanup.


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


# 21885de2 08-Dec-2007 Axel Dörfler <axeld@pinc-software.de>

* BFS now always writes back the whole block when it writes the super block.
* Therefore, I've added an I/O control that let's it update the boot block
part of this block, so that makebootable can use it on a mounted volume
(this will probably be moved into a disk system API later).
* Added user_memcpy() to the fs_shell.
* Minor cleanup.


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


# 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


# 3bef51f0 06-May-2007 Axel Dörfler <axeld@pinc-software.de>

* Removed unused code when USER is defined - the fs_shell no longer does this, but
provides a kernel emulation layer.
* Renamed all private BPlusTree methods to have the '_' prefix.
* Removed useless set_sem_owner() from Lock.h - all semaphores created in the kernel
always belong to the system team automatically.
* Some cleanup.


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


# 68f08f67 07-May-2007 Axel Dörfler <axeld@pinc-software.de>

* Fixed a bug introduced with big-endian fixes in r17557; the super block's blocks_per_ag
field was always 1, and therefore, the last allocation group could grow too large.
Thanks to Samuel Rodriguez Perez for reporting the error (bfs_shell was crashing on
larger images).
* Minor cleanup in BlockAllocator::_Initialize().


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


# e04bcee9 28-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Made sources UserlandFS friendly. Can't be used with the fs_shell ATM,
anyway.


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


# a847b384 31-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

DeviceOpener::Open() now returns the actual error instead of -1, as suggested
by Korli.


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


# 9b906ccf 30-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

* You can now create the block cache in read-only mode (using an additional
parameter during construction).
* Doing so will now result in a kernel panic whenever your file system tries to
write to a block.


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


# eeb28bb7 03-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

Some more PPC fixes.


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


# f0280afd 22-May-2006 Axel Dörfler <axeld@pinc-software.de>

Adopted the PPC big endian fixes for disk_super_block::Initialize() and made them
a bit nicer.


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


# 074ebdda 05-May-2006 Axel Dörfler <axeld@pinc-software.de>

* When mounting an image, BFS no longer tries to set the file into uncached mode - this
will waste some memory (as the data will be cached twice), but unlike BeOS, it cannot
deadlock the cache, so it's safe to be used. In other words, mounting images is now
working as expected.
* a BFS FATAL() condition no longer results in a KDL; this seemed to confuse anybody :)


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


# 0ff9df12 27-Feb-2006 Jérôme Duval <korli@users.berlios.de>

fix comment


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


# 05807025 13-Feb-2006 Jérôme Duval <korli@users.berlios.de>

update code in #ifdef USER, should be needed when we want to use Volume::Initialize()


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


# 636d4037 18-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

Moved the "reopen when read-only" logic into the DeviceOpener class.
Since CD-ROMs let open themselves read/write, it now also checks the device
geometry, and will make sure the device is opened read-only if the geometry
structure says so - this should reduce the number of write errors you get
during boot :-)
Volume::fFlags is now always correctly maintained.


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


# 5b14757a 20-Aug-2005 Axel Dörfler <axeld@pinc-software.de>

We now have a consistent scheme what the file system should do with its root
node: like in BeOS, it *must* own the root node (ie. via publish_vnode()),
unlike in BeOS, it must also drop that reference on unmount (symmetrical
behaviour definitely makes more sense to me than the Be way).
Since all existing file systems for Haiku behaved differently, I brought them
in line (only pipefs already adhered to that new standard for some reason,
rootfs did only released the node, devfs did nothing - despite it's probably
not really useful to be able to unmount them).
fs_mount() will now panic if a file system does not do this correctly (useful
for file system developing).
Unmounting is now theoretically working again: when trying to unmount a BFS
volume, the kernel crashes in the block cache destruction... (but that's work
for tomorrow).


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


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

Needs to use publish_vnode() now (since the vnode can be accessed immediately).


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


# 972f12ee 08-Jun-2004 Axel Dörfler <axeld@pinc-software.de>

Fixed several bugs during the mount process:
- DeviceOpener::GetSize() didn't work correctly for devices - the size returned
was the block count. Also, it didn't expand the computation to 64 bits
- the check if the disk size was large enough make use of BlockShift() which
access the fBlockShift variable which wasn't initialized at that point
- if new_vnode() failed, a wrong error code was returned
- it will now write a different error message if the root node creation
failed before new_vnode() was called.


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


# 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


# 743c3cce 02-May-2004 Axel Dörfler <axeld@pinc-software.de>

The BeOS cache will no longer be turned off in case of a mounted image when
NO_FILE_UNCACHED_IO is defined at compile time.


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


# 9d372028 08-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Don't throw away any blocks at the end of the disk (we also support truncated
allocation groups).


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


# 7a791c89 08-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

blocks_per_ag has to be doubled in each iteration (was messing up the
initialization of bigger volumes).


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


# db88a56a 02-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Now calls the new fs_shell only call kill_device_vnodes() in Volume::Initialize()
to be able to remove the cache correctly (without issuing any warnings).
The Volume::Initialize() method is now only defined in USER mode (of course, this
will change in OpenBeOS).


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


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

Fixed working with volume without indices - in case of a corrupt indices node
the Inode will now be deleted, and it will only be tried to be instantiated
if the indices block_run is not zeroed out.


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


# 3bb10b93 28-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

The standard indices are now created when a volume is initialized.


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


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

Standard log size is 2048 blocks, not 4096...
Added a ToDo comment so that I don't forget to add the standard indices :)


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


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

Wrote a simple algorithm to create appropriate allocation group values
for newly initialized disks. Should work for all sizes :-)
Documented a bit what good values actually mean.


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


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

Fixed the Volume::Mount() call; BlockAllocator::Initialize() was never
called since last change (could mount volumes, but cannot write to them
anymore without errors).


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


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

Inode::Create() now prints out a reason if new_vnode() failed.
If the parent is NULL, Inode::Create() will now set node::parent to
the node itself, like BFS is doing it (for root and indices nodes only).
Added a temporary hack in Volume::Initialize() to get the inodes freed.


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


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

Removed debug output, set mode of newly created root node to 0755 instead of 0777.


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


# 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


# 1a49a098 07-Nov-2003 Nathan Whitehorn <nwhitehorn@nowhere.fake>

Bunches of changes to make mwcc like the code. I also coded an _atomic_set() and _atomic_test_and_set() for PowerPC. Of course, there's already one in the kernel tree, but mine's better. :P Now builds (and works, after a fashion) on R5 PowerPC.


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


# 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


# eabe7368 24-Feb-2003 Axel Dörfler <axeld@pinc-software.de>

Fixed wrong storage classifier (was LL instead of UL).


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


# d99c61a5 24-Feb-2003 Axel Dörfler <axeld@pinc-software.de>

Now includes fs_volume.h rather than unistd.h for B_MOUNT_READ_ONLY.


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


# 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


# 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


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


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

bfs: erase first sector when initialising new partition

* When writing the superblock, because it's at sector 1,
sector 0 doesn't get erased. As a result, if an
existing file system was present, identifying details
in sector 0 could cause the partition identifying code
to detect an old file system instead.

Fixes #11136.


# 46cf7a5a73679c6e4fde91710e4a4885242e49d1 14-Nov-2012 Przemysław Buczkowski <przemub@yahoo.pl>

Fix typos: super block -> superblock (#8974)

Signed-off-by: Przemysław Buczkowski <przemub@yahoo.pl>
Signed-off-by: Matt Madia <mattmadia@gmail.com>


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


# f2b71a14d4ffacaacc7147296fe849e155d2d3b8 09-Nov-2011 Michael Lotz <mmlr@mlotz.ch>

Revert the part of r43033 that tries to write the "be:volume_id" on mount. The
use of an attribute may cause an attribute directory access, causing a get_vnode
call that leads to KDL due to the mount not yet having completed as seen in
#8090. Moving the volume_ops initialization in bfs_mount earlier might make this
work, but it is a hack at most, as we can't really know what state the VFS is in
during a mount.


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


# 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


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

Abide by the Coding Style Police.


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


# bdce14985bcbea5f3f62404df1e877386a11d7a5 06-Aug-2011 Jérôme Duval <korli@users.berlios.de>

added std::nothrow for some new calls, and initialize fCheckCookie


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


# 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


# f1d9ec98404eea2097d2654c5133f0ef490e1929 26-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Always drop into the debugger if KDEBUG is used when BFS detects a corruption
that causes it switch to read-only mode.


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


# 66ae5b2d993e457764f5c72d2ea9ea604068187f 26-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* The block allocator will no longer try to fix a missing allocation on a
read-only volume. This fixes bug #3432.
* Journal::ReplayLog() will now return an error on a read-only device, rendering
read-only dirty volumes unmountable.


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


# 3e69a3c24a9ed31bf574a834cd720fca67846f60 26-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* BFS allocated always full allocation groups in the bitmap, even if the last
group was a partial one. This caused bug #3963 (Be's BFS didn't do that).
* Added new BlockAllocator::CheckBlocks() that does not depend on allocation
group limits - this fixes the problematic check in
BlockAllocator::_Initialize() to see if the super block, the block bitmap,
and the log area are all allocated - this only worked if they all fit into
the first allocation group (which happens only with partitions with more
than 1 billion blocks, ie. 2 TB would already be problematic with a 2K block
size).


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


# 076cc460a02d670e8e0a07cce322036ad1804c4d 25-Mar-2009 Rene Gollent <anevilyak@gmail.com>

Have BFS create the BEOS:APP_SIG index by default also. Otherwise launching applications by signature off any partition other than one created via the build system will fail by default (since that one currently adds the index manually in build_haiku_image).



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


# 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


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

* Minor cleanup.


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


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

* Removed no longer needed IOCTL_FILE_UNCACHED_IO definition.
* Some cleanup, no functional change.


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


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

* Unmounting a volume didn't wait for the block allocator's initializer thread.
* This fixed bug #2541.


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


# 6eeea348d0f804d2ab4ba12e90e34e6279357477 17-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

Also destroy the query lock in the Volume destructor.


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


# 08aba34e742ec3ebceed9f09a315b61168e87c5d 28-Jun-2008 Axel Dörfler <axeld@pinc-software.de>

* Removed a now unnecessary stat() on the device to be mounted.
* Minor cleanup.


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


# 797a92d84d79bf10ac426c11fcee064b5bcc4609 07-Apr-2008 Axel Dörfler <axeld@pinc-software.de>

* Made super block log handling endian-safe.
* Made all debugging functions endian-safe.
* Added tracing for log entries.
* Added new KDL command "bfs_journal" to dump all pending log entries.
* When BFS_DEBUGGER_COMMANDS is defined, the LogEntry class will also track
the transaction ID it belonged to.
* The "bfs" KDL command now sets some useful debugger variables.
* The "bfs_allocator" KDL command now accepts the group index as 3rd argument.
* Renamed Journal::_TransactionListener() to _TransactionIdle(), as that's
all it is for.
* Removed TODO comment in Volume::WriteSuperBlock(), as it's actually not true.


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


# d6e60839e927276dd5671e64bc3df61a8b7ae8f2 04-Apr-2008 Axel Dörfler <axeld@pinc-software.de>

* Resolved a TODO: determine the log size depending on the size of the volume.


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


# 64b7ef1d0f6354c8df9dacf557f76ff0a36c2de1 04-Apr-2008 Axel Dörfler <axeld@pinc-software.de>

* As briefly discussed in ticket #2024, I've changed BFS to allow to mount
volumes with a broken log. It will only allow the volume read-only then,
though (unlike Be's BFS), as your disk could be corrupt.
* Added InitCheck() method to the RecursiveLock class, and now only check
this one in Journal::InitCheck() instead of also replaying the log there;
this is now done directly in Volume::Mount().


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


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

* The DeviceOpener class was leaking its block cache; RemoveCache()
would never do anything as fBlockCache was never set.
* DeviceOpener::InitCache() did not always correctly propagate the
read-only flag.


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


# 6cc5885822b9b22095b35f02c6856ac73ce21e88 15-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Improved error reporting when mounting a volume failed, especially when
the log couldn't be replayed.
* Minor cleanup.


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


# 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


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

* Ever since I added O_NOCACHE to the flags BFS is using to open its
device, the read-only detection did not work anymore; I've now added
handy methods to correctly check for this. This fixes bug #1829.
* Volume::Initialize() now also checks if the device could really be
opened read/write.
* Minor cleanup.


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


# 21885de266a154a66d4027ba78b8c9ed8f12ac3b 08-Dec-2007 Axel Dörfler <axeld@pinc-software.de>

* BFS now always writes back the whole block when it writes the super block.
* Therefore, I've added an I/O control that let's it update the boot block
part of this block, so that makebootable can use it on a mounted volume
(this will probably be moved into a disk system API later).
* Added user_memcpy() to the fs_shell.
* Minor cleanup.


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


# 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


# 3bef51f0ae9112a7e60576abf6fb0b476b2f6584 06-May-2007 Axel Dörfler <axeld@pinc-software.de>

* Removed unused code when USER is defined - the fs_shell no longer does this, but
provides a kernel emulation layer.
* Renamed all private BPlusTree methods to have the '_' prefix.
* Removed useless set_sem_owner() from Lock.h - all semaphores created in the kernel
always belong to the system team automatically.
* Some cleanup.


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


# 68f08f67f519bf2508344836ff87ea7469c2a600 07-May-2007 Axel Dörfler <axeld@pinc-software.de>

* Fixed a bug introduced with big-endian fixes in r17557; the super block's blocks_per_ag
field was always 1, and therefore, the last allocation group could grow too large.
Thanks to Samuel Rodriguez Perez for reporting the error (bfs_shell was crashing on
larger images).
* Minor cleanup in BlockAllocator::_Initialize().


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


# e04bcee997abc8906297d5d3c42bf38a9cca77aa 28-Mar-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Made sources UserlandFS friendly. Can't be used with the fs_shell ATM,
anyway.


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


# a847b384c6ab08d6cab8afa785978c8ff30f1d34 31-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

DeviceOpener::Open() now returns the actual error instead of -1, as suggested
by Korli.


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


# 9b906ccf04dba976f4267598ecf755841a866dd6 30-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

* You can now create the block cache in read-only mode (using an additional
parameter during construction).
* Doing so will now result in a kernel panic whenever your file system tries to
write to a block.


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


# eeb28bb7eebe356e2f9e8a5fbe41ac787bc3f8cb 03-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

Some more PPC fixes.


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


# f0280afd936de16b18783e54dc598faf8ec40f35 22-May-2006 Axel Dörfler <axeld@pinc-software.de>

Adopted the PPC big endian fixes for disk_super_block::Initialize() and made them
a bit nicer.


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


# 074ebdda4ae9932b3bd3af85261a63e4db689bb3 05-May-2006 Axel Dörfler <axeld@pinc-software.de>

* When mounting an image, BFS no longer tries to set the file into uncached mode - this
will waste some memory (as the data will be cached twice), but unlike BeOS, it cannot
deadlock the cache, so it's safe to be used. In other words, mounting images is now
working as expected.
* a BFS FATAL() condition no longer results in a KDL; this seemed to confuse anybody :)


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


# 0ff9df126c2aa6a73bb3204973d0c684a104c10d 27-Feb-2006 Jérôme Duval <korli@users.berlios.de>

fix comment


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


# 058070254d69df0045e999ba1bd5ee8bd2cc6c64 13-Feb-2006 Jérôme Duval <korli@users.berlios.de>

update code in #ifdef USER, should be needed when we want to use Volume::Initialize()


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


# 636d40373d031e721aa527628ba3190ad4d76008 18-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

Moved the "reopen when read-only" logic into the DeviceOpener class.
Since CD-ROMs let open themselves read/write, it now also checks the device
geometry, and will make sure the device is opened read-only if the geometry
structure says so - this should reduce the number of write errors you get
during boot :-)
Volume::fFlags is now always correctly maintained.


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


# 5b14757a30be0b805e2688cdc5341177f2d703fb 20-Aug-2005 Axel Dörfler <axeld@pinc-software.de>

We now have a consistent scheme what the file system should do with its root
node: like in BeOS, it *must* own the root node (ie. via publish_vnode()),
unlike in BeOS, it must also drop that reference on unmount (symmetrical
behaviour definitely makes more sense to me than the Be way).
Since all existing file systems for Haiku behaved differently, I brought them
in line (only pipefs already adhered to that new standard for some reason,
rootfs did only released the node, devfs did nothing - despite it's probably
not really useful to be able to unmount them).
fs_mount() will now panic if a file system does not do this correctly (useful
for file system developing).
Unmounting is now theoretically working again: when trying to unmount a BFS
volume, the kernel crashes in the block cache destruction... (but that's work
for tomorrow).


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


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

Needs to use publish_vnode() now (since the vnode can be accessed immediately).


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


# 972f12eeb47ffa938f1a9021036c5c1b21730172 08-Jun-2004 Axel Dörfler <axeld@pinc-software.de>

Fixed several bugs during the mount process:
- DeviceOpener::GetSize() didn't work correctly for devices - the size returned
was the block count. Also, it didn't expand the computation to 64 bits
- the check if the disk size was large enough make use of BlockShift() which
access the fBlockShift variable which wasn't initialized at that point
- if new_vnode() failed, a wrong error code was returned
- it will now write a different error message if the root node creation
failed before new_vnode() was called.


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


# 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


# 743c3cceb9f2fc54e6e878bbdfc787d96079dd69 02-May-2004 Axel Dörfler <axeld@pinc-software.de>

The BeOS cache will no longer be turned off in case of a mounted image when
NO_FILE_UNCACHED_IO is defined at compile time.


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


# 9d37202871f1cea27991c938d772065817a8dc77 08-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Don't throw away any blocks at the end of the disk (we also support truncated
allocation groups).


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


# 7a791c897c281af928b64d2a2590cc70a8b32e68 08-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

blocks_per_ag has to be doubled in each iteration (was messing up the
initialization of bigger volumes).


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


# db88a56aa876aa4ee408e78f5064b3605c42bb2b 02-Feb-2004 Axel Dörfler <axeld@pinc-software.de>

Now calls the new fs_shell only call kill_device_vnodes() in Volume::Initialize()
to be able to remove the cache correctly (without issuing any warnings).
The Volume::Initialize() method is now only defined in USER mode (of course, this
will change in OpenBeOS).


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


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

Fixed working with volume without indices - in case of a corrupt indices node
the Inode will now be deleted, and it will only be tried to be instantiated
if the indices block_run is not zeroed out.


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


# 3bb10b93235d69aeca99f47da9b1722cec44c36c 28-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

The standard indices are now created when a volume is initialized.


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


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

Standard log size is 2048 blocks, not 4096...
Added a ToDo comment so that I don't forget to add the standard indices :)


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


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

Wrote a simple algorithm to create appropriate allocation group values
for newly initialized disks. Should work for all sizes :-)
Documented a bit what good values actually mean.


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


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

Fixed the Volume::Mount() call; BlockAllocator::Initialize() was never
called since last change (could mount volumes, but cannot write to them
anymore without errors).


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


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

Inode::Create() now prints out a reason if new_vnode() failed.
If the parent is NULL, Inode::Create() will now set node::parent to
the node itself, like BFS is doing it (for root and indices nodes only).
Added a temporary hack in Volume::Initialize() to get the inodes freed.


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


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

Removed debug output, set mode of newly created root node to 0755 instead of 0777.


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


# 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


# 1a49a0986bd50ef30d406b4f5001a0784d344015 07-Nov-2003 Nathan Whitehorn <nwhitehorn@nowhere.fake>

Bunches of changes to make mwcc like the code. I also coded an _atomic_set() and _atomic_test_and_set() for PowerPC. Of course, there's already one in the kernel tree, but mine's better. :P Now builds (and works, after a fashion) on R5 PowerPC.


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


# 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


# eabe73689f954b2cd68b1599b537f6d41ec8047e 24-Feb-2003 Axel Dörfler <axeld@pinc-software.de>

Fixed wrong storage classifier (was LL instead of UL).


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


# d99c61a52c33d571d49be5c47a90480e7916e476 24-Feb-2003 Axel Dörfler <axeld@pinc-software.de>

Now includes fs_volume.h rather than unistd.h for B_MOUNT_READ_ONLY.


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


# 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


# 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


# 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