From bd8a0ba73a2d2f9b1a4dc19d9753a224107f419f Mon Sep 17 00:00:00 2001 From: oetiker Date: Tue, 13 Nov 2007 02:13:09 +0000 Subject: [PATCH] revert the dontneed patch ... this is for 1.3 exclusively git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@1215 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_fetch.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/program/src/rrd_fetch.c b/program/src/rrd_fetch.c index 1b85edb1..5745892d 100644 --- a/program/src/rrd_fetch.c +++ b/program/src/rrd_fetch.c @@ -205,7 +205,6 @@ rrd_fetch_fn( rrd_t rrd; rrd_value_t *data_ptr; unsigned long rows; - long rrd_head_size; #ifdef DEBUG fprintf(stderr,"Entered rrd_fetch_fn() searching for the best match\n"); @@ -215,8 +214,6 @@ fprintf(stderr,"Looking for: start %10lu end %10lu step %5lu\n", if(rrd_open(filename,&in_file,&rrd, RRD_READONLY)==-1) return(-1); - - rrd_head_size = ftell(in_file); /* when was the really last update of this file ? */ @@ -456,16 +453,6 @@ fprintf(stderr,"partial match, not best\n"); fclose(in_file); return(-1); } -#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, 0, POSIX_FADV_DONTNEED)) { - rrd_set_error("setting POSIX_FADV_DONTNEED on '%s': %s",filename, rrd_strerror(errno)); - fclose(in_file); - return(-1); - } -#endif - #ifdef DEBUG fprintf(stderr,"post fetch %li -- ",i); for(ii=0;ii<*ds_cnt;ii++) @@ -480,14 +467,6 @@ fprintf(stderr,"partial match, not best\n"); } rrd_free(&rrd); -#ifdef HAVE_POSIX_FADVISE - /* and just to be sure we drop everything except the header at the end */ - 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); - } -#endif fclose(in_file); return(0); } -- 2.30.2