Track the number of times a sparsebundle has been opened using uintmax_t

Instead of off_t, which doesn't make sense, being both unsigned and not
a very logical type to use for a counter.
This commit is contained in:
Tor Arne Vestbø
2018-05-04 00:11:34 +02:00
parent 90c81b1776
commit 7414e516c2

View File

@@ -56,7 +56,7 @@ struct sparsebundle_t {
char *mountpoint;
size_t band_size;
size_t size;
off_t times_opened;
uintmax_t times_opened;
#if FUSE_SUPPORTS_ZERO_COPY
map<string, int> open_files;
#endif
@@ -370,6 +370,7 @@ static int sparsebundle_release(const char *path, struct fuse_file_info *)
{
sparsebundle_t *sparsebundle = sparsebundle_current();
assert(sparsebundle->times_opened);
sparsebundle->times_opened--;
syslog(LOG_DEBUG, "closed %s%s, now referenced %ju times",
sparsebundle->mountpoint, path, uintmax_t(sparsebundle->times_opened));