Revision: 5911 http://jnode.svn.sourceforge.net/jnode/?rev=5911&view=rev Author: galatnm Date: 2012-08-10 06:37:15 +0000 (Fri, 10 Aug 2012) Log Message: ----------- Detect inodes that use ext4 extents
Modified Paths: -------------- trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Constants.java trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Directory.java Modified: trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Constants.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Constants.java 2012-08-10 06:36:07 UTC (rev 5910) +++ trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Constants.java 2012-08-10 06:37:15 UTC (rev 5911) @@ -78,6 +78,7 @@ // behaviour control flags in the inode public static final long EXT2_INDEX_FL = 0x00010000; // hash indexed directory + public static final long EXT4_INODE_EXTENTS_FLAG = 0x00080000; // Filesystem state constants public static final int EXT2_VALID_FS = 0x0001; // cleanly unmounted 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:36:07 UTC (rev 5910) +++ trunk/fs/src/fs/org/jnode/fs/ext2/Ext2Directory.java 2012-08-10 06:37:15 UTC (rev 5911) @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.NoSuchElementException; - import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.jnode.fs.FSEntry; @@ -56,10 +55,16 @@ this.entry = entry; log.setLevel(Level.DEBUG); boolean readOnly; - if ((iNode.getFlags() & Ext2Constants.EXT2_INDEX_FL) == 1) + if ((iNode.getFlags() & Ext2Constants.EXT2_INDEX_FL) != 0 || + (iNode.getFlags() & Ext2Constants.EXT4_INODE_EXTENTS_FLAG) != 0) { readOnly = true; //force readonly - else + + if ((iNode.getFlags() & Ext2Constants.EXT4_INODE_EXTENTS_FLAG) != 0) + log.info("inode uses extents: " + entry); + } + else { readOnly = fs.isReadOnly(); + } setRights(true, !readOnly); log.debug("directory size: " + iNode.getSize()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Jnode-svn-commits mailing list Jnode-svn-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jnode-svn-commits