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
92e2381b
Commit
92e2381b
authored
Jun 23, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add untested Utimens implementation for loopbackFile.
parent
1fa5a003
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
6 deletions
+27
-6
fuse/files.go
fuse/files.go
+1
-6
fuse/files_linux.go
fuse/files_linux.go
+26
-0
No files found.
fuse/files.go
View file @
92e2381b
...
...
@@ -4,7 +4,6 @@ import (
"fmt"
"os"
"sync"
"time"
"syscall"
)
...
...
@@ -212,11 +211,7 @@ func (f *loopbackFile) GetAttr(a *Attr) Status {
return
OK
}
func
(
f
*
loopbackFile
)
Utimens
(
a
*
time
.
Time
,
m
*
time
.
Time
)
Status
{
return
ENOSYS
}
// Allocate implemented in files_linux.go
// Allocate, Utimens implemented in files_linux.go
////////////////////////////////////////////////////////////////
...
...
fuse/files_linux.go
View file @
92e2381b
package
fuse
import
(
"time"
"syscall"
)
...
...
@@ -13,3 +14,28 @@ func (f *loopbackFile) Allocate(off uint64, sz uint64, mode uint32) Status {
}
return
OK
}
const
_UTIME_NOW
=
((
1
<<
30
)
-
1
)
const
_UTIME_OMIT
=
((
1
<<
30
)
-
2
)
func
(
f
*
loopbackFile
)
Utimens
(
a
*
time
.
Time
,
m
*
time
.
Time
)
Status
{
tv
:=
make
([]
syscall
.
Timeval
,
2
)
if
a
==
nil
{
tv
[
0
]
.
Usec
=
_UTIME_OMIT
}
else
{
n
:=
a
.
UnixNano
()
tv
[
0
]
.
Sec
=
n
/
1e9
tv
[
0
]
.
Usec
=
(
n
%
1e9
)
/
1e3
}
if
m
==
nil
{
tv
[
1
]
.
Usec
=
_UTIME_OMIT
}
else
{
n
:=
a
.
UnixNano
()
tv
[
1
]
.
Sec
=
n
/
1e9
tv
[
1
]
.
Usec
=
(
n
%
1e9
)
/
1e3
}
err
:=
syscall
.
Futimes
(
int
(
f
.
File
.
Fd
()),
tv
)
return
ToStatus
(
err
)
}
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