Whamcloud - gitweb
LU-9085 llstat: don't use a hash as a reference 20/25320/5
authorEmoly Liu <emoly.liu@intel.com>
Wed, 8 Feb 2017 08:07:30 +0000 (16:07 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 26 Mar 2017 06:50:29 +0000 (06:50 +0000)
This patch is to fix "Using a hash as a reference is deprecated"
in llstat file. In the newer perl version, we should use "$xxx"
instead of "%xxx" for a hash reference.

Signed-off-by: Emoly Liu <emoly.liu@intel.com>
Change-Id: I67a1d1e365076b412550de775b115ac373589c60
Reviewed-on: https://review.whamcloud.com/25320
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/llstat [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 918209b..940114f
@@ -55,7 +55,7 @@ sub readstat()
        chop;
        ($name, $cumulcount, $samples, $unit, $min, $max, $sum, $sumsquare) 
                = split(/\s+/, $_);
-       $prevcount = %cumulhash->{$name};
+       $prevcount = $cumulhash->{$name};
        if (defined($prevcount)) {
                $diff = $cumulcount - $prevcount;
                if ($name eq "snapshot_time") {
@@ -82,7 +82,7 @@ sub readstat()
                        }
                        if (defined($sum)) {
                                my $sum_orig = $sum;
-                               my $sum_diff = $sum - %sumhash->{$name};
+                               my $sum_diff = $sum - $sumhash->{$name};
                                if ($graphable) {
                                    printf "   %s %lu %.2f %lu %s",
                                    $name, $sum_diff, ($sum_diff/$tdiff), $sum, $unit;
@@ -118,8 +118,8 @@ sub readstat()
                        $anysumsquare = 1;
                }
        }
-       %cumulhash->{$name} = $cumulcount;
-       %sumhash->{$name} = $sum;
+       $cumulhash->{$name} = $cumulcount;
+       $sumhash->{$name} = $sum;
        } #end of while
 }