dss-0.1.7.
[dss.git] / df.c
diff --git a/df.c b/df.c
index c0c42f87af6c495db89c61f24c38a7e38d31f268..003becccddebe5231289afb63c5c527c550357b1 100644 (file)
--- a/df.c
+++ b/df.c
@@ -1,3 +1,8 @@
+/*
+ * Copyright (C) 2008-2010 Andre Noll <maan@tuebingen.mpg.de>
+ *
+ * Licensed under the GPL v2. For licencing details see COPYING.
+ */
 #include <sys/statvfs.h>
 #include <stdio.h>
 #include <assert.h>
@@ -6,8 +11,9 @@
 #include <errno.h>
 
 #include "gcc-compat.h"
-#include "error.h"
-#include "string.h"
+#include "log.h"
+#include "err.h"
+#include "str.h"
 #include "df.h"
 
 int get_disk_space(const char *path, struct disk_space *result)
@@ -33,3 +39,10 @@ int get_disk_space(const char *path, struct disk_space *result)
        result->percent_free_inodes = 100.0 * available_inodes / total_inodes + 0.5;
        return 1;
 }
+
+void log_disk_space(struct disk_space *ds)
+{
+       DSS_INFO_LOG(("free: %uM/%uM (%u%%), %u%% inodes unused\n",
+               ds->free_mb, ds->total_mb, ds->percent_free,
+               ds->percent_free_inodes));
+}