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
df9202b8
Commit
df9202b8
authored
Sep 17, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add File.InnerFile() for safe unpacking.
parent
24dceee8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
fuse/api.go
fuse/api.go
+4
-0
fuse/defaultfile.go
fuse/defaultfile.go
+7
-0
fuse/fsmount.go
fuse/fsmount.go
+3
-1
No files found.
fuse/api.go
View file @
df9202b8
...
@@ -140,6 +140,10 @@ type File interface {
...
@@ -140,6 +140,10 @@ type File interface {
// Called upon registering the filehandle in the inode.
// Called upon registering the filehandle in the inode.
SetInode
(
*
Inode
)
SetInode
(
*
Inode
)
// Wrappers around other File implementations, should return
// the inner file here.
InnerFile
()
File
Read
(
*
ReadIn
,
BufferPool
)
([]
byte
,
Status
)
Read
(
*
ReadIn
,
BufferPool
)
([]
byte
,
Status
)
Write
(
*
WriteIn
,
[]
byte
)
(
written
uint32
,
code
Status
)
Write
(
*
WriteIn
,
[]
byte
)
(
written
uint32
,
code
Status
)
Truncate
(
size
uint64
)
Status
Truncate
(
size
uint64
)
Status
...
...
fuse/defaultfile.go
View file @
df9202b8
package
fuse
package
fuse
import
(
import
(
"log"
"os"
"os"
)
)
var
_
=
log
.
Println
func
(
me
*
DefaultFile
)
SetInode
(
*
Inode
)
{
func
(
me
*
DefaultFile
)
SetInode
(
*
Inode
)
{
}
}
func
(
me
*
DefaultFile
)
InnerFile
()
File
{
return
nil
}
func
(
me
*
DefaultFile
)
Read
(
*
ReadIn
,
BufferPool
)
([]
byte
,
Status
)
{
func
(
me
*
DefaultFile
)
Read
(
*
ReadIn
,
BufferPool
)
([]
byte
,
Status
)
{
return
[]
byte
(
""
),
ENOSYS
return
[]
byte
(
""
),
ENOSYS
}
}
...
...
fuse/fsmount.go
View file @
df9202b8
...
@@ -133,7 +133,9 @@ func (me *fileSystemMount) registerFileHandle(node *Inode, dir rawDir, f File, f
...
@@ -133,7 +133,9 @@ func (me *fileSystemMount) registerFileHandle(node *Inode, dir rawDir, f File, f
f
=
withFlags
.
File
f
=
withFlags
.
File
}
}
if
b
.
WithFlags
.
File
!=
nil
{
b
.
WithFlags
.
File
.
SetInode
(
node
)
b
.
WithFlags
.
File
.
SetInode
(
node
)
}
node
.
openFiles
=
append
(
node
.
openFiles
,
b
)
node
.
openFiles
=
append
(
node
.
openFiles
,
b
)
handle
:=
me
.
openFiles
.
Register
(
&
b
.
Handled
,
b
)
handle
:=
me
.
openFiles
.
Register
(
&
b
.
Handled
,
b
)
return
handle
,
b
return
handle
,
b
...
...
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