Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Levin Zimmermann
go-fuse
Commits
5f26900d
Commit
5f26900d
authored
Nov 22, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Note TODOs for LoopbackFile.
parent
33fc3c76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
fuse/files.go
fuse/files.go
+5
-1
No files found.
fuse/files.go
View file @
5f26900d
...
@@ -92,7 +92,10 @@ func (f *DevNullFile) Truncate(size uint64) (code Status) {
...
@@ -92,7 +92,10 @@ func (f *DevNullFile) Truncate(size uint64) (code Status) {
type
LoopbackFile
struct
{
type
LoopbackFile
struct
{
File
*
os
.
File
File
*
os
.
File
// os.File is threadsafe, except for close, which writes into the fd.
// os.File is not threadsafe. Although fd themselves are
// constant during the lifetime of an open file, the OS may
// reuse the fd number after it is closed. When combined with
// threads,
lock
sync
.
Mutex
lock
sync
.
Mutex
DefaultFile
DefaultFile
}
}
...
@@ -119,6 +122,7 @@ func (f *LoopbackFile) Write(data []byte, off int64) (uint32, Status) {
...
@@ -119,6 +122,7 @@ func (f *LoopbackFile) Write(data []byte, off int64) (uint32, Status) {
return
uint32
(
n
),
ToStatus
(
err
)
return
uint32
(
n
),
ToStatus
(
err
)
}
}
// TODO - should bring back close error back to user space.
func
(
f
*
LoopbackFile
)
Release
()
{
func
(
f
*
LoopbackFile
)
Release
()
{
f
.
lock
.
Lock
()
f
.
lock
.
Lock
()
f
.
File
.
Close
()
f
.
File
.
Close
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment