Sha256: 13a943d76076f400cc9d690482e4db531c161062f20500b67d87db4bee4fb35b

Contents?: true

Size: 738 Bytes

Versions: 14

Compression:

Stored size: 738 Bytes

Contents

require 'fs/xfs/superblock'

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

    begin
      # 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}" if $log
      return false
    ensure
      dobj.seek(0, IO::SEEK_SET)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
manageiq-smartstate-0.2.6 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.2.5 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.2.4 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.2.3 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.2.2 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.2.1 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.2.0 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.1.6 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.1.5 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.1.4 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.1.3 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.1.2 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.1.1 lib/fs/MiqFS/modules/XFSProbe.rb
manageiq-smartstate-0.1.0 lib/fs/MiqFS/modules/XFSProbe.rb