From 1f954b12d5d6fba4e5d183980b18bdf4032aa905 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 17 May 2015 20:49:41 +0200 Subject: cherry picked statfs fix --- pgfuse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pgfuse.c') 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, -- cgit v1.2.3-54-g00ecf