]> err.no Git - varnish/commit
Calculate the size of the backing store file.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 13 Jun 2006 13:14:12 +0000 (13:14 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 13 Jun 2006 13:14:12 +0000 (13:14 +0000)
commit2506db95cbd52d2523025050f9fe8d5cda02778e
treeb8e2e8df47a02fd6b88a7648cf553d65f458fdab
parent3df69b68bb73e1092c7168d46ee184291ecc0ac1
Calculate the size of the backing store file.

A size can be specified in absolute terms (suffix: k, m, g, t supported),
but also as a percentage of the filesystems free space (suffix '%').

If the specified size is larger than an off_t can cope, we bisect
repeatedly until it can.

If the size exceeds the available space of the filesystem, we truncate
to 80% of the free space.

Then round down to an integral number of blocks, sized by the larger
of the filesystem blocksize and the pagesize.

This was tricker than I'd expected...

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@175 d4fa192b-c00b-0410-8231-f00ffab90ce4
varnish-cache/bin/varnishd/storage_file.c