<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1 +0,0 @@
-Don't write index when file opened read-only.</diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -577,6 +577,12 @@ void Compress::storeLayerMap()
 {
 	rDebug(&quot;%s: m_fd: %d&quot;, __PRETTY_FUNCTION__, m_fd);
 
+	// Don't store LayerMap if it has not been modified
+	// since begining (open).
+
+	if (!m_lm.isModified())
+		return;
+
 	io::nonclosable_file_descriptor file(m_fd);
 	file.seek(m_RawFileSize, ios_base::beg);
 </diff>
      <filename>src/Compress.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -15,6 +15,7 @@ std::ostream &amp;operator&lt;&lt;(std::ostream &amp;os, const LayerMap &amp;rLm)
 	os &lt;&lt; std::hex;
 	os &lt;&lt; &quot;-- m_MaxLevel: 0x&quot; &lt;&lt; rLm.m_MaxLevel &lt;&lt;
 	      &quot;, m_MaxLength: 0x&quot; &lt;&lt; rLm.m_MaxLength &lt;&lt;
+	      &quot;, m_IsModified: &quot; &lt;&lt; rLm.m_IsModified &lt;&lt;
 	      &quot; -------&quot; &lt;&lt; std::endl;
 
 	for (LayerMap::con_t::const_iterator it = rLm.m_Map.begin(); it != rLm.m_Map.end(); ++it)
@@ -42,6 +43,8 @@ void LayerMap::Put(Block *pBl, bool bKeepLevel)
 	if (m_MaxLength &lt; pBl-&gt;length)
 		m_MaxLength = pBl-&gt;length;
 
+	m_IsModified = true;
+
 //	cout &lt;&lt; &quot;State after Put: &quot; &lt;&lt; endl &lt;&lt; *this &lt;&lt; endl;
 }
 
@@ -67,6 +70,9 @@ void LayerMap::Truncate(off_t offset)
 		}
 		++it;
 	}
+
+	m_IsModified = true;
+
 //	std::cout &lt;&lt; &quot;State after Truncate: &quot; &lt;&lt; std::endl &lt;&lt; *this &lt;&lt; std::endl;
 }
 </diff>
      <filename>src/LayerMap.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -38,6 +38,7 @@ private:
 	con_t        m_Map;
 	unsigned int m_MaxLevel;
 	unsigned int m_MaxLength;
+	bool         m_IsModified;
 
 	void next(off_t offset, con_t::const_iterator &amp;it) const;
 	unsigned int length(con_t::const_iterator &amp;it, off_t offset) const;
@@ -55,7 +56,8 @@ private:
 public:
 	LayerMap() :
 		m_MaxLevel(1),
-		m_MaxLength(0)
+		m_MaxLength(0),
+		m_IsModified(false)
 	{}
 	~LayerMap()
 	{
@@ -65,6 +67,7 @@ public:
 	{
 		m_MaxLevel = src.m_MaxLevel;
 		m_MaxLength = src.m_MaxLength;
+		m_IsModified = src.m_IsModified;
 
 		for (con_t::iterator it = m_Map.begin(); it != m_Map.end(); ++it)
 			delete(*it);
@@ -106,6 +109,8 @@ public:
 		return true;
 	}
 
+	bool isModified() const { return m_IsModified; }
+
 	friend std::ostream &amp;operator&lt;&lt;(std::ostream &amp;os, const LayerMap &amp;rLm);
 };
 </diff>
      <filename>src/LayerMap.hpp</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>054573c8e56ef6cd2ac8e40b80e7ac4d6935081e</id>
    </parent>
  </parents>
  <author>
    <name>Milan Svoboda</name>
    <email>milan.svoboda@centrum.cz</email>
  </author>
  <url>http://github.com/tex/fusecompress/commit/37419d85b3ddec08dd1973e22a63454b8abb246c</url>
  <id>37419d85b3ddec08dd1973e22a63454b8abb246c</id>
  <committed-date>2008-11-28T01:51:21-08:00</committed-date>
  <authored-date>2008-11-27T08:22:40-08:00</authored-date>
  <message>Don't write LayerMap if file has not been modified since begining (open).</message>
  <tree>76b5366f60986aa6acca4bf2c9c3c6e81c5a2656</tree>
  <committer>
    <name>Milan Svoboda</name>
    <email>milan.svoboda@centrum.cz</email>
  </committer>
</commit>
