diff --git a/include/SWRaid_Info.h b/include/SWRaid_Info.h index 85404010..b1a14a58 100644 --- a/include/SWRaid_Info.h +++ b/include/SWRaid_Info.h @@ -58,6 +58,7 @@ public: static void load_cache(); static bool is_member( const Glib::ustring & member_path ); static bool is_member_active( const Glib::ustring & member_path ); + static FSType get_fstype(const Glib::ustring& member_path); static Glib::ustring get_array( const Glib::ustring & member_path ); static Glib::ustring get_uuid( const Glib::ustring & member_path ); static Glib::ustring get_label( const Glib::ustring & member_path ); diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 449cc328..f5530080 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -1202,9 +1202,9 @@ FSType GParted_Core::detect_filesystem( PedDevice * lp_device, PedPartition * lp // (Q4) internal path = lp_device->path; - // (Q1) Linux Software RAID member detection + // (Q1) SWRaid_Info (mdadm) member detection. if ( SWRaid_Info::is_member( path ) ) - return FS_LINUX_SWRAID; + return SWRaid_Info::get_fstype(path); // (Q2) FS_Info (blkid) file system detection // Blkid detects more signatures and generally has less limitations so use before diff --git a/src/SWRaid_Info.cc b/src/SWRaid_Info.cc index f57cea9e..a719762d 100644 --- a/src/SWRaid_Info.cc +++ b/src/SWRaid_Info.cc @@ -74,6 +74,16 @@ bool SWRaid_Info::is_member_active( const Glib::ustring & member_path ) return memb.active; } + +// Return "file system" type of the member, or FS_UNKNOWN if there is no such member. +FSType SWRaid_Info::get_fstype(const Glib::ustring& member_path) +{ + initialise_if_required(); + const SWRaid_Member& memb = get_cache_entry_by_member(member_path); + return memb.fstype; +} + + // Return array /dev entry (e.g. "/dev/md1") containing the specified member, or "" if the // array is not running or there is no such member. Glib::ustring SWRaid_Info::get_array( const Glib::ustring & member_path )