diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-01-12 10:35:42 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-01-12 10:35:42 +0000 |
commit | 965d21362b8e560065ef5475efb2a8a22fb5c8c2 (patch) | |
tree | eac81b87cb26a5f58417c94752c0b62dc9b86db5 /perl-install/patch | |
parent | 0887b2e926ab46554ac1af98c55e639c33b7987b (diff) | |
download | drakx-backup-do-not-use-965d21362b8e560065ef5475efb2a8a22fb5c8c2.tar drakx-backup-do-not-use-965d21362b8e560065ef5475efb2a8a22fb5c8c2.tar.gz drakx-backup-do-not-use-965d21362b8e560065ef5475efb2a8a22fb5c8c2.tar.bz2 drakx-backup-do-not-use-965d21362b8e560065ef5475efb2a8a22fb5c8c2.tar.xz drakx-backup-do-not-use-965d21362b8e560065ef5475efb2a8a22fb5c8c2.zip |
use BLKGETSIZE64 to allow detecting partitions bigger than 2TB, and use
"double" instead of "unsigned int" (nb: it means we will use doubles instead
of ints for computing things, this works quite nicely up to 100_000TB
doing this in perl so that there is no need to recompile stuff.so
Diffstat (limited to 'perl-install/patch')
-rw-r--r-- | perl-install/patch/patch-2006-above-2TB.pl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/perl-install/patch/patch-2006-above-2TB.pl b/perl-install/patch/patch-2006-above-2TB.pl new file mode 100644 index 000000000..894ebf1ce --- /dev/null +++ b/perl-install/patch/patch-2006-above-2TB.pl @@ -0,0 +1,24 @@ +log::l("PATCH: 2006-fix-parsing-dmraid"); + +use log; + +undef *c::total_sectors; +*c::total_sectors = sub { + my ($fd) = @_; + + use log; + log::l("PATCH: total_sectors"); + my ($BLKGETSIZE, $BLKGETSIZE64) = (0x1260, 0x80041272); + + open(my $F, "<& $fd") or return; + my $ll = ''; + if (ioctl($F, $BLKGETSIZE64, $ll)) { + my ($v, $v1) = unpack("L2", $ll); + $v1 * 1024 * 1024 * 8 + $v / 512; + } elsif (ioctl($F, $BLKGETSIZE, $ll)) { + log::l("defaulting to BLKGETSIZE"); + unpack("L", $ll); + } else { + 0; + } +}; |