Index: uspace/app/df/Makefile
===================================================================
--- uspace/app/df/Makefile	(revision 38eb0d7c6ce8f8d829f28ec2bd2ed7a121a3c531)
+++ uspace/app/df/Makefile	(revision 38eb0d7c6ce8f8d829f28ec2bd2ed7a121a3c531)
@@ -0,0 +1,35 @@
+#
+# Copyright (c) 2013 Manuele Conti
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+USPACE_PREFIX = ../..
+BINARY = df
+
+SOURCES = \
+	df.c 
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/app/df/df.c
===================================================================
--- uspace/app/df/df.c	(revision 38eb0d7c6ce8f8d829f28ec2bd2ed7a121a3c531)
+++ uspace/app/df/df.c	(revision 38eb0d7c6ce8f8d829f28ec2bd2ed7a121a3c531)
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2013 Manuele Conti
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup df
+ * @brief Df utility.
+ * @{
+ */
+/**
+ * @file
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <getopt.h>
+#include <sys/statfs.h>
+#include <errno.h>
+#include <adt/list.h>
+#include <vfs/vfs.h>
+
+#define NAME  "df"
+
+#define HEADER_TABLE "Filesystem     %4u-blocks           Used      Available Used%% Mounted on\n"
+
+#define PERCENTAGE(x, tot) ((unsigned long long) (100L * (x) / (tot)))  
+#define FSBK_TO_BK(x, fsbk, bk) \
+	(((fsbk) != 0 && (fsbk) < (bk)) ? \
+		(unsigned long long) ((x) / ((bk) / (fsbk))) : \
+		(unsigned long long) ((x) * ((fsbk) / (bk))))
+
+static unsigned int unit_size;
+
+static void print_statfs(struct statfs *, char *, char *);
+static void print_usage(void);
+
+int main(int argc, char *argv[])
+{
+	int optres, errflg = 0;
+	struct statfs st;
+	
+	unit_size = 512;
+
+	/******************************************/
+	/*   Parse command line options...        */
+	/******************************************/
+	while ((optres = getopt(argc, argv, ":hib:")) != -1) {
+		switch(optres) {
+		case 'h':
+			break;
+
+		case 'i':
+			break;
+
+		case 'b':
+			str_uint32_t(optarg, NULL, 0, 0, &unit_size);
+			break;
+    
+		case ':':       
+			fprintf(stderr, "Option -%c requires an operand\n", optopt);
+			errflg++;
+			break;
+
+		case '?':
+			fprintf(stderr, "Unrecognized option: -%c\n", optopt);
+			errflg++;
+			break;
+
+		default:
+			fprintf(stderr, "Unknown error while parsing command line options.");
+			errflg++;
+			break;
+		}
+	}
+
+	if (optind > argc) {
+		fprintf(stderr, "Too many input parameter\n");
+		errflg++;
+	}
+	
+	if (errflg) {
+		print_usage();
+		return 1;
+	}
+	
+	LIST_INITIALIZE(mtab_list);
+	get_mtab_list(&mtab_list);
+	printf(HEADER_TABLE, unit_size);
+	list_foreach(mtab_list, cur) {
+		mtab_ent_t *mtab_ent = list_get_instance(cur, mtab_ent_t,
+		    link);
+		statfs(mtab_ent->mp, &st);
+		print_statfs(&st, mtab_ent->fs_name, mtab_ent->mp);
+	}
+	putchar('\n');	
+	return 0;
+}
+
+static void print_statfs(struct statfs *st, char *name, char *mountpoint)
+{
+	printf("%10s", name);
+	printf(" %15llu %14llu %14llu %4llu%% %s\n", 
+		FSBK_TO_BK(st->f_blocks, st->f_bsize, unit_size),                              /* Blocks     */
+		FSBK_TO_BK(st->f_blocks - st->f_bfree, st->f_bsize, unit_size),                /* Used       */
+		FSBK_TO_BK(st->f_bfree, st->f_bsize, unit_size),                               /* Available  */
+		(st->f_blocks)?PERCENTAGE(st->f_blocks - st->f_bfree, st->f_blocks):0L,        /* Used%      */
+		mountpoint                                                                     /* Mounted on */
+	);
+}
+
+static void print_usage(void)
+{
+  printf("syntax: %s [-h] [-i]\n", NAME);
+  printf("  h : \"Human-readable\" output.\n");  
+  printf("  i : Include statistics on the number of free inodes. \n");
+  printf("\n");
+}
+
+/** @}
+ */
Index: uspace/app/trace/trace.c
===================================================================
--- uspace/app/trace/trace.c	(revision ccdc63e559f32b50f2381110a99211f6ed0775f3)
+++ uspace/app/trace/trace.c	(revision 38eb0d7c6ce8f8d829f28ec2bd2ed7a121a3c531)
@@ -724,4 +724,6 @@
 	o = oper_new("stat", 0, arg_def, V_ERRNO, 0, resp_def);
 	proto_add_oper(p, VFS_IN_STAT, o);
+	o = oper_new("statfs", 0, arg_def, V_ERRNO, 0, resp_def);
+	proto_add_oper(p, VFS_IN_STATFS, o);
 
 	proto_register(SERVICE_VFS, p);
