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
0e98d4bf
Commit
0e98d4bf
authored
Apr 06, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodefs: add EntryOut to Create signature
parent
2d41aad8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
11 deletions
+7
-11
nodefs/api.go
nodefs/api.go
+1
-1
nodefs/bridge.go
nodefs/bridge.go
+1
-8
nodefs/loopback.go
nodefs/loopback.go
+5
-2
No files found.
nodefs/api.go
View file @
0e98d4bf
...
@@ -334,7 +334,7 @@ type Symlinker interface {
...
@@ -334,7 +334,7 @@ type Symlinker interface {
// reference for future reads/writes.
// reference for future reads/writes.
// Default is to return EROFS.
// Default is to return EROFS.
type
Creater
interface
{
type
Creater
interface
{
Create
(
ctx
context
.
Context
,
name
string
,
flags
uint32
,
mode
uint32
)
(
node
*
Inode
,
fh
FileHandle
,
fuseFlags
uint32
,
errno
syscall
.
Errno
)
Create
(
ctx
context
.
Context
,
name
string
,
flags
uint32
,
mode
uint32
,
out
*
fuse
.
EntryOut
)
(
node
*
Inode
,
fh
FileHandle
,
fuseFlags
uint32
,
errno
syscall
.
Errno
)
}
}
// Unlink should remove a child from this directory. If the
// Unlink should remove a child from this directory. If the
...
...
nodefs/bridge.go
View file @
0e98d4bf
...
@@ -337,7 +337,7 @@ func (b *rawBridge) Create(cancel <-chan struct{}, input *fuse.CreateIn, name st
...
@@ -337,7 +337,7 @@ func (b *rawBridge) Create(cancel <-chan struct{}, input *fuse.CreateIn, name st
var
f
FileHandle
var
f
FileHandle
var
flags
uint32
var
flags
uint32
if
mops
,
ok
:=
parent
.
ops
.
(
Creater
);
ok
{
if
mops
,
ok
:=
parent
.
ops
.
(
Creater
);
ok
{
child
,
f
,
flags
,
errno
=
mops
.
Create
(
ctx
,
name
,
input
.
Flags
,
input
.
Mode
)
child
,
f
,
flags
,
errno
=
mops
.
Create
(
ctx
,
name
,
input
.
Flags
,
input
.
Mode
,
&
out
.
EntryOut
)
}
else
{
}
else
{
return
fuse
.
EROFS
return
fuse
.
EROFS
}
}
...
@@ -353,15 +353,8 @@ func (b *rawBridge) Create(cancel <-chan struct{}, input *fuse.CreateIn, name st
...
@@ -353,15 +353,8 @@ func (b *rawBridge) Create(cancel <-chan struct{}, input *fuse.CreateIn, name st
out
.
OpenFlags
=
flags
out
.
OpenFlags
=
flags
var
temp
fuse
.
AttrOut
b
.
getattr
(
ctx
,
child
,
f
,
&
temp
)
out
.
Attr
=
temp
.
Attr
out
.
AttrValid
=
temp
.
AttrValid
out
.
AttrValidNsec
=
temp
.
AttrValidNsec
child
.
setEntryOut
(
&
out
.
EntryOut
)
child
.
setEntryOut
(
&
out
.
EntryOut
)
b
.
setEntryOutTimeout
(
&
out
.
EntryOut
)
b
.
setEntryOutTimeout
(
&
out
.
EntryOut
)
return
fuse
.
OK
return
fuse
.
OK
}
}
...
...
nodefs/loopback.go
View file @
0e98d4bf
...
@@ -41,7 +41,6 @@ var _ = (Mkdirer)((*loopbackNode)(nil))
...
@@ -41,7 +41,6 @@ var _ = (Mkdirer)((*loopbackNode)(nil))
var
_
=
(
Mknoder
)((
*
loopbackNode
)(
nil
))
var
_
=
(
Mknoder
)((
*
loopbackNode
)(
nil
))
var
_
=
(
Linker
)((
*
loopbackNode
)(
nil
))
var
_
=
(
Linker
)((
*
loopbackNode
)(
nil
))
var
_
=
(
Symlinker
)((
*
loopbackNode
)(
nil
))
var
_
=
(
Symlinker
)((
*
loopbackNode
)(
nil
))
var
_
=
(
Creater
)((
*
loopbackNode
)(
nil
))
var
_
=
(
Unlinker
)((
*
loopbackNode
)(
nil
))
var
_
=
(
Unlinker
)((
*
loopbackNode
)(
nil
))
var
_
=
(
Rmdirer
)((
*
loopbackNode
)(
nil
))
var
_
=
(
Rmdirer
)((
*
loopbackNode
)(
nil
))
var
_
=
(
Renamer
)((
*
loopbackNode
)(
nil
))
var
_
=
(
Renamer
)((
*
loopbackNode
)(
nil
))
...
@@ -182,7 +181,9 @@ func (r *loopbackRoot) idFromStat(st *syscall.Stat_t) NodeAttr {
...
@@ -182,7 +181,9 @@ func (r *loopbackRoot) idFromStat(st *syscall.Stat_t) NodeAttr {
}
}
}
}
func
(
n
*
loopbackNode
)
Create
(
ctx
context
.
Context
,
name
string
,
flags
uint32
,
mode
uint32
)
(
inode
*
Inode
,
fh
FileHandle
,
fuseFlags
uint32
,
errno
syscall
.
Errno
)
{
var
_
=
(
Creater
)((
*
loopbackNode
)(
nil
))
func
(
n
*
loopbackNode
)
Create
(
ctx
context
.
Context
,
name
string
,
flags
uint32
,
mode
uint32
,
out
*
fuse
.
EntryOut
)
(
inode
*
Inode
,
fh
FileHandle
,
fuseFlags
uint32
,
errno
syscall
.
Errno
)
{
p
:=
filepath
.
Join
(
n
.
path
(),
name
)
p
:=
filepath
.
Join
(
n
.
path
(),
name
)
fd
,
err
:=
syscall
.
Open
(
p
,
int
(
flags
)
|
os
.
O_CREATE
,
mode
)
fd
,
err
:=
syscall
.
Open
(
p
,
int
(
flags
)
|
os
.
O_CREATE
,
mode
)
...
@@ -199,6 +200,8 @@ func (n *loopbackNode) Create(ctx context.Context, name string, flags uint32, mo
...
@@ -199,6 +200,8 @@ func (n *loopbackNode) Create(ctx context.Context, name string, flags uint32, mo
node
:=
&
loopbackNode
{}
node
:=
&
loopbackNode
{}
ch
:=
n
.
NewInode
(
ctx
,
node
,
n
.
root
()
.
idFromStat
(
&
st
))
ch
:=
n
.
NewInode
(
ctx
,
node
,
n
.
root
()
.
idFromStat
(
&
st
))
lf
:=
NewLoopbackFile
(
fd
)
lf
:=
NewLoopbackFile
(
fd
)
out
.
FromStat
(
&
st
)
return
ch
,
lf
,
0
,
0
return
ch
,
lf
,
0
,
0
}
}
...
...
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