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
6df8ddc4
Commit
6df8ddc4
authored
Oct 11, 2018
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fuse/nodefs: fix some lint errors
parent
974f4cad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
21 deletions
+21
-21
fuse/nodefs/fsconnector.go
fuse/nodefs/fsconnector.go
+20
-20
fuse/nodefs/fuse.go
fuse/nodefs/fuse.go
+1
-1
No files found.
fuse/nodefs/fsconnector.go
View file @
6df8ddc4
...
...
@@ -371,17 +371,17 @@ func (c *FileSystemConnector) Unmount(node *Inode) fuse.Status {
// Use negative offset for metadata-only invalidation, and zero-length
// for invalidating all content.
func
(
c
*
FileSystemConnector
)
FileNotify
(
node
*
Inode
,
off
int64
,
length
int64
)
fuse
.
Status
{
var
nI
d
uint64
var
nI
D
uint64
if
node
==
c
.
rootNode
{
nI
d
=
fuse
.
FUSE_ROOT_ID
nI
D
=
fuse
.
FUSE_ROOT_ID
}
else
{
nI
d
=
c
.
inodeMap
.
Handle
(
&
node
.
handled
)
nI
D
=
c
.
inodeMap
.
Handle
(
&
node
.
handled
)
}
if
nI
d
==
0
{
if
nI
D
==
0
{
return
fuse
.
OK
}
return
c
.
server
.
InodeNotify
(
nI
d
,
off
,
length
)
return
c
.
server
.
InodeNotify
(
nI
D
,
off
,
length
)
}
// FileNotifyStoreCache notifies the kernel about changed data of the inode.
...
...
@@ -394,17 +394,17 @@ func (c *FileSystemConnector) FileNotify(node *Inode, off int64, length int64) f
// in corresponding data region. After kernel's cache data is evicted, the kernel
// will have to issue new Read calls on user request to get data content.
func
(
c
*
FileSystemConnector
)
FileNotifyStoreCache
(
node
*
Inode
,
off
int64
,
data
[]
byte
)
fuse
.
Status
{
var
nI
d
uint64
var
nI
D
uint64
if
node
==
c
.
rootNode
{
nI
d
=
fuse
.
FUSE_ROOT_ID
nI
D
=
fuse
.
FUSE_ROOT_ID
}
else
{
nI
d
=
c
.
inodeMap
.
Handle
(
&
node
.
handled
)
nI
D
=
c
.
inodeMap
.
Handle
(
&
node
.
handled
)
}
if
nI
d
==
0
{
if
nI
D
==
0
{
return
fuse
.
EINVAL
}
return
c
.
server
.
InodeNotifyStoreCache
(
nI
d
,
off
,
data
)
return
c
.
server
.
InodeNotifyStoreCache
(
nI
D
,
off
,
data
)
}
// EntryNotify makes the kernel forget the entry data from the given
...
...
@@ -412,36 +412,36 @@ func (c *FileSystemConnector) FileNotifyStoreCache(node *Inode, off int64, data
// new lookup request for the given name when necessary. No filesystem
// related locks should be held when calling this.
func
(
c
*
FileSystemConnector
)
EntryNotify
(
node
*
Inode
,
name
string
)
fuse
.
Status
{
var
nI
d
uint64
var
nI
D
uint64
if
node
==
c
.
rootNode
{
nI
d
=
fuse
.
FUSE_ROOT_ID
nI
D
=
fuse
.
FUSE_ROOT_ID
}
else
{
nI
d
=
c
.
inodeMap
.
Handle
(
&
node
.
handled
)
nI
D
=
c
.
inodeMap
.
Handle
(
&
node
.
handled
)
}
if
nI
d
==
0
{
if
nI
D
==
0
{
return
fuse
.
OK
}
return
c
.
server
.
EntryNotify
(
nI
d
,
name
)
return
c
.
server
.
EntryNotify
(
nI
D
,
name
)
}
// DeleteNotify signals to the kernel that the named entry in dir for
// the child disappeared. No filesystem related locks should be held
// when calling this.
func
(
c
*
FileSystemConnector
)
DeleteNotify
(
dir
*
Inode
,
child
*
Inode
,
name
string
)
fuse
.
Status
{
var
nI
d
uint64
var
nI
D
uint64
if
dir
==
c
.
rootNode
{
nI
d
=
fuse
.
FUSE_ROOT_ID
nI
D
=
fuse
.
FUSE_ROOT_ID
}
else
{
nI
d
=
c
.
inodeMap
.
Handle
(
&
dir
.
handled
)
nI
D
=
c
.
inodeMap
.
Handle
(
&
dir
.
handled
)
}
if
nI
d
==
0
{
if
nI
D
==
0
{
return
fuse
.
OK
}
chId
:=
c
.
inodeMap
.
Handle
(
&
child
.
handled
)
return
c
.
server
.
DeleteNotify
(
nI
d
,
chId
,
name
)
return
c
.
server
.
DeleteNotify
(
nI
D
,
chId
,
name
)
}
fuse/nodefs/fuse.go
View file @
6df8ddc4
...
...
@@ -8,7 +8,7 @@ import (
"github.com/hanwen/go-fuse/fuse"
)
// Mounts a filesystem with the given root node on the given directory.
// Mount
Root mount
s a filesystem with the given root node on the given directory.
// Convenience wrapper around fuse.NewServer
func
MountRoot
(
mountpoint
string
,
root
Node
,
opts
*
Options
)
(
*
fuse
.
Server
,
*
FileSystemConnector
,
error
)
{
conn
:=
NewFileSystemConnector
(
root
,
opts
)
...
...
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