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
Kirill Smelkov
go-fuse
Commits
69ea907f
Commit
69ea907f
authored
Feb 22, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodefs: fsync.
parent
eb28608b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
2 deletions
+15
-2
nodefs/api.go
nodefs/api.go
+4
-0
nodefs/bridge.go
nodefs/bridge.go
+2
-1
nodefs/default.go
nodefs/default.go
+8
-0
nodefs/files.go
nodefs/files.go
+1
-1
No files found.
nodefs/api.go
View file @
69ea907f
...
...
@@ -95,6 +95,8 @@ type Node interface {
Write
(
ctx
context
.
Context
,
f
File
,
data
[]
byte
,
off
int64
)
(
written
uint32
,
code
fuse
.
Status
)
Fsync
(
ctx
context
.
Context
,
f
File
,
flags
uint32
)
(
code
fuse
.
Status
)
// File locking
GetLk
(
ctx
context
.
Context
,
f
File
,
owner
uint64
,
lk
*
fuse
.
FileLock
,
flags
uint32
,
out
*
fuse
.
FileLock
)
(
code
fuse
.
Status
)
SetLk
(
ctx
context
.
Context
,
f
File
,
owner
uint64
,
lk
*
fuse
.
FileLock
,
flags
uint32
)
(
code
fuse
.
Status
)
...
...
@@ -143,6 +145,8 @@ type File interface {
// once for a file.
Flush
(
ctx
context
.
Context
)
fuse
.
Status
Fsync
(
ctx
context
.
Context
,
flags
uint32
)
fuse
.
Status
// This is called to before the file handle is forgotten. This
// method has no return value, so nothing can synchronizes on
// the call. Any cleanup that requires specific synchronization or
...
...
nodefs/bridge.go
View file @
69ea907f
...
...
@@ -405,7 +405,8 @@ func (b *rawBridge) Flush(input *fuse.FlushIn) fuse.Status {
}
func
(
b
*
rawBridge
)
Fsync
(
input
*
fuse
.
FsyncIn
)
(
code
fuse
.
Status
)
{
return
fuse
.
ENOSYS
n
,
f
:=
b
.
inode
(
input
.
NodeId
,
input
.
Fh
)
return
n
.
node
.
Fsync
(
context
.
TODO
(),
f
.
file
,
input
.
FsyncFlags
)
}
func
(
b
*
rawBridge
)
Fallocate
(
input
*
fuse
.
FallocateIn
)
(
code
fuse
.
Status
)
{
...
...
nodefs/default.go
View file @
69ea907f
...
...
@@ -54,6 +54,14 @@ func (n *DefaultNode) Read(ctx context.Context, f File, dest []byte, off int64)
}
return
nil
,
fuse
.
ENOSYS
}
func
(
n
*
DefaultNode
)
Fsync
(
ctx
context
.
Context
,
f
File
,
flags
uint32
)
fuse
.
Status
{
if
f
!=
nil
{
return
f
.
Fsync
(
ctx
,
flags
)
}
return
fuse
.
ENOSYS
}
func
(
n
*
DefaultNode
)
Write
(
ctx
context
.
Context
,
f
File
,
data
[]
byte
,
off
int64
)
(
written
uint32
,
code
fuse
.
Status
)
{
if
f
!=
nil
{
return
f
.
Write
(
ctx
,
data
,
off
)
...
...
nodefs/files.go
View file @
69ea907f
...
...
@@ -68,7 +68,7 @@ func (f *loopbackFile) Flush(ctx context.Context) fuse.Status {
return
fuse
.
ToStatus
(
err
)
}
func
(
f
*
loopbackFile
)
Fsync
(
ctx
context
.
Context
,
flags
int
)
(
code
fuse
.
Status
)
{
func
(
f
*
loopbackFile
)
Fsync
(
ctx
context
.
Context
,
flags
uint32
)
(
code
fuse
.
Status
)
{
f
.
mu
.
Lock
()
r
:=
fuse
.
ToStatus
(
syscall
.
Fsync
(
int
(
f
.
File
.
Fd
())))
f
.
mu
.
Unlock
()
...
...
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