From bd0b075c13cdd879648f1ed118035e1e928b2cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 19 Oct 2005 14:36:21 +0000 Subject: [PATCH] Now takes the off-by-one error in Be's BFS implemenation into account, too. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14428 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/Journal.cpp | 3 ++- src/add-ons/kernel/file_systems/bfs/Journal.h | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/Journal.cpp b/src/add-ons/kernel/file_systems/bfs/Journal.cpp index 61969c5f2f..2843e9a203 100644 --- a/src/add-ons/kernel/file_systems/bfs/Journal.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Journal.cpp @@ -24,7 +24,8 @@ struct run_array { block_run runs[0]; int32 CountRuns() const { return BFS_ENDIAN_TO_HOST_INT32(count); } - int32 MaxRuns() const { return BFS_ENDIAN_TO_HOST_INT32(max_runs); } + int32 MaxRuns() const { return BFS_ENDIAN_TO_HOST_INT32(max_runs) - 1; } + // that -1 accounts for an off-by-one error in Be's BFS implementation const block_run &RunAt(int32 i) const { return runs[i]; } static int32 MaxRuns(int32 blockSize) diff --git a/src/add-ons/kernel/file_systems/bfs/Journal.h b/src/add-ons/kernel/file_systems/bfs/Journal.h index 604b297d3f..f306a85fc5 100644 --- a/src/add-ons/kernel/file_systems/bfs/Journal.h +++ b/src/add-ons/kernel/file_systems/bfs/Journal.h @@ -62,8 +62,6 @@ class Journal { inline uint32 FreeLogBlocks() const; private: - friend class LogEntry; - status_t _CheckRunArray(const run_array *array); status_t _ReplayRunArray(int32 *start); status_t _TransactionDone(bool success);