Revision: 5825
http://jnode.svn.sourceforge.net/jnode/?rev=5825&view=rev
Author: galatnm
Date: 2011-06-24 08:53:44 +0000 (Fri, 24 Jun 2011)
Log Message:
-----------
Remove commented code.
Modified Paths:
--------------
trunk/fs/src/fs/org/jnode/fs/ext2/cache/BlockCache.java
trunk/fs/src/fs/org/jnode/fs/ext2/cache/INodeCache.java
Modified: trunk/fs/src/fs/org/jnode/fs/ext2/cache/BlockCache.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/ext2/cache/BlockCache.java 2011-06-21 18:12:05 UTC (rev 5824)
+++ trunk/fs/src/fs/org/jnode/fs/ext2/cache/BlockCache.java 2011-06-24 08:53:44 UTC (rev 5825)
@@ -17,7 +17,7 @@
* along with this library; If not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-
+
package org.jnode.fs.ext2.cache;
import java.io.IOException;
@@ -49,20 +49,13 @@
cacheListeners.add(listener);
}
- /*
- * private boolean containsKey(Integer key) { boolean result =
- * super.containsKey(key); if(result) log.debug("CACHE HIT, size:"+size());
- * else log.debug("CACHE MISS"); return result; }
- */
-
protected synchronized boolean removeEldestEntry(Map.Entry<Object, Block> eldest) {
log.debug("BlockCache size: " + size());
if (size() > MAX_SIZE) {
try {
eldest.getValue().flush();
// notify the listeners
- final CacheEvent event = new CacheEvent(eldest.getValue(),
- CacheEvent.REMOVED);
+ final CacheEvent event = new CacheEvent(eldest.getValue(), CacheEvent.REMOVED);
for (CacheListener l : cacheListeners) {
l.elementRemoved(event);
}
Modified: trunk/fs/src/fs/org/jnode/fs/ext2/cache/INodeCache.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/ext2/cache/INodeCache.java 2011-06-21 18:12:05 UTC (rev 5824)
+++ trunk/fs/src/fs/org/jnode/fs/ext2/cache/INodeCache.java 2011-06-24 08:53:44 UTC (rev 5825)
@@ -17,7 +17,7 @@
* along with this library; If not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-
+
package org.jnode.fs.ext2.cache;
import java.util.Hashtable;
@@ -34,52 +34,3 @@
super(initialCapacity, loadFactor);
}
}
-
-/*
-public class INodeCache extends LinkedHashMap {
- // at most MAX_SIZE blocks fit in the cache
- static final int MAX_SIZE = 10;
- private final Logger log = Logger.getLogger(getClass());
-
- public INodeCache(int initialCapacity, float loadFactor) {
- super(Math.min(MAX_SIZE, initialCapacity), loadFactor, true);
- // super(initialCapacity,loadFactor);
- log.setLevel(Level.DEBUG);
- }
-
-// public boolean containsKey(Integer key) {
-// boolean result = super.containsKey(key);
-// if (result)
-// log.debug("INODE CACHE HIT, size:" + size());
-// else
-// log.debug("INODE CACHE MISS");
-// return result;
-// }
-
- protected synchronized boolean removeEldestEntry(final Map.Entry eldest) {
- log.debug("INodeCache size: " + size());
- INode eldestINode = (INode) eldest.getValue();
- synchronized (eldestINode) {
- while (eldestINode.isLocked()) {
- // an other thread has indicated that this inode
- // should not be removed from the cache
- try {
- log.info("** Waiting for an other thread to unlock inode " + eldestINode);
- eldestINode.wait(1000);
- } catch (InterruptedException iex) {
- }
- }
-
- if (size() > MAX_SIZE) {
- try {
- eldestINode.flush();
- } catch (Exception e) {
- log.error("Can't flush inode!", e);
- }
- return true;
- } else
- return false;
- }
- }
-}
-*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|