diff options
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Vstat.pm')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Vstat.pm | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Vstat.pm b/usr.sbin/pkg_add/OpenBSD/Vstat.pm index d88e198748f..3364d7bf33f 100644 --- a/usr.sbin/pkg_add/OpenBSD/Vstat.pm +++ b/usr.sbin/pkg_add/OpenBSD/Vstat.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Vstat.pm,v 1.15 2007/02/24 18:45:11 espie Exp $ +# $OpenBSD: Vstat.pm,v 1.16 2007/03/06 23:35:01 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -44,6 +44,24 @@ sub create_device($) return $n; } +sub remember_used +{ + my $h = {}; + while (my ($k, $v) = each %$devinfo) { + $h->{$k} = $v->{used}; + $v->{used} = 0; + } + return $h; +} + +sub restore_used +{ + my $h = shift; + while (my ($k, $v) = each %$h) { + $devinfo->{$k}->{used} += $v; + } +} + sub init_devices() { delete $ENV{'BLOCKSIZE'}; |