diff --git a/include/DMRaid.h b/include/DMRaid.h index 2bc61b2a..b262325e 100644 --- a/include/DMRaid.h +++ b/include/DMRaid.h @@ -66,6 +66,7 @@ public: bool delete_dev_map_entry( const Partition & partition, OperationDetail & operationdetail ) ; bool purge_dev_map_entries( const Glib::ustring & dev_path ) ; bool update_dev_map_entry( const Partition & partition, OperationDetail & operationdetail ) ; + bool is_member(const Glib::ustring& member_path); bool is_member_active(const Glib::ustring& member_path); const Glib::ustring& get_array(const Glib::ustring& member_path); diff --git a/src/DMRaid.cc b/src/DMRaid.cc index f8d71708..a21741ef 100644 --- a/src/DMRaid.cc +++ b/src/DMRaid.cc @@ -527,9 +527,8 @@ bool DMRaid::update_dev_map_entry( const Partition & partition, OperationDetail } -// Return whether the named device (e.g. "/dev/sdc") is a member of an active DMRaid array -// or not. -bool DMRaid::is_member_active(const Glib::ustring& member_path) +// Return whether the named device (e.g. "/dev/sdc") is a member of a DMRaid array or not. +bool DMRaid::is_member(const Glib::ustring& member_path) { const DMRaid_Member& memb = get_cache_entry_by_member(member_path); if (memb.member.m_name.length() > 0) @@ -538,6 +537,15 @@ bool DMRaid::is_member_active(const Glib::ustring& member_path) return false; } +// Return whether the named device (e.g. "/dev/sdc") is a member of an *active* DMRaid +// array or not. +// As the cache only records members of active DMRaid arrays: +// is_member_active(x) == is_member(x) +bool DMRaid::is_member_active(const Glib::ustring& member_path) +{ + return is_member(member_path); +} + // Return array device containing the specified member, or "" if the array is not running // or there is no such member. diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 0d0aa4b9..8b7ed39e 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -1193,19 +1193,22 @@ FSType GParted_Core::detect_filesystem( PedDevice * lp_device, PedPartition * lp { Glib::ustring fsname = ""; Glib::ustring path; + DMRaid dmraid; if ( lp_partition ) - // Will query partition using methods: (Q1) SWRaid, (Q2) blkid, + // Will query partition using methods: (Q1) RAID, (Q2) blkid, // (Q3) libparted, (Q4) internal path = get_partition_path( lp_partition ); else - // Will query whole disk device using methods: (Q1) SWRaid, (Q2) blkid, + // Will query whole disk device using methods: (Q1) RAID, (Q2) blkid, // (Q4) internal path = lp_device->path; - // (Q1) SWRaid_Info (mdadm) member detection. + // (Q1) SWRaid_Info (mdadm) and DMRaid member detection. if ( SWRaid_Info::is_member( path ) ) return SWRaid_Info::get_fstype(path); + if (dmraid.is_member(path)) + return FS_ATARAID; // (Q2) FS_Info (blkid) file system detection // Blkid detects more signatures and generally has less limitations so use before