From 55e5a42d7316254bec05c7cb362caf5406e5b6a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 31 Mar 2012 15:14:46 +0200 Subject: [PATCH] Fixed misuse of Transaction::Split(). * This would cause "transaction too large" messages, and repairing the index would actually be thrown away. * We now properly finish/restart transactions instead which is actually working. * Removed the misleading Split() method altogether, as it's not even used anywhere (not very surprising given that it doesn't do what its name suggests). --- src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp | 9 ++++++--- src/add-ons/kernel/file_systems/bfs/Journal.h | 8 +------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp b/src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp index 2720f72d36..bcd7ddcd08 100644 --- a/src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp +++ b/src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp @@ -797,9 +797,12 @@ BPlusTree::MakeEmpty() node->overflow_link = HOST_ENDIAN_TO_BFS_INT64((uint64)BPLUSTREE_FREE); - // It's not important to write it out in a single transaction - if (transaction.IsTooLarge()) - transaction.Split(); + // It's not important to write it out in a single transaction; just + // make sure it doesn't get too large + if (offset % (1024 * 1024) == 0) { + transaction.Done(); + transaction.Start(fStream->GetVolume(), fStream->BlockNumber()); + } } return transaction.Done(); diff --git a/src/add-ons/kernel/file_systems/bfs/Journal.h b/src/add-ons/kernel/file_systems/bfs/Journal.h index 848817c399..c128a96c2b 100644 --- a/src/add-ons/kernel/file_systems/bfs/Journal.h +++ b/src/add-ons/kernel/file_systems/bfs/Journal.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2010, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2001-2012, Axel Dörfler, axeld@pinc-software.de. * This file may be used under the terms of the MIT License. */ #ifndef JOURNAL_H @@ -178,12 +178,6 @@ public: return B_OK; } - void Split() - { - cache_start_sub_transaction(fJournal->GetVolume()->BlockCache(), - fJournal->TransactionID()); - } - Volume* GetVolume() const { return fJournal != NULL ? fJournal->GetVolume() : NULL; } int32 ID() const