• Poul-Henning Kamp's avatar
    Calculate the size of the backing store file. · f7a2788c
    Poul-Henning Kamp authored
    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: http://www.varnish-cache.org/svn/trunk@175 d4fa192b-c00b-0410-8231-f00ffab90ce4
    f7a2788c
storage_file.c 5.08 KB