From 0306ad0100b9d40606d723706f909438a27dfac1 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 27 Jul 2004 10:31:34 +0000 Subject: - add field {fs_type} partially replacing {pt_type} {pt_type} is always a number, {fs_type} is always a string - introduce set_isFormatted() (to ensure {notFormatted} but also {fs_type_from_magic} and {bad_fs_type_magic} are updated) - don't use 0x483 for ext3 anymore (same for reiserfs...), the type_name gives both a pt_type and a fs_type - many accessors from partition_table removed (type2fs(), fs2pt_type()) - remove isThisFs() (not useful anymore since we can use directly {fs_type}) - remove isFat() (inline the function) - other isXXX() from partition_table are moved to fs::type - part2name() is now fs::type::part2type_name - name2pt_type() is now fs::type::type_name2subpart() - partition_table::important_types() is now fs::type::type_names() - fsedit::typeOfPart() is now fs::type::fs_type_from_magic() - no need to truncate type_name since they are shorter --- perl-install/raid.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'perl-install/raid.pm') diff --git a/perl-install/raid.pm b/perl-install/raid.pm index 8b03e3375..d91f3984b 100644 --- a/perl-install/raid.pm +++ b/perl-install/raid.pm @@ -7,7 +7,7 @@ use strict; #- misc imports #-###################################################################################### use common; -use partition_table qw(:types); +use fs::type; use run_program; use devices; use modules; @@ -23,7 +23,7 @@ sub nb { sub new { my ($raids, @parts) = @_; my $nb = @$raids; - $raids->[$nb] = { 'chunk-size' => "64k", pt_type => 0x483, disks => [ @parts ], device => "md$nb", notFormatted => 1, level => 1 }; + $raids->[$nb] = { 'chunk-size' => "64k", fs_type => 'ext3', disks => [ @parts ], device => "md$nb", notFormatted => 1, level => 1 }; foreach my $part (@parts) { $part->{raid} = $nb; delete $part->{mntpoint}; @@ -36,7 +36,7 @@ sub add { my ($raids, $part, $nb) = @_; $nb = nb($nb); $raids->[$nb]{isMounted} and die N("Can't add a partition to _formatted_ RAID md%d", $nb); inactivate_and_dirty($raids->[$nb]); - $part->{notFormatted} = 1; $part->{isFormatted} = 0; + set_isFormatted($part, 0); $part->{raid} = $nb; delete $part->{mntpoint}; push @{$raids->[$nb]{disks}}, $part; @@ -145,7 +145,7 @@ sub format_part { make($raids, $part); fs::format::part_raw($part); - $_->{isFormatted} = 1 foreach @{$part->{disks}}; + set_isFormatted($_, 1) foreach @{$part->{disks}}; } sub verify { @@ -171,7 +171,7 @@ sub prepare_prefixed { sub inactivate_and_dirty { my ($part) = @_; run_program::run("raidstop", devices::make($part->{device})); - $part->{notFormatted} = 1; $part->{isFormatted} = 0; + set_isFormatted($part, 0); } sub active_mds() { -- cgit v1.2.1