* Minor work in progress of getting the test to run again. Never found the time

to complete it, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42813 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2011-10-09 18:35:39 +00:00
parent d41559757e
commit f6e59c500a
4 changed files with 26 additions and 11 deletions
@@ -10,7 +10,6 @@
#include <SupportDefs.h> #include <SupportDefs.h>
#include <File.h> #include <File.h>
#include "Lock.h"
#include "bfs.h" #include "bfs.h"
@@ -23,7 +22,7 @@ class Inode {
Inode(const char *name,int32 mode = S_STR_INDEX | S_ALLOW_DUPS); Inode(const char *name,int32 mode = S_STR_INDEX | S_ALLOW_DUPS);
~Inode(); ~Inode();
ReadWriteLock &Lock() { return fLock; } rw_lock &Lock() { return fLock; }
status_t FindBlockRun(off_t pos,block_run &run,off_t &offset); status_t FindBlockRun(off_t pos,block_run &run,off_t &offset);
status_t Append(Transaction *,off_t bytes); status_t Append(Transaction *,off_t bytes);
@@ -48,9 +47,9 @@ class Inode {
Volume *fVolume; Volume *fVolume;
BFile fFile; BFile fFile;
off_t fSize; off_t fSize;
ReadWriteLock fLock; rw_lock fLock;
int32 fMode; int32 fMode;
// for dump_inode() only: // for dump_inode() only:
off_t fOldSize; off_t fOldSize;
off_t fOldLastModified; off_t fOldLastModified;
@@ -1,19 +1,20 @@
SubDir HAIKU_TOP src tests add-ons kernel file_systems bfs btree ; SubDir HAIKU_TOP src tests add-ons kernel file_systems bfs btree ;
SubDirHdrs $(HAIKU_TOP) src tests add-ons kernel file_systems bfs r5 ; SubDirHdrs $(HAIKU_TOP) src add-ons kernel file_systems bfs ;
UsePrivateHeaders [ FDirName kernel ] ; # For kernel_cpp.cpp UsePrivateKernelHeaders ;
UsePrivateHeaders shared ;
rule FPreIncludes { return -include\ $(1:D=$(SUBDIR)) ; } rule FPreIncludes { return -include\ $(1:D=$(SUBDIR)) ; }
{ {
local defines = [ FDefines USER DEBUG ] ; # _NO_INLINE_ASM local defines = [ FDefines USER DEBUG ] ; # _NO_INLINE_ASM
local preIncludes = [ FPreIncludes Journal.h Inode.h ] ; local preIncludes = [ FPreIncludes Journal.h Inode.h ] ;
SubDirC++Flags $(defines) $(preIncludes) -fno-exceptions -fno-rtti ; #-fcheck-memory-usage SubDirC++Flags $(defines) $(preIncludes) -fno-exceptions ; #-fcheck-memory-usage
} }
SimpleTest btreeTest SimpleTest btreeTest
: test.cpp : #test.cpp
Volume.cpp Volume.cpp
Inode.cpp Inode.cpp
cache.cpp cache.cpp
@@ -24,4 +25,4 @@ SimpleTest btreeTest
# Tell Jam where to find these sources # Tell Jam where to find these sources
SEARCH on [ FGristFiles BPlusTree.cpp Utility.cpp Debug.cpp ] SEARCH on [ FGristFiles BPlusTree.cpp Utility.cpp Debug.cpp ]
= [ FDirName $(HAIKU_TOP) src tests add-ons kernel file_systems bfs r5 ] ; = [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems bfs ] ;
@@ -11,9 +11,24 @@
#include "Volume.h" #include "Volume.h"
#include "Debug.h" #include "Debug.h"
#include "Utility.h"
#include "cache.h" #include "cache.h"
class TransactionListener
: public DoublyLinkedListLinkImpl<TransactionListener> {
public:
TransactionListener();
virtual ~TransactionListener();
virtual void TransactionDone(bool success) = 0;
virtual void RemovedFromTransaction() = 0;
};
typedef DoublyLinkedList<TransactionListener> TransactionListeners;
class Transaction { class Transaction {
public: public:
Transaction(Volume *volume,off_t refBlock) Transaction(Volume *volume,off_t refBlock)
@@ -39,4 +54,5 @@ class Transaction {
Volume *fVolume; Volume *fVolume;
}; };
#endif /* JOURNAL_H */ #endif /* JOURNAL_H */
@@ -9,7 +9,6 @@
#include <SupportDefs.h> #include <SupportDefs.h>
#include "Lock.h"
#include "bfs.h" #include "bfs.h"
@@ -27,7 +26,7 @@ class Volume {
block_run ToBlockRun(off_t block) const { return block_run::Run(0,0,block); } block_run ToBlockRun(off_t block) const { return block_run::Run(0,0,block); }
static void Panic(); static void Panic();
private: private:
BFile *fFile; BFile *fFile;
}; };