Author: nextgens
Date: 2006-07-23 17:38:38 +0000 (Sun, 23 Jul 2006)
New Revision: 9738

Modified:
   trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
Log:
same thing

Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2006-07-23 
17:33:10 UTC (rev 9737)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2006-07-23 
17:38:38 UTC (rev 9738)
@@ -449,7 +449,7 @@
                                        }
                                        t = 
environment.beginTransaction(null,null);
                                        long blockNum = chkBlocksInStore++;
-                                       StoreBlock storeBlock = new 
StoreBlock(blockNum);
+                                       StoreBlock storeBlock = new 
StoreBlock(this, blockNum);
                                        DatabaseEntry routingkeyDBE = new 
DatabaseEntry(routingkey);
                                        DatabaseEntry blockDBE = new 
DatabaseEntry();
                                        
storeBlockTupleBinding.objectToEntry(storeBlock, blockDBE);
@@ -1003,7 +1003,7 @@
                c.close();
                // Deleted, so we can now reuse it.
                // Because we acquired a write lock, nobody else has taken it.
-               StoreBlock storeBlock = new 
StoreBlock(oldStoreBlock.getOffset());
+               StoreBlock storeBlock = new StoreBlock(this, 
oldStoreBlock.getOffset());
                DatabaseEntry blockDBE = new DatabaseEntry();
                storeBlockTupleBinding.objectToEntry(storeBlock, blockDBE);
                chkDB.put(t,routingkeyDBE,blockDBE);
@@ -1016,7 +1016,7 @@

        private void writeNewBlock(long blockNum, byte[] header, byte[] data, 
Transaction t, DatabaseEntry routingkeyDBE) throws DatabaseException, 
IOException {
                long byteOffset = blockNum*(dataBlockSize+headerBlockSize);
-               StoreBlock storeBlock = new StoreBlock(blockNum);
+               StoreBlock storeBlock = new StoreBlock(this, blockNum);
                DatabaseEntry blockDBE = new DatabaseEntry();
                storeBlockTupleBinding.objectToEntry(storeBlock, blockDBE);
                chkDB.put(t,routingkeyDBE,blockDBE);
@@ -1132,8 +1132,8 @@
        private long recentlyUsed;
        private long offset;

-       public StoreBlock(long offset) {
-               this(offset,getNewRecentlyUsed());
+       public StoreBlock(final BerkeleyDBFreenetStore bdbfs, long offset) {
+               this(offset, bdbfs.getNewRecentlyUsed());
        }

        public StoreBlock(long offset,long recentlyUsed) {


Reply via email to