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.5 by root, Sun Jan 9 05:10:28 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) {
59 aio_wd $path, sub {
60 my $wd = shift;
61
56 aio_lstat "$path$_" for @$files; 62 aio_lstat [$wd, $_] for @$files;
63 };
57 } 64 }
58 65
59 &scan ("$path$_") for @$dirs; 66 &scan ("$path$_") for @$dirs;
60 }; 67 };
61} 68}
62 69
63IO::AIO::max_outstanding 64; 70IO::AIO::max_outstanding 100; # two fds per directory, so limit accordingly
64IO::AIO::min_parallel 32; 71IO::AIO::min_parallel 20;
65 72
66for my $seed (@ARGV) { 73for my $seed (@ARGV) {
67 $seed =~ s/\/+$//; 74 $seed =~ s/\/+$//;
68 aio_lstat "$seed/.", sub { 75 aio_lstat "$seed/.", sub {
69 if ($_[0]) { 76 if ($_[0]) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines