- goto out_done;
- }
- /* We do not need to read anything in for the moment */
-#ifndef TWO_PAGES
- _madvise(data, rrd_file->file_len, MADV_DONTNEED);
-// _madvise(data, rrd_file->file_len, MADV_RANDOM);
-#else
-/* alternatively: keep 2 pages worth of data, likely headers,
- * don't need the rest. */
- _madvise(data, _page_size * 2, MADV_WILLNEED | MADV_SEQUENTIAL);
- _madvise(data + _page_size * 2, (rrd_file->file_len >= _page_size * 2)
- ? rrd_file->file_len - _page_size * 2 : 0, MADV_DONTNEED);
-#endif
-#endif
-
-#if defined USE_MADVISE && !defined TWO_PAGES
- /* the stat_head will be needed soonish, so hint accordingly */
-// too finegrained to calc the individual sizes, just keep 2 pages worth of hdr
- _madvise(data + PAGE_ALIGN_DOWN(offset), PAGE_ALIGN(sizeof(stat_head_t)),
- MADV_WILLNEED);
+ } else {
+# ifndef ONE_PAGE
+ /* We do not need to read anything in for the moment */
+ _madvise(data, rrd_file->file_len, MADV_DONTNEED);
+ /* the stat_head will be needed soonish, so hint accordingly */
+ _madvise(data + PAGE_ALIGN_DOWN(offset),
+ PAGE_ALIGN(sizeof(stat_head_t)),
+ MADV_WILLNEED | MADV_RANDOM);