• Daniel Black's avatar
    MDEV-28592 disks plugin - getmntinfo (BSD) & getmntent (AIX) · 129616c7
    Daniel Black authored
    Thanks to references from Brad Smith, BSDs use getmntinfo as
    a system call for mounted filesystems.
    
    Most BSDs return statfs structures, (and we use OSX's statfs64),
    but NetBSD uses a statvfs structure.
    
    Simplify Linux getmntent_r to just use getmntent.
    
    AIX uses getmntent.
    
    An attempt at writing Solaris compatibility with
    a small bit of HPUX compatibility was made based on man page
    entries only. Fixes welcome.
    
    statvfs structures now use f_bsize for consistency with statfs
    
    Test case adjusted as PATH_MAX is OS defined (e.g. 1023 on AIX)
    
    Fixes: 0ee5cf83
    
    also fixes:
    
    MDEV-27818: Disk plugin does not show zpool mounted devices
    
    This is because zpool mounted point don't begin with /.
    
    Due to the proliferation of multiple filesystem types since this
    was written, we restrict the entries listed in the disks plugin
    to excude:
    * read only mount points (no point monitoring, and
      includes squash, snaps, sysfs, procfs, cgroups...)
    * mount points that aren't directories (excludes /etc/hostname and
      similar mounts in containers). (getmntent (Linux/AIX) only)
    * exclude systems where there is no capacity listed (excludes various
      virtual filesystem types).
    
    Reviewer: Sergei Golubchik
    129616c7
config.h.cmake 16.9 KB