diff options
Diffstat (limited to 'perl-install/resize_fat')
-rw-r--r-- | perl-install/resize_fat/any.pm | 10 | ||||
-rw-r--r-- | perl-install/resize_fat/fat.pm | 18 | ||||
-rw-r--r-- | perl-install/resize_fat/info_sector.pm | 6 | ||||
-rw-r--r-- | perl-install/resize_fat/main.pm | 16 |
4 files changed, 25 insertions, 25 deletions
diff --git a/perl-install/resize_fat/any.pm b/perl-install/resize_fat/any.pm index 8c57eb6b0..e4747dc87 100644 --- a/perl-install/resize_fat/any.pm +++ b/perl-install/resize_fat/any.pm @@ -33,7 +33,7 @@ sub max_cluster_count($) { # calculates the minimum size of a partition, in physical sectors sub min_size($) { my ($fs) = @_; - my $count = $fs->{clusters}->{count}; + my $count = $fs->{clusters}{count}; # directories are both in `used' and `dirs', so are counted twice # It's done on purpose since we're moving all directories. So at the worse @@ -71,12 +71,12 @@ sub flag_clusters { for (; !resize_fat::fat::is_eof($cluster); $cluster = resize_fat::fat::next($fs, $cluster)) { $cluster == 0 and die "Bad FAT: unterminated chain for $entry->{name}\n"; - $fs->{fat_flag_map}->[$cluster] and die "Bad FAT: cluster $cluster is cross-linked for $entry->{name}\n"; - $fs->{fat_flag_map}->[$cluster] = $type; - $fs->{clusters}->{count}->{dirs}++ if $type == $DIRECTORY; + $fs->{fat_flag_map}[$cluster] and die "Bad FAT: cluster $cluster is cross-linked for $entry->{name}\n"; + $fs->{fat_flag_map}[$cluster] = $type; + $fs->{clusters}{count}{dirs}++ if $type == $DIRECTORY; } }; $fs->{fat_flag_map} = [ ($FREE) x ($fs->{nb_clusters} + 2) ]; - $fs->{clusters}->{count}->{dirs} = 0; + $fs->{clusters}{count}{dirs} = 0; resize_fat::directory::traverse_all($fs, $f); } diff --git a/perl-install/resize_fat/fat.pm b/perl-install/resize_fat/fat.pm index 371e90feb..87ce2af71 100644 --- a/perl-install/resize_fat/fat.pm +++ b/perl-install/resize_fat/fat.pm @@ -18,7 +18,7 @@ sub read($) { $fat; } (0 .. $fs->{nb_fats} - 1); - $fs->{fat} = $fs->{fats}->[0]; + $fs->{fat} = $fs->{fats}[0]; my ($free, $bad, $used) = (0, 0, 0); @@ -28,7 +28,7 @@ sub read($) { elsif ($cluster == $resize_fat::bad_cluster_value) { $bad++; } else { $used++; } } - @{$fs->{clusters}->{count}}{qw(free bad used)} = ($free, $bad, $used); + @{$fs->{clusters}{count}}{qw(free bad used)} = ($free, $bad, $used); } sub write($) { @@ -49,7 +49,7 @@ sub write($) { sub allocate_remap { my ($fs, $cut_point) = @_; my ($cluster, $new_cluster); - my $remap = sub { $fs->{fat_remap}->[$cluster] = $new_cluster; }; + my $remap = sub { $fs->{fat_remap}[$cluster] = $new_cluster; }; my $get_new = sub { $new_cluster = get_free($fs); 0 < $new_cluster && $new_cluster < $cut_point or die "no free clusters"; @@ -57,11 +57,11 @@ sub allocate_remap { #log::ld("resize_fat: [$cluster,", &next($fs, $cluster), "...]->$new_cluster..."); }; - $fs->{fat_remap}->[0] = 0; + $fs->{fat_remap}[0] = 0; $fs->{last_free_cluster} = 2; for ($cluster = 2; $cluster < $fs->{nb_clusters} + 2; $cluster++) { if ($cluster < $cut_point) { - if ($fs->{fat_flag_map}->[$cluster] == $resize_fat::any::DIRECTORY) { + if ($fs->{fat_flag_map}[$cluster] == $resize_fat::any::DIRECTORY) { &$get_new(); } else { $new_cluster = $cluster; @@ -80,10 +80,10 @@ sub update { my ($fs) = @_; for (my $cluster = 2; $cluster < $fs->{nb_clusters} + 2; $cluster++) { - if ($fs->{fat_flag_map}->[$cluster]) { + if ($fs->{fat_flag_map}[$cluster]) { my $old_next = &next($fs, $cluster); - my $new = $fs->{fat_remap}->[$cluster]; - my $new_next = $fs->{fat_remap}->[$old_next]; + my $new = $fs->{fat_remap}[$cluster]; + my $new_next = $fs->{fat_remap}[$old_next]; set_available($fs, $cluster); @@ -101,7 +101,7 @@ sub update { sub check($) { my ($fs) = @_; foreach (@{$fs->{fats}}) { - $_ eq $fs->{fats}->[0] or die "FAT tables do not match"; + $_ eq $fs->{fats}[0] or die "FAT tables do not match"; } } diff --git a/perl-install/resize_fat/info_sector.pm b/perl-install/resize_fat/info_sector.pm index 5b92501ea..2eacf58ca 100644 --- a/perl-install/resize_fat/info_sector.pm +++ b/perl-install/resize_fat/info_sector.pm @@ -22,13 +22,13 @@ sub read($) { my ($fs) = @_; my $info = resize_fat::io::read($fs, $fs->{info_offset}, psizeof($format)); @{$fs->{info_sector}}{@fields} = unpack $format, $info; - $fs->{info_sector}->{signature} == 0x61417272 or die "Invalid information sector signature\n"; + $fs->{info_sector}{signature} == 0x61417272 or die "Invalid information sector signature\n"; } sub write($) { my ($fs) = @_; - $fs->{info_sector}->{free_clusters} = $fs->{clusters}->{count}->{free}; - $fs->{info_sector}->{next_cluster} = 2; + $fs->{info_sector}{free_clusters} = $fs->{clusters}->{count}->{free}; + $fs->{info_sector}{next_cluster} = 2; my $info = pack $format, @{$fs->{info_sector}}{@fields}; diff --git a/perl-install/resize_fat/main.pm b/perl-install/resize_fat/main.pm index 6239e6075..55cc34d7b 100644 --- a/perl-install/resize_fat/main.pm +++ b/perl-install/resize_fat/main.pm @@ -64,8 +64,8 @@ sub copy_clusters { } }; for (; $cluster < $fs->{nb_clusters} + 2; $cluster++) { - $fs->{fat_flag_map}->[$cluster] == $resize_fat::any::FILE or next; - push @buffer, $fs->{fat_remap}->[$cluster], resize_fat::io::read_cluster($fs, $cluster); + $fs->{fat_flag_map}[$cluster] == $resize_fat::any::FILE or next; + push @buffer, $fs->{fat_remap}[$cluster], resize_fat::io::read_cluster($fs, $cluster); @buffer > 50 and &$flush(); } &$flush(); @@ -78,14 +78,14 @@ sub construct_dir_tree { if ($resize_fat::isFAT32) { # fat32's root must remain in the first 64k clusters # so don't set it as DIRECTORY, it will be specially handled - $fs->{fat_flag_map}->[$fs->{fat32_root_dir_cluster}] = $resize_fat::any::FREE; + $fs->{fat_flag_map}[$fs->{fat32_root_dir_cluster}] = $resize_fat::any::FREE; } for (my $cluster = 2; $cluster < $fs->{nb_clusters} + 2; $cluster++) { - $fs->{fat_flag_map}->[$cluster] == $resize_fat::any::DIRECTORY or next; + $fs->{fat_flag_map}[$cluster] == $resize_fat::any::DIRECTORY or next; resize_fat::io::write_cluster($fs, - $fs->{fat_remap}->[$cluster], + $fs->{fat_remap}[$cluster], resize_fat::directory::remap($fs, resize_fat::io::read_cluster($fs, $cluster))); } @@ -101,7 +101,7 @@ sub construct_dir_tree { my $cluster = $fs->{fat32_root_dir_cluster}; resize_fat::io::write_cluster($fs, - $fs->{fat_remap}->[$cluster], + $fs->{fat_remap}[$cluster], resize_fat::directory::remap($fs, resize_fat::io::read_cluster($fs, $cluster))); } else { resize_fat::io::write($fs, $fs->{root_dir_offset}, $fs->{root_dir_size}, @@ -147,8 +147,8 @@ sub resize { $fs->{nb_sectors} = $size; $fs->{nb_clusters} = $new_nb_clusters; - $fs->{clusters}->{count}->{free} = - $fs->{nb_clusters} - $fs->{clusters}->{count}->{used} - $fs->{clusters}->{count}->{bad} - 2; + $fs->{clusters}{count}->{free} = + $fs->{nb_clusters} - $fs->{clusters}{count}->{used} - $fs->{clusters}->{count}->{bad} - 2; $fs->{system_id} = 'was here!'; $fs->{small_nb_sectors} = 0; |