Update of /cvsroot/freenet/freenet/src/freenet/fs/dir
In directory sc8-pr-cvs1:/tmp/cvs-serv22304/src/freenet/fs/dir

Modified Files:
        NativeFSDirectory.java 
Log Message:
6368:
Don't forget to call TrailerWriteCallback.closed() when something breaks. We may have 
been leaking trailer send states.
Implement a timeout of 5 minutes in TrailerWriterOutputStream.
Make space usage calculation more pessimistic - assume 1 block of overhead per file.
Apparently, Calendar.MONTH is 0 based but Calendar.DAY_OF_MONTH isn't. Fix.

Index: NativeFSDirectory.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/fs/dir/NativeFSDirectory.java,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -w -r1.171 -r1.172
--- NativeFSDirectory.java      18 Nov 2003 13:36:49 -0000      1.171
+++ NativeFSDirectory.java      3 Dec 2003 15:41:16 -0000       1.172
@@ -1461,8 +1461,11 @@
      */
     public long spaceForFile(long x)
     {
+       // The number of blocks needed - 4095 is 1, 4096 is 1, 4097 is 2.
+       // Plus 1 for filesystem overhead (pretty pessimistic...)
+       // We *could* have a separate overhead parameter... FIXME ?
         if(x<0) return x;
-        else return ((x/blockSize)+(((x%blockSize)==0)?0:1))*blockSize;
+        else return ((x/blockSize)+(((x%blockSize)==0)?0:1)+1)*blockSize;
     }
 
     // Checkpoint interface

_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to