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
0f68fcc4
Commit
0f68fcc4
authored
Apr 08, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodefs: add Attr to MemSymlink
parent
7572e9d8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
nodefs/mem.go
nodefs/mem.go
+11
-1
No files found.
nodefs/mem.go
View file @
0f68fcc4
...
@@ -13,6 +13,7 @@ import (
...
@@ -13,6 +13,7 @@ import (
// MemRegularFile is a filesystem node that holds a read-only data
// MemRegularFile is a filesystem node that holds a read-only data
// slice in memory.
// slice in memory.
type
MemRegularFile
struct
{
type
MemRegularFile
struct
{
Inode
Inode
Data
[]
byte
Data
[]
byte
...
@@ -20,7 +21,6 @@ type MemRegularFile struct {
...
@@ -20,7 +21,6 @@ type MemRegularFile struct {
}
}
var
_
=
(
Opener
)((
*
MemRegularFile
)(
nil
))
var
_
=
(
Opener
)((
*
MemRegularFile
)(
nil
))
var
_
=
(
Getattrer
)((
*
MemRegularFile
)(
nil
))
var
_
=
(
Reader
)((
*
MemRegularFile
)(
nil
))
var
_
=
(
Reader
)((
*
MemRegularFile
)(
nil
))
var
_
=
(
Flusher
)((
*
MemRegularFile
)(
nil
))
var
_
=
(
Flusher
)((
*
MemRegularFile
)(
nil
))
...
@@ -32,6 +32,8 @@ func (f *MemRegularFile) Open(ctx context.Context, flags uint32) (fh FileHandle,
...
@@ -32,6 +32,8 @@ func (f *MemRegularFile) Open(ctx context.Context, flags uint32) (fh FileHandle,
return
nil
,
fuse
.
FOPEN_KEEP_CACHE
,
OK
return
nil
,
fuse
.
FOPEN_KEEP_CACHE
,
OK
}
}
var
_
=
(
Getattrer
)((
*
MemRegularFile
)(
nil
))
func
(
f
*
MemRegularFile
)
Getattr
(
ctx
context
.
Context
,
fh
FileHandle
,
out
*
fuse
.
AttrOut
)
syscall
.
Errno
{
func
(
f
*
MemRegularFile
)
Getattr
(
ctx
context
.
Context
,
fh
FileHandle
,
out
*
fuse
.
AttrOut
)
syscall
.
Errno
{
out
.
Attr
=
f
.
Attr
out
.
Attr
=
f
.
Attr
out
.
Attr
.
Size
=
uint64
(
len
(
f
.
Data
))
out
.
Attr
.
Size
=
uint64
(
len
(
f
.
Data
))
...
@@ -53,6 +55,7 @@ func (f *MemRegularFile) Read(ctx context.Context, fh FileHandle, dest []byte, o
...
@@ -53,6 +55,7 @@ func (f *MemRegularFile) Read(ctx context.Context, fh FileHandle, dest []byte, o
// MemSymlink is an inode holding a symlink in memory.
// MemSymlink is an inode holding a symlink in memory.
type
MemSymlink
struct
{
type
MemSymlink
struct
{
Inode
Inode
Attr
fuse
.
Attr
Data
[]
byte
Data
[]
byte
}
}
...
@@ -61,3 +64,10 @@ var _ = (Readlinker)((*MemSymlink)(nil))
...
@@ -61,3 +64,10 @@ var _ = (Readlinker)((*MemSymlink)(nil))
func
(
l
*
MemSymlink
)
Readlink
(
ctx
context
.
Context
)
([]
byte
,
syscall
.
Errno
)
{
func
(
l
*
MemSymlink
)
Readlink
(
ctx
context
.
Context
)
([]
byte
,
syscall
.
Errno
)
{
return
l
.
Data
,
OK
return
l
.
Data
,
OK
}
}
var
_
=
(
Getattrer
)((
*
MemSymlink
)(
nil
))
func
(
l
*
MemSymlink
)
Getattr
(
ctx
context
.
Context
,
fh
FileHandle
,
out
*
fuse
.
AttrOut
)
syscall
.
Errno
{
out
.
Attr
=
l
.
Attr
return
OK
}
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