Blame SOURCES/net-snmp-5.7-dsktable-cache.patch

9a6c41
877326 - dskEntry should be cached
9a6c41
9a6c41
commit ca7b17a41d4d16bd27aacf92116bea3562eeea36
9a6c41
Author: Jan Safranek <jsafranek@users.sourceforge.net>
9a6c41
Date:   Mon Dec 17 12:40:32 2012 +0100
9a6c41
9a6c41
    CHANGES: snmpd: use cache for dskTable to speed it up.
9a6c41
    
9a6c41
    UCD-SNMP::dskTable was slow on NFS mounts. Now it uses fsys cache
9a6c41
    to reload mounts every 5 seconds.
9a6c41
9a6c41
diff --git a/agent/mibgroup/ucd-snmp/disk_hw.c b/agent/mibgroup/ucd-snmp/disk_hw.c
9a6c41
index 93ecde3..ea37610 100644
9a6c41
--- a/agent/mibgroup/ucd-snmp/disk_hw.c
9a6c41
+++ b/agent/mibgroup/ucd-snmp/disk_hw.c
9a6c41
@@ -305,8 +305,11 @@ var_extensible_disk(struct variable *vp,
9a6c41
     unsigned long long val;
9a6c41
     static long     long_ret;
9a6c41
     static char     errmsg[300];
9a6c41
+    netsnmp_cache  *cache;
9a6c41
 
9a6c41
-    netsnmp_fsys_load( NULL, NULL );  /* Update the fsys H/W module */
9a6c41
+    /* Update the fsys H/W module */
9a6c41
+    cache = netsnmp_fsys_get_cache();
9a6c41
+    netsnmp_cache_check_and_reload(cache);
9a6c41
 
9a6c41
 tryAgain:
9a6c41
     if (header_simple_table