Hi all,

A good guy I work with just noticed that inode free checks from net-snmp return 100% for extent based filesystems like Resiser and so on.
I wanted to know why so I went digging and I think the answer is here in disk.c :



#if defined(STRUCT_STATVFS_HAS_F_FILES) || defined STRUCT_STATFS_HAS_F_FAVAIL
percent_inode = vfs.f_favail <= 0 ? 100 :
(int) ((double) (vfs.f_files - vfs.f_ffree) /
(double) (vfs.f_files -
(vfs.f_ffree - vfs.f_favail)) * 100.0 + 0.5);
#else
#if defined(STRUCT_STATFS_HAS_F_FILES) && defined(STRUCT_STATFS_HAS_F_FFREE)
percent_inode = vfs.f_files == 0 ? 100.0 :
(int) ((double) (vfs.f_files - vfs.f_ffree) /
(double) (vfs.f_files) * 100.0 + 0.5);
#endif


My questions are:
Does this mean that f the files free or files available returns 0 then set percent to 100 ?
If so, why?


Cheers all,
-n.


------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to