Added FUSE support #55

Merged
Elara6331 merged 65 commits from yannickulrich/itd:fuse into master 2023-03-25 22:23:52 +00:00
Showing only changes of commit afaa5990c4 - Show all commits

View File

@ -246,6 +246,11 @@ func (fh *bytesFileWriteHandle) Flush(ctx context.Context) (errno syscall.Errno)
fp.Close()
return syscall.EROFS
}
err = fp.Close()
if err != nil {
log.Error("Flush failed: close").Str("path", fh.path).Err(err).Send()
return syscall.EROFS
}
log.Info("Flush done").Str("path", fh.path).Int("size", len(fh.content)).Send()
return 0
@ -303,6 +308,12 @@ func (f *ITNode) Open(ctx context.Context, openFlags uint32) (fh fs.FileHandle,
nread, err := fp.Read(buf)
if err != nil || nread != int(f.self.size) {
log.Error("Reading file failed").Str("path", f.path).Err(err).Send();
fp.Close()
return nil, 0, syscall.EROFS
}
err = fp.Close()
if err != nil {
log.Error("Closing file failed").Str("path", f.path).Err(err).Send();
return nil, 0, syscall.EROFS
}