From 5ff88f5d146936daaf954efb57279bd43d74f69d Mon Sep 17 00:00:00 2001 From: Frank Lahm Date: Wed, 23 Nov 2011 15:14:37 +0100 Subject: [PATCH] Update tm_get_used() function spec --- etc/afpd/volume.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/etc/afpd/volume.c b/etc/afpd/volume.c index 75049ec6..7f8b1a53 100644 --- a/etc/afpd/volume.c +++ b/etc/afpd/volume.c @@ -1516,8 +1516,12 @@ EC_CLEANUP: * 1) readdir(path of volume) * 2) for every element that matches regex "\(.*\)\.sparsebundle$" : * 3) parse "\1.sparsebundle/Info.plist" and read the band-size XML key integer value - * 4) stat "\1.sparsebundle/bands/" - * 5) calculate used size as: (st_nlink - 1) * band-size + * 4) readdir "\1.sparsebundle/bands/" counting files + * 5) calculate used size as: (file_count - 1) * band-size + * + * The result is cached in volume->v_tm_cachetime for TM_USED_CACHETIME secounds. + * The cached value volume->v_tm_cachetime is updated by volume->v_written. The latter + * is increased by X every time the client writes X bytes into a file (in fork.c). * * @param vol (rw) volume to calculate * @return Estimated used size in bytes, -1 on error -- 2.39.2