ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/disk_stats.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/disk_stats.c (file contents):
Revision 1.76 by ats, Sat Nov 6 15:33:40 2004 UTC vs.
Revision 1.79 by ats, Sun Nov 7 15:06:49 2004 UTC

# Line 106 | Line 106 | static int is_valid_fs_type(const char *type) {
106          const char *types[] = VALID_FS_TYPES;
107          int i;
108  
109 <        for (i = 0; i < (sizeof types / sizeof *types); i++) {
109 >        for (i = 0; i < (int) (sizeof types / sizeof *types); i++) {
110                  if (strcmp(types[i], type) == 0) {
111                          return 1;
112                  }
# Line 392 | Line 392 | sg_disk_io_stats *sg_get_disk_io_stats(int *entries){
392                          }
393          
394                          /* We can't seperate the reads from the writes, we'll
395 <                           just give the same to each. */
396 <                        rbytes = wbytes = di->psd_dkwds / 2;
395 >                         * just give the same to each. (This value is in
396 >                         * 64-byte chunks according to the pstat header file,
397 >                         * and can wrap to be negative.)
398 >                         */
399 >                        rbytes = wbytes = ((unsigned long) di->psd_dkwds) * 64LL;
400          
401                          /* Skip unused disks. */
402                          if (rbytes == 0 && wbytes == 0) {
# Line 413 | Line 416 | sg_disk_io_stats *sg_get_disk_io_stats(int *entries){
416          
417                          num_diskio++;
418          
419 +                        /* FIXME This should use a static cache, like the Linux
420 +                         * code below. */
421                          if (diskio_stats_ptr->disk_name == NULL) {
422                                  dh = opendir("/dev/dsk");
423                                  if (dh == NULL) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines