Commit 70326fc5 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

nodefs: more doc

parent 32016f39
...@@ -86,5 +86,5 @@ or ...@@ -86,5 +86,5 @@ or
* Merge Fsync/FsyncDir? * Merge Fsync/FsyncDir?
* Merge Release/ReleaseDir? * Merge Release/ReleaseDir? (others?)
...@@ -139,8 +139,6 @@ type Operations interface { ...@@ -139,8 +139,6 @@ type Operations interface {
// ERANGE and the correct size. // ERANGE and the correct size.
ListXAttr(ctx context.Context, dest []byte) (uint32, fuse.Status) ListXAttr(ctx context.Context, dest []byte) (uint32, fuse.Status)
// The methods below may be called on closed files, due to
// concurrency.
GetAttr(ctx context.Context, f FileHandle, out *fuse.AttrOut) fuse.Status GetAttr(ctx context.Context, f FileHandle, out *fuse.AttrOut) fuse.Status
// Lookup should find a direct child of the node by child // Lookup should find a direct child of the node by child
...@@ -284,8 +282,6 @@ type FileHandle interface { ...@@ -284,8 +282,6 @@ type FileHandle interface {
// errors should happen in Flush instead. // errors should happen in Flush instead.
Release() fuse.Status Release() fuse.Status
// The methods below may be called on closed files, due to
// concurrency.
GetAttr(ctx context.Context, out *fuse.AttrOut) fuse.Status GetAttr(ctx context.Context, out *fuse.AttrOut) fuse.Status
Truncate(ctx context.Context, size uint64) fuse.Status Truncate(ctx context.Context, size uint64) fuse.Status
Chown(ctx context.Context, uid uint32, gid uint32) fuse.Status Chown(ctx context.Context, uid uint32, gid uint32) fuse.Status
......
...@@ -22,11 +22,10 @@ func newLoopbackFile(fd int) *loopbackFile { ...@@ -22,11 +22,10 @@ func newLoopbackFile(fd int) *loopbackFile {
type loopbackFile struct { type loopbackFile struct {
fd int fd int
// os.File is not threadsafe. Although fd themselves are // Although fd themselves are constant during the lifetime of
// constant during the lifetime of an open file, the OS may // an open file, the OS may reuse the fd number after it is
// reuse the fd number after it is closed. When open races // closed. When open races with another close, they may lead
// with another close, they may lead to confusion as which // to confusion as which file gets written in the end.
// file gets written in the end.
mu sync.Mutex mu sync.Mutex
} }
......
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