line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooseFS::Operations; |
2
|
1
|
|
|
1
|
|
66836
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
1743
|
use IO::Socket::INET; |
|
1
|
|
|
|
|
57696
|
|
|
1
|
|
|
|
|
13
|
|
5
|
1
|
|
|
1
|
|
4992
|
use Moo; |
|
1
|
|
|
|
|
51977
|
|
|
1
|
|
|
|
|
8
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
extends 'MooseFS'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has list => ( |
10
|
|
|
|
|
|
|
is => 'rw', |
11
|
|
|
|
|
|
|
default => sub { [] } |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub BUILD { |
15
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
16
|
0
|
|
|
|
|
|
my $ver = $self->masterversion; |
17
|
0
|
|
|
|
|
|
my $s = $self->sock; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
print $s pack('(LL)>', 508, 0); |
20
|
0
|
|
|
|
|
|
my $header = $self->myrecv($s, 8); |
21
|
0
|
|
|
|
|
|
my ($cmd, $length) = unpack('(LL)>', $header); |
22
|
0
|
0
|
0
|
|
|
|
if ( $cmd == 509 and $ver > 1514 ) { |
23
|
0
|
|
|
|
|
|
my $data = $self->myrecv($s, $length); |
24
|
0
|
|
|
|
|
|
my ($startcnt, $pos); |
25
|
|
|
|
|
|
|
|
26
|
0
|
0
|
|
|
|
|
if ($ver < 1621 ) { |
|
|
0
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
$startcnt = 16; |
28
|
0
|
|
|
|
|
|
$pos = 0; |
29
|
|
|
|
|
|
|
} elsif ($ver == 1621) { |
30
|
0
|
|
|
|
|
|
$startcnt = 21; |
31
|
0
|
|
|
|
|
|
$pos = 0; |
32
|
|
|
|
|
|
|
} else { |
33
|
0
|
|
|
|
|
|
$startcnt = (unpack("S>", substr($data, 0, 2)))[0]; |
34
|
0
|
|
|
|
|
|
$pos = 2; |
35
|
|
|
|
|
|
|
}; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
while ( $pos < $length ) { |
38
|
0
|
|
|
|
|
|
my ($sessionid, $ip1, $ip2, $ip3, $ip4, $v1, $v2, $v3, $ileng) = unpack("(LCCCCSCCL)>", substr($data, $pos, 16)); |
39
|
0
|
|
|
|
|
|
$pos += 16; |
40
|
0
|
|
|
|
|
|
my $info = substr($data, $pos, $ileng); |
41
|
0
|
|
|
|
|
|
$pos += $ileng; |
42
|
0
|
|
|
|
|
|
my $pleng = (unpack("L>", substr($data, $pos, 4)))[0]; |
43
|
0
|
|
|
|
|
|
$pos += 4; |
44
|
0
|
|
|
|
|
|
my $path = substr($data, $pos, $pleng); |
45
|
0
|
|
|
|
|
|
$pos += $pleng; |
46
|
|
|
|
|
|
|
|
47
|
0
|
0
|
|
|
|
|
if ( $ver >= 1600 ) { |
48
|
0
|
|
|
|
|
|
$pos += 17; |
49
|
|
|
|
|
|
|
} else { |
50
|
0
|
|
|
|
|
|
$pos += 9; |
51
|
|
|
|
|
|
|
}; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
my (@stats_c, @stats_l); |
54
|
0
|
0
|
|
|
|
|
if ($startcnt < 16) { |
55
|
0
|
|
|
|
|
|
@stats_c = unpack("(L$startcnt)>", substr($data, $pos,4*$startcnt)); |
56
|
0
|
|
|
|
|
|
$pos += $startcnt * 4; |
57
|
0
|
|
|
|
|
|
@stats_l = unpack("(L$startcnt)>", substr($data, $pos,4*$startcnt)); |
58
|
0
|
|
|
|
|
|
$pos += $startcnt * 4; |
59
|
|
|
|
|
|
|
} else { |
60
|
0
|
|
|
|
|
|
@stats_c = unpack("(L16)>", substr($data, $pos, 64)); |
61
|
0
|
|
|
|
|
|
$pos += $startcnt * 4; |
62
|
0
|
|
|
|
|
|
@stats_l = unpack("(L16)>", substr($data, $pos, 64)); |
63
|
0
|
|
|
|
|
|
$pos += $startcnt * 4; |
64
|
|
|
|
|
|
|
}; |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
push @{$self->list}, { |
|
0
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sessionid => $sessionid, |
68
|
|
|
|
|
|
|
ip => "$ip1.$ip2.$ip3.$ip4", |
69
|
|
|
|
|
|
|
info => $info, |
70
|
|
|
|
|
|
|
ver => "$v1.$v2.$v3", |
71
|
|
|
|
|
|
|
stats_current => { |
72
|
|
|
|
|
|
|
statfs => $stats_c[0], |
73
|
|
|
|
|
|
|
getattr => $stats_c[1], |
74
|
|
|
|
|
|
|
setattr => $stats_c[2], |
75
|
|
|
|
|
|
|
lookup => $stats_c[3], |
76
|
|
|
|
|
|
|
mkdir => $stats_c[4], |
77
|
|
|
|
|
|
|
rmdir => $stats_c[5], |
78
|
|
|
|
|
|
|
symlink => $stats_c[6], |
79
|
|
|
|
|
|
|
readlink => $stats_c[7], |
80
|
|
|
|
|
|
|
mknod => $stats_c[8], |
81
|
|
|
|
|
|
|
unlink => $stats_c[9], |
82
|
|
|
|
|
|
|
rename => $stats_c[10], |
83
|
|
|
|
|
|
|
link => $stats_c[11], |
84
|
|
|
|
|
|
|
readdir => $stats_c[12], |
85
|
|
|
|
|
|
|
open => $stats_c[13], |
86
|
|
|
|
|
|
|
read => $stats_c[14], |
87
|
|
|
|
|
|
|
write => $stats_c[15], |
88
|
|
|
|
|
|
|
}, |
89
|
|
|
|
|
|
|
stats_lasthour => { |
90
|
|
|
|
|
|
|
statfs => $stats_l[0], |
91
|
|
|
|
|
|
|
getattr => $stats_l[1], |
92
|
|
|
|
|
|
|
setattr => $stats_l[2], |
93
|
|
|
|
|
|
|
lookup => $stats_l[3], |
94
|
|
|
|
|
|
|
mkdir => $stats_l[4], |
95
|
|
|
|
|
|
|
rmdir => $stats_l[5], |
96
|
|
|
|
|
|
|
symlink => $stats_l[6], |
97
|
|
|
|
|
|
|
readlink => $stats_l[7], |
98
|
|
|
|
|
|
|
mknod => $stats_l[8], |
99
|
|
|
|
|
|
|
unlink => $stats_l[9], |
100
|
|
|
|
|
|
|
rename => $stats_l[10], |
101
|
|
|
|
|
|
|
link => $stats_l[11], |
102
|
|
|
|
|
|
|
readdir => $stats_l[12], |
103
|
|
|
|
|
|
|
open => $stats_l[13], |
104
|
|
|
|
|
|
|
read => $stats_l[14], |
105
|
|
|
|
|
|
|
write => $stats_l[15], |
106
|
|
|
|
|
|
|
}, |
107
|
|
|
|
|
|
|
}; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
1; |