summaryrefslogtreecommitdiff
path: root/pgfuse.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2015-05-17 20:49:41 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2015-05-17 20:59:01 +0200
commit1f954b12d5d6fba4e5d183980b18bdf4032aa905 (patch)
treee74973a6f742f4946fd942e484cc1f020f61da45 /pgfuse.c
parent300bad9092e0ddcae4a4137df087f5e32fbd6e00 (diff)
downloadpgfuse-1f954b12d5d6fba4e5d183980b18bdf4032aa905.tar.gz
pgfuse-1f954b12d5d6fba4e5d183980b18bdf4032aa905.tar.bz2
cherry picked statfs fix
Diffstat (limited to 'pgfuse.c')
-rw-r--r--pgfuse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pgfuse.c b/pgfuse.c
index cbe937b..770dcf3 100644
--- a/pgfuse.c
+++ b/pgfuse.c
@@ -1096,7 +1096,7 @@ static int pgfuse_statfs( const char *path, struct statvfs *buf )
/* no restriction on the number of files storable, we could
add some limits later */
- files_free = INT64_MAX;
+ files_total = INT64_MAX;
files_used = psql_get_fs_files_used( conn );
if( files_used < 0 ) {
@@ -1104,12 +1104,12 @@ static int pgfuse_statfs( const char *path, struct statvfs *buf )
return files_used;
}
- files_total = files_free + files_used;
+ files_free = files_total - files_used;
files_avail = files_free;
if( data->verbose ) {
syslog( LOG_DEBUG, "Stats for '%s' are (%jd blocks total, %jd used, %jd free, "
- "%jd files total, %jd files used, %jd files free, thread #%u",
+ "%"PRId64" inodes total, %"PRId64" inodes used, %"PRId64" inodes free, thread #%u",
data->mountpoint,
blocks_total, blocks_used, blocks_free,
files_total, files_used, files_free,