X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fvolume.c;h=7f8b1a535a34028890ee1c790099b4a0af1b1ed2;hb=5ff88f5d146936daaf954efb57279bd43d74f69d;hp=75049ec643cb500c22a8649d0697b59d69d59ea7;hpb=a951bdd9b6f82783cc92024da4c2761292db8a5b;p=netatalk.git 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