line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# PurePerl implementation glue to '/usr/sbin/lfs' |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# (C) 2010 Adrian Ulrich - |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or |
7
|
|
|
|
|
|
|
# modify it under the same terms as Perl itself. |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
package Lustre::LFS::File; |
12
|
1
|
|
|
1
|
|
25612
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
13
|
1
|
|
|
1
|
|
487
|
use Lustre::LFS; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
53
|
|
14
|
1
|
|
|
1
|
|
962
|
use IO::File; |
|
1
|
|
|
|
|
11939
|
|
|
1
|
|
|
|
|
149
|
|
15
|
1
|
|
|
1
|
|
9
|
use base 'IO::File'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
391
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
######################################################################## |
19
|
|
|
|
|
|
|
# Return stripe information for opened file |
20
|
|
|
|
|
|
|
sub get_stripe { |
21
|
0
|
|
|
0
|
1
|
|
my($self) = @_; |
22
|
0
|
|
|
|
|
|
return Lustre::LFS::_parse_get_stripe_file($self); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
######################################################################## |
26
|
|
|
|
|
|
|
# This is not implemented yet |
27
|
|
|
|
|
|
|
sub join_objects { |
28
|
0
|
|
|
0
|
1
|
|
return undef; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
######################################################################## |
32
|
|
|
|
|
|
|
# Creates a new file with specified striping parameters |
33
|
|
|
|
|
|
|
sub lfs_create { |
34
|
0
|
|
|
0
|
1
|
|
my($self, %args) = @_; |
35
|
0
|
0
|
|
|
|
|
my $fname = delete($args{File}) or return undef; |
36
|
0
|
|
|
|
|
|
my $ssize = delete($args{Size}); |
37
|
0
|
|
|
|
|
|
my $soff = delete($args{Offset}); |
38
|
0
|
|
|
|
|
|
my $scount= delete($args{Count}); |
39
|
0
|
|
|
|
|
|
my $spool = delete($args{Pool}); |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my @arglist = ("setstripe"); |
42
|
|
|
|
|
|
|
|
43
|
0
|
0
|
|
|
|
|
push(@arglist, "--size" , int($ssize)) if defined $ssize; |
44
|
0
|
0
|
|
|
|
|
push(@arglist, "--offset", int($soff)) if defined $soff; |
45
|
0
|
0
|
|
|
|
|
push(@arglist, "--count" , int($scount)) if defined $scount; |
46
|
0
|
0
|
|
|
|
|
push(@arglist, "--pool" , $spool) if defined $spool; |
47
|
0
|
|
|
|
|
|
push(@arglist, "--", $fname); |
48
|
|
|
|
|
|
|
|
49
|
0
|
0
|
0
|
|
|
|
Lustre::LFS::_lfs_system(@arglist) || |
50
|
|
|
|
|
|
|
$self->open("+> $fname") && |
51
|
|
|
|
|
|
|
return 1; |
52
|
|
|
|
|
|
|
# else |
53
|
0
|
|
|
|
|
|
return 0; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__END__ |