author | Boris Chiu <Boris.Chiu@Oracle.COM> |
Wed, 17 Oct 2012 17:17:49 -0700 | |
changeset 1019 | 9d261d526266 |
parent 964 | 3193e50c7331 |
child 1126 | a7e552aeef46 |
permissions | -rw-r--r-- |
964
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
1 |
/* |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
2 |
* This patch fixes the performance issue observed while retrieving the |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
3 |
* hrStorage parameters in systems with large number of mountpoints |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
4 |
* parameters using snmpwalk. |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
5 |
* |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
6 |
* This issue is happening due to the overhead of large number of |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
7 |
* ioctl() system calls in getmntent() function called by the |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
8 |
* Get_Next_HR_Filesys() function. |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
9 |
* We see that in the Get_Next_HR_Filesys() function, inorder to access |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
10 |
* the last mountpoint, the /etc/mnttab is opened and we walk through |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
11 |
* all the mnttab entries for all filesystems till the end. This is the |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
12 |
* reason we find a large number of the MNTIOC_GETMNTENT ioctl() calls. |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
13 |
* |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
14 |
* To reduce the overhead of the getmntent() calls, we maintain a cache |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
15 |
* of all the /etc/mnttab entries and walk through the cache instead of |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
16 |
* opening /etc/mnttab and walking all the entries for each mountpoint. |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
17 |
*/ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
18 |
|
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
19 |
--- net-snmp-5.4.1.orig/agent/mibgroup/host/hr_filesys.c 2007-05-18 11:08:01.000000000 -0700 |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
20 |
+++ net-snmp-5.4.1/agent/mibgroup/host/hr_filesys.c 2012-08-17 01:23:04.781860694 -0700 |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
21 |
@@ -31,6 +31,10 @@ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
22 |
#include <sys/mount.h> |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
23 |
#endif |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
24 |
|
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
25 |
+#ifdef solaris2 |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
26 |
+#include <sys/stat.h> |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
27 |
+#endif |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
28 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
29 |
#include <ctype.h> |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
30 |
#if HAVE_STRING_H |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
31 |
#include <string.h> |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
32 |
@@ -85,7 +89,11 @@ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
33 |
#ifdef solaris2 |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
34 |
|
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
35 |
struct mnttab HRFS_entry_struct; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
36 |
-struct mnttab *HRFS_entry = &HRFS_entry_struct; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
37 |
+struct mnttab *HRFS_entry; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
38 |
+struct mnttab *HRFS_list; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
39 |
+static int fscount; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
40 |
+static time_t last_access=-1; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
41 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
42 |
#define HRFS_name mnt_special |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
43 |
#define HRFS_mount mnt_mountp |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
44 |
#define HRFS_type mnt_fstype |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
45 |
@@ -563,6 +571,12 @@ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
46 |
void |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
47 |
Init_HR_FileSys(void) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
48 |
{ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
49 |
+#ifdef solaris2 |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
50 |
+ char buf[512]={NULL}; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
51 |
+ int lines=0, i=0; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
52 |
+ struct stat file_stat; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
53 |
+#endif |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
54 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
55 |
#if HAVE_GETFSSTAT |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
56 |
#if defined(HAVE_STATVFS) && defined(__NetBSD__) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
57 |
fscount = getvfsstat(NULL, 0, ST_NOWAIT); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
58 |
@@ -603,10 +617,62 @@ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
59 |
} |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
60 |
} |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
61 |
#else |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
62 |
- HRFS_index = 1; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
63 |
- if (fp != NULL) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
64 |
- fclose(fp); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
65 |
- fp = fopen(ETC_MNTTAB, "r"); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
66 |
+ HRFS_index = 1; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
67 |
+ if (fp != NULL) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
68 |
+ fclose(fp); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
69 |
+#ifdef solaris2 |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
70 |
+ HRFS_index = 0; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
71 |
+ stat(ETC_MNTTAB, &file_stat); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
72 |
+ if (last_access == -1 || last_access != file_stat.st_mtime) { |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
73 |
+ fp = fopen(ETC_MNTTAB, "r"); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
74 |
+ if(fp == NULL) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
75 |
+ { |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
76 |
+ DEBUGMSGTL(("host/hr_filesys", "fopen failed for mnttab.\n")); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
77 |
+ return; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
78 |
+ } |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
79 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
80 |
+ while ( (fgets((char *)&buf,sizeof(buf),fp)) != NULL) { |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
81 |
+ lines++; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
82 |
+ } |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
83 |
+ fclose(fp); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
84 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
85 |
+ HRFS_list = (struct mnttab *) malloc (sizeof(struct mnttab) * lines); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
86 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
87 |
+ if(HRFS_list == NULL) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
88 |
+ { |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
89 |
+ DEBUGMSGTL(("host/hr_filesys", "Memory allocation for mnttab cache failed.\n")); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
90 |
+ return; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
91 |
+ } |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
92 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
93 |
+ fp = fopen(ETC_MNTTAB, "r"); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
94 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
95 |
+ if(fp == NULL) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
96 |
+ { |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
97 |
+ DEBUGMSGTL(("host/hr_filesys", "fopen failed for mnttab.\n")); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
98 |
+ free(HRFS_list); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
99 |
+ return; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
100 |
+ } |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
101 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
102 |
+ fscount = lines; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
103 |
+ while (i < fscount) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
104 |
+ { |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
105 |
+ if (getmntent(fp, &HRFS_entry_struct) == 0) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
106 |
+ { |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
107 |
+ HRFS_list[i].mnt_special = strdup(HRFS_entry_struct.mnt_special); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
108 |
+ HRFS_list[i].mnt_mountp = strdup(HRFS_entry_struct.mnt_mountp); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
109 |
+ HRFS_list[i].mnt_fstype = strdup(HRFS_entry_struct.mnt_fstype); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
110 |
+ HRFS_list[i].mnt_mntopts = strdup(HRFS_entry_struct.mnt_mntopts); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
111 |
+ i++; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
112 |
+ } |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
113 |
+ } |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
114 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
115 |
+ HRFS_entry = HRFS_list; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
116 |
+ last_access = file_stat.st_mtime; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
117 |
+ } |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
118 |
+#else |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
119 |
+ fp = fopen(ETC_MNTTAB, "r"); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
120 |
+#endif |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
121 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
122 |
#endif |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
123 |
} |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
124 |
|
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
125 |
@@ -699,21 +765,24 @@ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
126 |
#else |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
127 |
const char **cpp; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
128 |
|
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
129 |
- if (fp == NULL) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
130 |
- return -1; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
131 |
|
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
132 |
#ifdef solaris2 |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
133 |
- if (getmntent(fp, HRFS_entry) != 0) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
134 |
- return -1; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
135 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
136 |
+ if (HRFS_index >= fscount) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
137 |
+ return -1; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
138 |
+ HRFS_entry = &HRFS_list[HRFS_index]; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
139 |
+ return ++HRFS_index; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
140 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
141 |
#else |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
142 |
- HRFS_entry = getmntent(fp); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
143 |
- if (HRFS_entry == NULL) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
144 |
- return -1; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
145 |
-#endif /* solaris2 */ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
146 |
+ if (fp == NULL) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
147 |
+ return -1; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
148 |
+ HRFS_entry = getmntent(fp); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
149 |
+ if (HRFS_entry == NULL) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
150 |
+ return -1; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
151 |
|
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
152 |
- for (cpp = HRFS_ignores; *cpp != NULL; ++cpp) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
153 |
- if (!strcmp(HRFS_entry->HRFS_type, *cpp)) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
154 |
- return Get_Next_HR_FileSys(); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
155 |
+ for (cpp = HRFS_ignores; *cpp != NULL; ++cpp) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
156 |
+ if (!strcmp(HRFS_entry->HRFS_type, *cpp)) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
157 |
+ return Get_Next_HR_FileSys(); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
158 |
|
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
159 |
/* |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
160 |
* Try and ensure that index values are persistent |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
161 |
@@ -728,6 +797,8 @@ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
162 |
} |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
163 |
|
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
164 |
return HRFS_index++; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
165 |
+#endif |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
166 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
167 |
#endif /* HAVE_GETFSSTAT */ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
168 |
} |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
169 |
|
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
170 |
@@ -780,20 +851,34 @@ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
171 |
End_HR_FileSys(void) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
172 |
{ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
173 |
#ifdef HAVE_GETFSSTAT |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
174 |
- if (fsstats) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
175 |
- free((char *) fsstats); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
176 |
- fsstats = NULL; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
177 |
+ if (fsstats) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
178 |
+ free((char *) fsstats); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
179 |
+ fsstats = NULL; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
180 |
#elif defined(aix4) || defined(aix5) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
181 |
- if(aixmnt != NULL) { |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
182 |
- free(aixmnt); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
183 |
- aixmnt = NULL; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
184 |
- aixcurr = NULL; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
185 |
- HRFS_entry = NULL; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
186 |
- } |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
187 |
-#else |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
188 |
- if (fp != NULL) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
189 |
- fclose(fp); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
190 |
- fp = NULL; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
191 |
+ if(aixmnt != NULL) { |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
192 |
+ free(aixmnt); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
193 |
+ aixmnt = NULL; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
194 |
+ aixcurr = NULL; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
195 |
+ HRFS_entry = NULL; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
196 |
+ } |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
197 |
+#else |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
198 |
+ int i=0; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
199 |
+ if (fp != NULL) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
200 |
+ fclose(fp); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
201 |
+ fp = NULL; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
202 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
203 |
+#ifdef solaris2 |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
204 |
+ while (i < fscount) { |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
205 |
+ free(HRFS_list[i].mnt_special); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
206 |
+ free(HRFS_list[i].mnt_mountp); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
207 |
+ free(HRFS_list[i].mnt_fstype); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
208 |
+ free(HRFS_list[i].mnt_mntopts); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
209 |
+ i++; |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
210 |
+ } |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
211 |
+ if (HRFS_list != NULL) |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
212 |
+ free(HRFS_list); |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
213 |
+#endif |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
214 |
+ |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
215 |
#endif |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
216 |
} |
3193e50c7331
7118090 snmpwalk of hrStorageIndex can take several minutes due to excessive ioctl calls for mnttab by snmpd
Lijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
parents:
diff
changeset
|
217 |