397 Commits

Author SHA1 Message Date
Axel Dörfler
feec20d64b 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
2004-05-07 11:13:17 +00:00
Axel Dörfler
6f7e72c0b7 Moved the logic from bfs_close() to bfs_free_cookie() - apparently, doing
anything in bfs_close() does not really makes sense. Thanks to Ingo for
pointing this out.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7429 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-06 12:31:18 +00:00
Axel Dörfler
c697a0f4cc When you now set COMPILE_FOR_ZETA=1 on the command line when jamming, the
api version will be set to 3 as required for Dano/Zeta - apparently, the
previous mechanism doesn't work with our headers, as we don't define
B_BEOS_VERSION_DANO at all :)
Fixed the build again (because of the stdio switch).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7428 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-06 12:30:23 +00:00
Bruno G. Albuquerque
4e936bb759 Now when BFS_REPLACEMENT is set, the name used for the add-on is "bfs" instead
of "obfs" (thanks Ingo). Also, changed the destination directory. It was formelly
"beos/system/add-ons/kernel/file_systems/bfs/" and now it is
"beos/system/add-ons/kernel/file_systems/" (as it should be).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7411 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-04 22:07:12 +00:00
Axel Dörfler
34cf473d12 BlockAllocator::CheckBlockRun() can now also check for non-allocated ranges.
Fixed a possible endian problem in CheckBlockRun(), too.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7405 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-04 01:42:53 +00:00
Bruno G. Albuquerque
b1e752314f Ops! :)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7404 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-04 01:27:17 +00:00
Bruno G. Albuquerque
e4758ac382 Added BFS_REPLACEMENT define that will enable compiling OpenBFS as as full
BFS replacement (will report itself as "bfs" instead of "obfs". Is there a
way to change the add-on name based on the same define?


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7403 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-04 01:24:27 +00:00
Axel Dörfler
c832ff1e1b Fixed a race condition in the block allocator initialization (the lock was held
too late, and could theoretically already be acquired by someone else).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7402 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-04 00:07:38 +00:00
Axel Dörfler
743c3cceb9 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
2004-05-02 22:58:15 +00:00
beveloper
9e0c18a3e0 added new MIME types to allow playing OGG movies and mpc audio files from mounted FAT32 (windows) partitions
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6796 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-02-28 23:50:08 +00:00
Axel Dörfler
9d37202871 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
2004-02-09 00:11:31 +00:00
Axel Dörfler
7a791c897c 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
2004-02-09 00:01:11 +00:00
Axel Dörfler
db88a56aa8 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
2004-02-03 02:14:51 +00:00
Axel Dörfler
5b25332a79 This should fix the recently introduced locking problems:
- locking policy is now: 1) the volume lock, 2) the inode lock, 3) start
  the transaction (the journal lock) - you don't need all locks, but you
  have to follow this order when you need more than one of them.
- in many cases, this makes our inode read/write lock useless. I am really
  looking forward to the OpenBeOS VFS layer where we can remove many of
  these locks again.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6464 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-02-02 01:50:00 +00:00
Axel Dörfler
36660c5e99 Switched from direct get_vnode() usage to the Vnode class.
Now acquires the volume lock always before get_vnode() is called as long
as UNSAFE_GET_VNODE is defined (which now is by default).
May cause some unwanted side-effects; it still has to be thorougly tested.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6424 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-30 00:47:56 +00:00
Axel Dörfler
b39a7a0edd Fixed the "inode is not becoming unbusy" problem.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6423 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-29 23:46:23 +00:00
Axel Dörfler
01338285a9 Some minor style changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6417 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-29 22:19:17 +00:00
Axel Dörfler
73e3e50c41 Fixed the bug that caused the "vnode already exists with different cookie"
crash: bfs_inode::InitCheck() didn't check INODE_DELETED, and Inode::Remove()
didn't clear the INODE_IN_USE flag (as the original BFS, IIRC).
Some more debug output and checks.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6416 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-29 22:14:07 +00:00
Axel Dörfler
fc2f5c4f98 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
2004-01-29 10:45:54 +00:00
Axel Dörfler
403d1302de Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6404 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-29 10:44:18 +00:00
Axel Dörfler
11805f2d85 BlockAllocator::InitializeAndClearBitmap() now also sets the used_blocks
field of the super block correctly.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6399 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-28 23:12:59 +00:00
Axel Dörfler
3bb10b9323 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
2004-01-28 23:07:52 +00:00
Axel Dörfler
b41bf79188 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
2004-01-27 22:41:32 +00:00
Axel Dörfler
a49b150fff Removed the fOwningThread functionality from the Journal class; it now
just uses a RecursiveLock instead.
Changed Journal::CurrentTransaction() so that it returns the current
transaction only if it's valid for the thread asking for it.
That doesn't fix the bug, but changed its timing a bit.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6356 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-27 11:19:05 +00:00
Axel Dörfler
0057030901 Added some more debug output and checks.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6355 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-27 11:15:43 +00:00
Axel Dörfler
d401c62383 Fixed typo.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6354 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-27 11:14:37 +00:00
Axel Dörfler
8364cf0a90 Added a LockWithTimeout() method to the RecursiveLock class.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6353 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-27 11:11:18 +00:00
Axel Dörfler
3eacb520e4 The InodeAllocator will now remove the INODE_NOT_READY flag to unblock
any pending bfs_read_vnode() calls when it is destructed and the inode
goes away.
Fixed some endian related issues.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6350 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-27 09:54:47 +00:00
Axel Dörfler
d61e7f330a 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
2004-01-27 02:26:22 +00:00
Axel Dörfler
965c8c8b4d 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
2004-01-26 12:29:26 +00:00
Axel Dörfler
9e72b7739d 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
2004-01-26 03:38:08 +00:00
Axel Dörfler
ddf3d84685 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
2004-01-26 03:20:07 +00:00
Axel Dörfler
aac1dff951 Updated the comment in bfs_initialize() - which we don't need for R5 (as it's
never called).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6314 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-26 02:45:54 +00:00
Axel Dörfler
3154133754 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
2004-01-26 02:44:27 +00:00
Axel Dörfler
d7db210882 Fixed a bug that could happen when calling Inode::Create() with unusual
arguments (such for creating a root directory, for example).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6312 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-26 02:08:31 +00:00
Axel Dörfler
81566b9389 Implemented initalizing the bitmap of a fresh volume in the new call
BlockAllocator::InitializeAndClearBitmap().
Added BlockAllocator::BitmapSize() which returns the size of the block
bitmap in bytes - used it where appropriate.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6311 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-26 02:06:47 +00:00
François Revol
4d8c3e52a9 Fixed prototype names
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6302 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-25 20:31:53 +00:00
Axel Dörfler
67a14a5ee7 Unbroke the debug build (also in user mode).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6293 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-25 15:03:38 +00:00
Axel Dörfler
ba6b73149c Not needed anymore, now uses kernel.cpp/h (same thing, just in a standard location).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6292 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-25 14:50:09 +00:00
Axel Dörfler
54343bbc2d Switched to kernel_cpp.h/cpp.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6291 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-25 14:48:40 +00:00
Axel Dörfler
aef00d7b03 Cleaned up the debug mess mmu_man has created (thanks anyway!).
Fixed a bug where the debug commands would be added in bfs_mount(), but
not removed (since bfs_unmount() is only called if bfs_mount() doesn't
fail).
Switched to kernel_cpp.h/cpp.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6290 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-25 14:46:24 +00:00
Axel Dörfler
a893229e08 Cleaned up the debug mess mmu_man has created (thanks anyway!).
Switched to kernel_cpp.h/cpp.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6289 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-25 14:44:51 +00:00
Axel Dörfler
b53b9c0cd9 Cleaned the debug mess mmu_man created (thanks anyway).
Switched to kernel_cpp.h/cpp.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6288 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-25 14:43:37 +00:00
Axel Dörfler
55b5474b8b Added _PACKED to the on-disk structures.
Switched to kernel_cpp.h/cpp.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6287 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-25 14:38:51 +00:00
François Revol
32e3f99972 Debug Inode ctor/dctor; fix printf args warnigns
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6285 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-25 13:36:13 +00:00
Bruno G. Albuquerque
fbe89ed67b We forgot about the B_MIME_STRING_TYPE when creating indices and the BEOS:APP_SIG index was failing to be created. It looks the registrar calls the index creation with that type although it is not directly available in the command line tool mkindex, for example.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6274 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-25 11:03:23 +00:00
François Revol
91e6897c63 Added obfsinode kernel debugger command.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6262 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-25 00:11:34 +00:00
Axel Dörfler
40997e1444 Added the _PACKED attribute to the BFS on-disk structures to be sure
the compiler doesn't break anything by aligning them differently.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6215 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-21 15:57:03 +00:00
Tyler Dauwalder
f3062637c3 Removed unused definitions.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6188 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-20 06:23:42 +00:00
Tyler Dauwalder
063b74d2f0 Switched from USER to _KERNEL_MODE for detecting user vs. kernel versions.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6187 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-01-20 06:23:08 +00:00