return action;
}
-static surf_action_t storage_action_read(void *storage, void* ptr,
- size_t size, surf_file_t fd)
+static surf_action_t storage_action_read(void *storage, size_t size,
+ surf_file_t fd)
{
if(size > fd->size)
size = fd->size;
return action;
}
-static surf_action_t storage_action_write(void *storage, const void* ptr,
- size_t size, surf_file_t fd)
+static surf_action_t storage_action_write(void *storage, size_t size,
+ surf_file_t fd)
{
char *filename = fd->name;
XBT_DEBUG("\tWrite file '%s' size '%zu/%zu'",filename,size,fd->size);
if(action->type == WRITE)
{
double rate = lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable);
- ((storage_t)(action->storage))->used_size += delta * rate; // disk usage
- ((surf_action_t)action)->file->size += delta * rate; // file size
+ /* Hack to avoid rounding differences between x86 and x86_64
+ * (note that the next sizes are of type size_t). */
+ long incr = delta * rate + MAXMIN_PRECISION;
+ ((storage_t)(action->storage))->used_size += incr; // disk usage
+ ((surf_action_t)action)->file->size += incr; // file size
}
}