spd_readdir.c and readdir_r [new version]

Ross Boylan ross at biostat.ucsf.edu
Mon Jun 9 04:26:28 UTC 2008

I've attached a modified version of Ted's spd_readdir.c that adds
support for readdir_r and readdir64_r.  It appears to be working
(readdir64_r is the only new routine getting exercised), but should be
taken as a rough cut.  I also added a Makefile and a test program.

It also looks as if this is giving me a huge speed improvement (at least
x4) of my backups of my ext3 partitions.  I'll try to report after a
full and incremental backup complete, which will be a couple of days.

Originally I tried taking the threading code from the system
implementations of the original readdir_r.  When that didn't work (since
it was designed to be part of a libc build) I switched to pthreads.  I
don't know if recursive locking is essential; I activated it at one
point while trying to get things to work.

For big directories this code could use quite a lot of memory.  It
allows an optional max size, beyond which it reverts to the original
system calls.  I wonder if instead taking large directories in chunks
would preserve much of the speedup while putting a bound on memory use.

Ross Boylan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: RBspd_dir.tgz
Type: application/x-compressed-tar
Size: 889 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/ext3-users/attachments/20080608/edf71b04/attachment.bin>

More information about the Ext3-users mailing list