a single rrd file is not too large, but I assume this should not be the case
in general. Otherwhise we would have to sync and release while writing all
the unknown data. */
+ fflush(rrd_file);
fdatasync(fileno(rrd_file));
if (0 != posix_fadvise(fileno(rrd_file), rrd_head_size, 0, POSIX_FADV_DONTNEED)) {
rrd_set_error("setting POSIX_FADV_DONTNEED on '%s': %s",file_name, rrd_strerror(errno));
#ifdef HAVE_POSIX_FADVISE
/* don't pollute the buffer cache with data read from the file. We do this while reading to
keep damage minimal */
- if (0 != posix_fadvise(fileno(in_file), rrd_head_size, ftell(in_file), POSIX_FADV_DONTNEED)) {
+ if (0 != posix_fadvise(fileno(in_file), rrd_head_size, 0, POSIX_FADV_DONTNEED)) {
rrd_set_error("setting POSIX_FADV_DONTNEED on '%s': %s",filename, rrd_strerror(errno));
fclose(in_file);
return(-1);
i < rrd.stat_head->rra_cnt;
rra_start += rrd.rra_def[i].row_cnt * rrd.stat_head -> ds_cnt * sizeof(rrd_value_t),
i++) {
- /* is there anything to write for this RRA? If not, continue. */
+ /* is th5Aere anything to write for this RRA? If not, continue. */
if (rra_step_cnt[i] == 0) continue;
/* write the first row */
fclose(rrd_file);
return(-1);
}
-#ifdef HAVE_POSIX_FADVISE
+
+#ifdef HAVE_POSIX_FADVISExxx
/* with update we have write ops, so they will probably not be done by now, this means
the buffers will not get freed. But calling this for the whole file - header
rra_start += rrd.rra_def[i].row_cnt
*rrd.stat_head->ds_cnt*sizeof(rrd_value_t);
}
-#ifdef HAVE_POSIX_FADVISE
+#ifdef HAVE_POSIX_FADVISExxx
/* same procedure as above ... */
if (0 != posix_fadvise(fileno(rrd_file), rra_begin, 0, POSIX_FADV_DONTNEED)) {
rrd_set_error("setting POSIX_FADV_DONTNEED on '%s': %s",filename, rrd_strerror(errno));