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.6 by root, Tue Sep 27 01:43:03 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 57
55 if ($opt_stat) { 58 if ($opt_stat) {
62 65
63 &scan ("$path$_") for @$dirs; 66 &scan ("$path$_") for @$dirs;
64 }; 67 };
65} 68}
66 69
67IO::AIO::max_outstanding 64; 70IO::AIO::max_outstanding 100; # two fds per directory, so limit accordingly
68IO::AIO::min_parallel 32; 71IO::AIO::min_parallel 20;
69 72
70for my $seed (@ARGV) { 73for my $seed (@ARGV) {
71 $seed =~ s/\/+$//; 74 $seed =~ s/\/+$//;
72 aio_lstat "$seed/.", sub { 75 aio_lstat "$seed/.", sub {
73 if ($_[0]) { 76 if ($_[0]) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines