Hi Robert, At 02.44 09/08/2005, Robert Collins wrote:
On Mon, 2005-08-08 at 19:08 +0200, Serassio Guido wrote: > Hi, > > Looking to bug #1371 (http://www.squid-cache.org/bugs/show_bug.cgi?id=1371) > I have found the following code: > > void > DiskThreadsIOStrategy::unlinkFile(char const *path) > { > statCounter.syscalls.disk.unlinks++; > #if USE_TRUNCATE_NOT_UNLINK > > aioTruncate(path, NULL, NULL); > #else > > aioUnlink(path, NULL, NULL); > #endif > } > > And in configure I'm reading: > > --enable-truncate This uses truncate() instead of unlink() when > removing cache files. Truncate gives a little > performance improvement, but may cause problems > when used with async I/O. Truncate uses more > filesystem inodes than unlink.. > > So I have a doubt: > > #if USE_TRUNCATE_NOT_UNLINK > > Is an error or a trick to avoid usage of truncate() with aufs ? Neither, its the corollary to the configure option ... the api is always unlinkFile, but if --enable-truncate is passed, then the underlying implementation becomes truncate.
Sorry, but I was not clear: --enable-truncate defines USE_TRUNCATE, not USE_TRUNCATE_NOT_UNLINK.
USE_TRUNCATE_NOT_UNLINK is not defined in any other place. So truncate() will be never used. This is correct, or an old error ? Regards Guido - ======================================================== Guido Serassio Acme Consulting S.r.l. - Microsoft Certified Partner Via Lucia Savarino, 1 10098 - Rivoli (TO) - ITALY Tel. : +39.011.9530135 Fax. : +39.011.9781115 Email: [EMAIL PROTECTED] WWW: http://www.acmeconsulting.it/
