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/lvm.pm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'perl-install/lvm.pm') diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm index 2d2a6d0e7..e63daa1ff 100644 --- a/perl-install/lvm.pm +++ b/perl-install/lvm.pm @@ -10,6 +10,7 @@ use common; use modules; use fsedit; use devices; +use fs::type; use run_program; #- for partition_table_xxx emulation @@ -92,10 +93,10 @@ sub get_lvs { [ map { my $device = "$lvm->{VG_name}/$_"; - my $pt_type = -e "/dev/$device" && fsedit::typeOfPart($device); + my $fs_type = -e "/dev/$device" && fs::type::fs_type_from_magic({ device => $device }); { device => $device, - pt_type => $pt_type || 0x83, + fs_type => $fs_type || 'ext2', size => get_lv_size($device) } } @l ]; @@ -117,8 +118,7 @@ sub vg_destroy { lvm_cmd_or_die('vgremove', $lvm->{VG_name}); foreach (@{$lvm->{disks}}) { delete $_->{lvm}; - $_->{isFormatted} = 0; - $_->{notFormatted} = 1; + set_isFormatted($_, 0); } } @@ -138,8 +138,7 @@ sub lv_create { $lv->{device} = "$lvm->{VG_name}/$lv->{lv_name}"; lvm_cmd_or_die('lvcreate', '--size', int($lv->{size} / 2) . 'k', '-n', $lv->{lv_name}, $lvm->{VG_name}); $lv->{size} = get_lv_size($lv->{device}); #- the created size is smaller than asked size - $lv->{notFormatted} = 1; - $lv->{isFormatted} = 0; + set_isFormatted($lv, 0); push @$list, $lv; } -- cgit v1.2.1