From e620c9328cb8e95f6e3e3f74b3d1afa7b216f9ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 18 Oct 2005 20:52:15 +0000 Subject: [PATCH] Argl, turns out Be's replay log routine cannot handle block_runs with a size unequal 1 - IOW using block_runs here is completely bogus. Crippled our code to not create longer block_runs - at least, a dirty BFS image is now a dirty BFS image - you can mount a dirty image on either system and it will work :-) The R5 version of our BFS is still incompatible though - ie. running bfs_shell or copy_to_bfs_image on a dirty image will still potentially corrupt it. Maybe I'll even port the changes over one day... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14418 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/Journal.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/add-ons/kernel/file_systems/bfs/Journal.cpp b/src/add-ons/kernel/file_systems/bfs/Journal.cpp index 563b0721da..61969c5f2f 100644 --- a/src/add-ons/kernel/file_systems/bfs/Journal.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Journal.cpp @@ -166,6 +166,9 @@ RunArrays::_AddRun(block_run &run) { ASSERT(run.length == 1); + // Be's BFS log replay routine can only deal with block_runs of size 1 + // A pity, isn't it? Too sad we have to be compatible. +#if 0 // search for an existing adjacent block_run // ToDo: this could be improved by sorting and a binary search @@ -193,6 +196,7 @@ RunArrays::_AddRun(block_run &run) } } } +#endif // no entry found, add new to the last array @@ -381,7 +385,6 @@ Journal::_ReplayRunArray(int32 *_start) if (data == NULL) RETURN_ERROR(B_IO_ERROR); -dprintf("replay block: %Ld\n", fVolume->ToBlock(run) + i); ssize_t written = write_pos(fVolume->Device(), offset + (i * blockSize), data, blockSize); if (written != blockSize) @@ -562,6 +565,7 @@ Journal::WriteLogEntry() run_array *array = runArrays.ArrayAt(k); int32 index = 0, count = 1; int32 wrap = fLogSize - logStart; + add_to_iovec(vecs, index, maxVecs, (void *)array, fVolume->BlockSize()); // add block runs