Commit ebb901ab authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Implement Statfs for UnionFs.

parent e5bc5944
...@@ -934,6 +934,10 @@ func (me *UnionFs) Name() string { ...@@ -934,6 +934,10 @@ func (me *UnionFs) Name() string {
return fmt.Sprintf("%v", names) return fmt.Sprintf("%v", names)
} }
func (me *UnionFs) StatFs() *fuse.StatfsOut {
return me.fileSystems[0].StatFs()
}
type UnionFsFile struct { type UnionFsFile struct {
fuse.File fuse.File
layer int layer int
...@@ -948,3 +952,4 @@ func (me *UnionFsFile) GetAttr() (*os.FileInfo, fuse.Status) { ...@@ -948,3 +952,4 @@ func (me *UnionFsFile) GetAttr() (*os.FileInfo, fuse.Status) {
} }
return fi, code return fi, code
} }
...@@ -968,3 +968,17 @@ func TestFdLeak(t *testing.T) { ...@@ -968,3 +968,17 @@ func TestFdLeak(t *testing.T) {
t.Errorf("/proc/self/fd changed size: after %v before %v", len(beforeEntries), len(afterEntries)) t.Errorf("/proc/self/fd changed size: after %v before %v", len(beforeEntries), len(afterEntries))
} }
} }
func TestStatFs(t *testing.T) {
wd, clean := setupUfs(t)
defer clean()
s1 := syscall.Statfs_t{}
err := syscall.Statfs(wd + "/mount", &s1)
if err != 0 {
t.Fatal("statfs mnt", err)
}
if s1.Bsize == 0 {
t.Fatal("Expect blocksize > 0")
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment