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