On Nov 1, 2007 9:24 PM, Simon Lundell <[EMAIL PROTECTED]> wrote: > On 10/30/07, Dave Kleikamp <[EMAIL PROTECTED]> wrote: > > On Tue, 2007-10-30 at 12:35 +0000, Dave Kleikamp wrote: > > > > That is on a directory that the ordinary 'copy' could not defragment > > > > more. I had a little trouble aligning buffers and writing files whose > > > > length was not a multiple of the required alignment. > > > > > > I didn't think about those limitations when I suggested it, but that is > > > something you need to be careful about. Allocating the buffers with > > > posix_memalign() should take care of the first concern. > > > > As far as the file length, you could pad the file to the next full > > block, then truncate it to the correct size. > > > > Thanks for the tip. I use a 128Mb statically allocated buffer that is > reused. The file is written to the next block (512b) boundry and then > truncated.Seems to work quite well. > > The code is available from http://sourceforge.net/projects/freede/. It > requires boost-1.34. I'll try to figure out how to do a statically linked > binary. > > It works very well for me. I have not lost any files (yet). It checks for > md5sums before and after the rewrite to se if the file was rewritten OK. Do > NOT use on directories where files are read from or written to! There is no > file locking implemented yet. > > It currently only tries to minimize the number of fragments per file. It > does not defragment directories. There was a quite interesting suggestion on > how to do defrag directories in the thread "jfs tunning", i'll look into > that next.
Regarding directory fragmentation; is there any way to determine how fragmented a dir is? Traversal time seems to be pretty useless as the OS seems to cache directory contents. //Simon ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Jfs-discussion mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jfs-discussion
