Sha256: 3997bed9c96b774b86fd11b4cd991627e830dc6496ada84c5f72023ae5efda00

Contents?: true

Size: 636 Bytes

Versions: 52

Compression:

Stored size: 636 Bytes

Contents

require 'fs/xfs/superblock'

module XFSProbe
  def self.probe(dobj)
    unless dobj.kind_of?(MiqDisk)
      $log&.debug("XFSProbe << FALSE because Disk Object class is not MiqDisk, but is '#{dobj.class}'")
      return false
    end

    # The first Allocation Group's Superblock is at block zero.
    dobj.seek(0, IO::SEEK_SET)
    XFS::Superblock.new(dobj)

    # If initializing the superblock does not throw any errors, then this is XFS
    $log&.debug("XFSProbe << TRUE")
    return true
  rescue => err
    $log&.debug("XFSProbe << FALSE because #{err.message}")
    return false
  ensure
    dobj.seek(0, IO::SEEK_SET)
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
manageiq-smartstate-0.5.4 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.3.5 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.5.3 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.5.2 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.5.1 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.5.0 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.3.4 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.4.0 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.2.18.2 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.3.3 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.3.2 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.3.1 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.3.0 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.2.24 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.2.18.1 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.2.23 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.2.22 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.2.21 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.2.20 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.2.19 lib/fs/MiqFS/modules/XFSProbe.rb