1From fea072084ff9d7c4d2c688059a2462bb0e59a2ec Mon Sep 17 00:00:00 2001
2From: K Henriksson <kthenriksson@gmail.com>
3Date: Wed, 27 Aug 2014 21:55:18 -0700
4Subject: [PATCH] Fix statfs operation
5
6The statfs implementation does not properly translate names back to the
7original, since the major encoding rewrite. This corrects that, and
8should fix issue #27.
9---
10 src/fuseops.c | 15 +++++++++++++--
11 1 file changed, 13 insertions(+), 2 deletions(-)
12
13diff --git a/src/fuseops.c b/src/fuseops.c
14index e7b4e7e..c333cbd 100644
15--- a/src/fuseops.c
16+++ b/src/fuseops.c
17@@ -337,9 +337,20 @@ static int mp3fs_statfs(const char *path, struct statvfs *stbuf) {
18 if (!origpath) {
19 goto translate_fail;
20 }
21-
22+
23+ /* pass-through for regular files */
24+ if (statvfs(origpath, stbuf) == 0) {
25+ goto passthrough;
26+ } else {
27+ /* Not really an error. */
28+ errno = 0;
29+ }
30+
31+ find_original(origpath);
32+
33 statvfs(origpath, stbuf);
34-
35+
36+passthrough:
37 free(origpath);
38 translate_fail:
39 return -errno;