ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/bin/treescan
(Generate patch)

Comparing IO-AIO/bin/treescan (file contents):
Revision 1.8 by root, Tue Sep 27 12:12:55 2011 UTC vs.
Revision 1.9 by root, Fri Sep 30 00:23:44 2011 UTC

43sub scan { 43sub scan {
44 my ($path) = @_; 44 my ($path) = @_;
45 45
46 $path .= "/"; 46 $path .= "/";
47 47
48 IO::AIO::poll_cb;
49
48 aioreq_pri -1; 50 aioreq_pri -1;
49 aio_scandir $path, 8, sub { 51 aio_scandir $path, 8, sub {
50 my ($dirs, $files) = @_; 52 my ($dirs, $files) = @_
53 or warn "$path: $!\n";
51 54
52 printfn "", [$path] unless $opt_nodirs; 55 printfn "", [$path] unless $opt_nodirs;
53 printfn $path, $files unless $opt_nofiles; 56 printfn $path, $files unless $opt_nofiles;
54
55 IO::AIO::poll_cb;
56 57
57 if ($opt_stat) { 58 if ($opt_stat) {
58 aio_wd $path, sub { 59 aio_wd $path, sub {
59 my $wd = shift; 60 my $wd = shift;
60 61
64 65
65 &scan ("$path$_") for @$dirs; 66 &scan ("$path$_") for @$dirs;
66 }; 67 };
67} 68}
68 69
69IO::AIO::max_outstanding 400; # two fds per directory, so limit accordingly 70IO::AIO::max_outstanding 100; # two fds per directory, so limit accordingly
70IO::AIO::min_parallel 20; 71IO::AIO::min_parallel 20;
71 72
72for my $seed (@ARGV) { 73for my $seed (@ARGV) {
73 $seed =~ s/\/+$//; 74 $seed =~ s/\/+$//;
74 aio_lstat "$seed/.", sub { 75 aio_lstat "$seed/.", sub {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines