Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
you can overwrite part of a file without mofiying its size
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 25 Sep 2015 14:24:01 +0000 (16:24 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 25 Sep 2015 17:21:35 +0000 (19:21 +0200)
src/surf/storage_n11.cpp

index 42fef37..6baacc2 100644 (file)
@@ -332,8 +332,10 @@ void StorageN11Model::updateActionsState(double /*now*/, double delta)
 
       action->p_storage->m_usedSize += incr; // disk usage
       action->p_file->current_position+= incr; // current_position
-      //  which becomes the new file size
-      action->p_file->size = action->p_file->current_position ;
+      //  which becomes the new file size only if it's greater than the current
+      // file size
+      if (action->p_file->current_position > action->p_file->size)
+        action->p_file->size = action->p_file->current_position ;
 
       sg_size_t *psize = xbt_new(sg_size_t,1);
       *psize = action->p_file->size;