From: <ga...@us...> - 2012-08-10 07:08:10
|
Revision: 5918 http://jnode.svn.sourceforge.net/jnode/?rev=5918&view=rev Author: galatnm Date: 2012-08-10 07:08:00 +0000 (Fri, 10 Aug 2012) Log Message: ----------- Add some extra debugging to Ext2File Modified Paths: -------------- trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Directory.java trunk/fs/src/fs/org/jnode/fs/ext2/Ext2File.java trunk/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java Modified: trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Directory.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Directory.java 2012-08-10 06:57:21 UTC (rev 5917) +++ trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Directory.java 2012-08-10 07:08:00 UTC (rev 5918) @@ -227,10 +227,10 @@ //so synchronize to the inode. synchronized (iNode) { try { - Ext2File dir = new Ext2File(iNode); //read itself as a file + Ext2File dir = new Ext2File(entry); //read itself as a file //find the last directory record (if any) - Ext2FSEntryIterator iterator = new Ext2FSEntryIterator(iNode); + Ext2FSEntryIterator iterator = new Ext2FSEntryIterator(entry); Ext2DirectoryRecord rec = null; while (iterator.hasNext()) { rec = iterator.nextDirectoryRecord(); @@ -337,9 +337,9 @@ Ext2DirectoryRecord current; - public Ext2FSEntryIterator(INode iNode) throws IOException { + public Ext2FSEntryIterator(Ext2Entry entry) throws IOException { //read itself as a file - Ext2File directoryFile = new Ext2File(iNode); + Ext2File directoryFile = new Ext2File(entry); //read the whole directory data = ByteBuffer.allocate((int) directoryFile.getLength()); @@ -424,7 +424,7 @@ * @return the FSEntryTable containing the directory's entries. */ protected FSEntryTable readEntries() throws IOException { - Ext2FSEntryIterator it = new Ext2FSEntryIterator(iNode); + Ext2FSEntryIterator it = new Ext2FSEntryIterator(entry); ArrayList<FSEntry> entries = new ArrayList<FSEntry>(); while (it.hasNext()) { Modified: trunk/fs/src/fs/org/jnode/fs/ext2/Ext2File.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/Ext2File.java 2012-08-10 06:57:21 UTC (rev 5917) +++ trunk/fs/src/fs/org/jnode/fs/ext2/Ext2File.java 2012-08-10 07:08:00 UTC (rev 5918) @@ -34,13 +34,15 @@ */ public class Ext2File extends AbstractFSFile { + Ext2Entry entry; INode iNode; private final Logger log = Logger.getLogger(getClass()); - public Ext2File(INode iNode) { - super(iNode.getExt2FileSystem()); - this.iNode = iNode; + public Ext2File(Ext2Entry entry) { + super(entry.getINode().getExt2FileSystem()); + this.iNode = entry.getINode(); + this.entry = entry; log.setLevel(Level.DEBUG); } @@ -170,6 +172,12 @@ // different INode instances) iNode.incLocked(); } + + if (log.isDebugEnabled()) { + log.info("File:" + entry.getName() + " size:" + getLength() + " read offset: " + fileOffset + " len: " + + dest.length); + } + //a single inode may be represented by more than one Ext2Directory // instances, //but each will use the same instance of the underlying inode (see Modified: trunk/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java 2012-08-10 06:57:21 UTC (rev 5917) +++ trunk/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java 2012-08-10 07:08:00 UTC (rev 5918) @@ -898,7 +898,7 @@ */ protected FSFile createFile(FSEntry entry) throws IOException { Ext2Entry e = (Ext2Entry) entry; - return new Ext2File(e.getINode()); + return new Ext2File(e); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |