Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-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
jacobsa-fuse
Commits
4898d792
Commit
4898d792
authored
Dec 11, 2019
by
Ka-Hing Cheung
Committed by
Michael Stapelberg
Dec 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plumb through Fd in setattr (#67)
this allows us to distinguish between truncate vs ftruncate
parent
e7bcad20
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
conversions.go
conversions.go
+5
-0
fuseops/ops.go
fuseops/ops.go
+3
-0
samples/memfs/memfs.go
samples/memfs/memfs.go
+6
-0
No files found.
conversions.go
View file @
4898d792
...
@@ -93,6 +93,11 @@ func convertInMessage(
...
@@ -93,6 +93,11 @@ func convertInMessage(
to
.
Mtime
=
&
t
to
.
Mtime
=
&
t
}
}
if
valid
.
Handle
()
{
t
:=
fuseops
.
HandleID
(
in
.
Fh
)
to
.
Handle
=
&
t
}
case
fusekernel
.
OpForget
:
case
fusekernel
.
OpForget
:
type
input
fusekernel
.
ForgetIn
type
input
fusekernel
.
ForgetIn
in
:=
(
*
input
)(
inMsg
.
Consume
(
unsafe
.
Sizeof
(
input
{})))
in
:=
(
*
input
)(
inMsg
.
Consume
(
unsafe
.
Sizeof
(
input
{})))
...
...
fuseops/ops.go
View file @
4898d792
...
@@ -145,6 +145,9 @@ type SetInodeAttributesOp struct {
...
@@ -145,6 +145,9 @@ type SetInodeAttributesOp struct {
// The inode of interest.
// The inode of interest.
Inode
InodeID
Inode
InodeID
// If set, this is ftruncate(2), otherwise it's truncate(2)
Handle
*
HandleID
// The attributes to modify, or nil for attributes that don't need a change.
// The attributes to modify, or nil for attributes that don't need a change.
Size
*
uint64
Size
*
uint64
Mode
*
os
.
FileMode
Mode
*
os
.
FileMode
...
...
samples/memfs/memfs.go
View file @
4898d792
...
@@ -247,6 +247,12 @@ func (fs *memFS) SetInodeAttributes(
...
@@ -247,6 +247,12 @@ func (fs *memFS) SetInodeAttributes(
fs
.
mu
.
Lock
()
fs
.
mu
.
Lock
()
defer
fs
.
mu
.
Unlock
()
defer
fs
.
mu
.
Unlock
()
if
op
.
Size
!=
nil
&&
op
.
Handle
==
nil
&&
*
op
.
Size
!=
0
{
// require that truncate to non-zero has to be ftruncate()
// but allow open(O_TRUNC)
err
=
syscall
.
EBADF
}
// Grab the inode.
// Grab the inode.
inode
:=
fs
.
getInodeOrDie
(
op
.
Inode
)
inode
:=
fs
.
getInodeOrDie
(
op
.
Inode
)
...
...
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