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
41672d15
Commit
41672d15
authored
Mar 27, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodefs: by default return input offset for Lseek
parent
1ee3533f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
nodefs/constants.go
nodefs/constants.go
+6
-0
nodefs/default.go
nodefs/default.go
+6
-0
nodefs/directio_test.go
nodefs/directio_test.go
+1
-3
No files found.
nodefs/constants.go
View file @
41672d15
...
...
@@ -21,3 +21,9 @@ func ToErrno(err error) syscall.Errno {
// RENAME_EXCHANGE is a flag argument for renameat2()
const
RENAME_EXCHANGE
=
0x2
// seek to the next data
const
_SEEK_DATA
=
3
// seek to the next hole
const
_SEEK_HOLE
=
4
nodefs/default.go
View file @
41672d15
...
...
@@ -195,10 +195,16 @@ func (n *OperationStubs) CopyFileRange(ctx context.Context, fhIn FileHandle,
return
0
,
syscall
.
EROFS
}
// Lseek is called for seeking to and beyond holes. By default, it
// returns the input offset unchanged.
func
(
n
*
OperationStubs
)
Lseek
(
ctx
context
.
Context
,
f
FileHandle
,
off
uint64
,
whence
uint32
)
(
uint64
,
syscall
.
Errno
)
{
if
f
!=
nil
{
return
f
.
Lseek
(
ctx
,
off
,
whence
)
}
if
whence
==
_SEEK_DATA
||
whence
==
_SEEK_HOLE
{
return
off
,
OK
}
return
0
,
syscall
.
ENOTSUP
}
...
...
nodefs/directio_test.go
View file @
41672d15
...
...
@@ -81,9 +81,7 @@ func TestDirectIO(t *testing.T) {
t
.
Errorf
(
"got %q want %q"
,
got
,
want
)
}
const
SEEK_DATA
=
3
/* seek to the next data */
if
n
,
err
:=
syscall
.
Seek
(
int
(
f
.
Fd
()),
512
,
SEEK_DATA
);
err
!=
nil
{
if
n
,
err
:=
syscall
.
Seek
(
int
(
f
.
Fd
()),
512
,
_SEEK_DATA
);
err
!=
nil
{
t
.
Errorf
(
"Seek: %v"
,
err
)
}
else
if
n
!=
1024
{
t
.
Errorf
(
"seek: got %d, want %d"
,
n
,
1024
)
...
...
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