line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooseFS::Mounts; |
2
|
1
|
|
|
1
|
|
110823
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
41
|
|
3
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
33
|
|
4
|
1
|
|
|
1
|
|
2141
|
use IO::Socket::INET; |
|
1
|
|
|
|
|
44333
|
|
|
1
|
|
|
|
|
8
|
|
5
|
1
|
|
|
1
|
|
2036
|
use Moo; |
|
1
|
|
|
|
|
28153
|
|
|
1
|
|
|
|
|
6
|
|
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
|
0
|
|
|
|
|
if ($ver > 1626) { |
20
|
0
|
|
|
|
|
|
print $s pack('(LLC)>', 508, 1, 1); |
21
|
|
|
|
|
|
|
} else { |
22
|
0
|
|
|
|
|
|
print $s pack('(LL)>', 508, 0); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
my $header = $self->myrecv($s, 8); |
26
|
0
|
|
|
|
|
|
my ($cmd, $length) = unpack('(LL)>', $header); |
27
|
0
|
0
|
0
|
|
|
|
if ( $cmd == 509 and $ver > 1514 ) { |
28
|
0
|
|
|
|
|
|
my $data = $self->myrecv($s, $length); |
29
|
0
|
|
|
|
|
|
my ($startcnt, $pos); |
30
|
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
if ($ver < 1621 ) { |
|
|
0
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
$startcnt = 16; |
33
|
0
|
|
|
|
|
|
$pos = 0; |
34
|
|
|
|
|
|
|
} elsif ($ver == 1621) { |
35
|
0
|
|
|
|
|
|
$startcnt = 21; |
36
|
0
|
|
|
|
|
|
$pos = 0; |
37
|
|
|
|
|
|
|
} else { |
38
|
0
|
|
|
|
|
|
$startcnt = (unpack("S>", substr($data, 0, 2)))[0]; |
39
|
0
|
|
|
|
|
|
$pos = 2; |
40
|
|
|
|
|
|
|
}; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
while ( $pos < $length ) { |
43
|
0
|
|
|
|
|
|
my ($sessionid, $ip1, $ip2, $ip3, $ip4, $v1, $v2, $v3, $ileng) = unpack("(LCCCCSCCL)>", substr($data, $pos, 16)); |
44
|
0
|
|
|
|
|
|
$pos += 16; |
45
|
0
|
|
|
|
|
|
my $info = substr($data, $pos, $ileng); |
46
|
0
|
|
|
|
|
|
$pos += $ileng; |
47
|
0
|
|
|
|
|
|
my $pleng = (unpack("L>", substr($data, $pos, 4)))[0]; |
48
|
0
|
|
|
|
|
|
$pos += 4; |
49
|
0
|
|
|
|
|
|
my $path = substr($data, $pos, $pleng); |
50
|
0
|
|
|
|
|
|
$pos += $pleng; |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
my ($sesflags, $rootuid, $rootgid, $mapalluid, $mapallgid, $mingoal, $maxgoal, $mintrashtime, $maxtrashtime); |
53
|
0
|
0
|
|
|
|
|
if ($ver >= 1626) { |
|
|
0
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
($sesflags, $rootuid, $rootgid, $mapalluid, $mapallgid, $mingoal, $maxgoal, $mintrashtime, $maxtrashtime) = unpack("(CLLLLCCLL)>", substr($data, $pos, 27)); |
55
|
0
|
|
|
|
|
|
$pos += 27; |
56
|
0
|
0
|
0
|
|
|
|
if ($mingoal <= 1 and $maxgoal >= 9) { |
57
|
0
|
|
|
|
|
|
$mingoal = undef; |
58
|
0
|
|
|
|
|
|
$maxgoal = undef; |
59
|
|
|
|
|
|
|
}; |
60
|
0
|
0
|
0
|
|
|
|
if ($mintrashtime == 0 and $maxtrashtime == 0xFFFFFFFF) { |
61
|
0
|
|
|
|
|
|
$mintrashtime = undef; |
62
|
0
|
|
|
|
|
|
$maxtrashtime = undef; |
63
|
|
|
|
|
|
|
}; |
64
|
|
|
|
|
|
|
} elsif ($ver > 1600) { |
65
|
0
|
|
|
|
|
|
($sesflags, $rootuid, $rootgid, $mapalluid, $mapallgid) = unpack("(CLLLL)>", substr($data, $pos, 17)); |
66
|
0
|
|
|
|
|
|
$mingoal = undef; |
67
|
0
|
|
|
|
|
|
$maxgoal = undef; |
68
|
0
|
|
|
|
|
|
$mintrashtime = undef; |
69
|
0
|
|
|
|
|
|
$maxtrashtime = undef; |
70
|
0
|
|
|
|
|
|
$pos += 17; |
71
|
|
|
|
|
|
|
} else { |
72
|
0
|
|
|
|
|
|
($sesflags, $rootuid, $rootgid) = unpack("(CLL)>", substr($data, $pos, 9)); |
73
|
0
|
|
|
|
|
|
$mapalluid = 0; |
74
|
0
|
|
|
|
|
|
$mapallgid = 0; |
75
|
0
|
|
|
|
|
|
$mingoal = undef; |
76
|
0
|
|
|
|
|
|
$maxgoal = undef; |
77
|
0
|
|
|
|
|
|
$mintrashtime = undef; |
78
|
0
|
|
|
|
|
|
$maxtrashtime = undef; |
79
|
0
|
|
|
|
|
|
$pos += 9; |
80
|
|
|
|
|
|
|
}; |
81
|
0
|
|
|
|
|
|
$pos += 8 * $startcnt; |
82
|
|
|
|
|
|
|
|
83
|
0
|
0
|
|
|
|
|
push @{$self->list}, { |
|
0
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sessionid => $sessionid, |
85
|
|
|
|
|
|
|
ip => "$ip1.$ip2.$ip3.$ip4", |
86
|
|
|
|
|
|
|
mount => $info, |
87
|
|
|
|
|
|
|
version => "$v1.$v2.$v3", |
88
|
|
|
|
|
|
|
meta => $path eq '.' ? 1 : 0, |
89
|
|
|
|
|
|
|
moose_path => $path, |
90
|
|
|
|
|
|
|
ses_flags => $sesflags, |
91
|
|
|
|
|
|
|
root_uid => $rootuid, |
92
|
|
|
|
|
|
|
root_gid => $rootgid, |
93
|
|
|
|
|
|
|
all_users_uid => $mapalluid, |
94
|
|
|
|
|
|
|
all_users_gid => $mapallgid, |
95
|
|
|
|
|
|
|
mingoal => $mingoal, |
96
|
|
|
|
|
|
|
maxgoal => $maxgoal, |
97
|
|
|
|
|
|
|
mintrashtime => $mintrashtime, |
98
|
|
|
|
|
|
|
maxtrashtime => $maxtrashtime, |
99
|
|
|
|
|
|
|
}; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
1; |