Re: Usage of truncate() with aufs

From: Serassio Guido <guido.serassio@dont-contact.us>
Date: Tue, 09 Aug 2005 08:33:28 +0200

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: guido.serassio@acmeconsulting.it
WWW: http://www.acmeconsulting.it/
Received on Tue Aug 09 2005 - 00:33:33 MDT

This archive was generated by hypermail pre-2.1.9 : Wed Aug 31 2005 - 12:00:06 MDT