add FStatMore

This commit is contained in:
Ben McClelland
2018-12-22 20:20:23 -07:00
parent 8631924897
commit a723568378

View File

@@ -149,9 +149,14 @@ func StatMore(path string) (Stat, error) {
}
defer f.Close()
return FStatMore(f)
}
// FStatMore returns scoutfs specific metadata for file handle
func FStatMore(f *os.File) (Stat, error) {
s := Stat{ValidBytes: uint64(unsafe.Sizeof(Stat{}))}
_, err = scoutfsctl(f.Fd(), IOCSTATMORE, uintptr(unsafe.Pointer(&s)))
_, err := scoutfsctl(f.Fd(), IOCSTATMORE, uintptr(unsafe.Pointer(&s)))
if err != nil {
return Stat{}, err
}