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
Kirill Smelkov
go-fuse
Commits
8d6ddcb2
Commit
8d6ddcb2
authored
Apr 08, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodefs: more renaming
parent
0f2f00b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
25 deletions
+25
-25
nodefs/bridge.go
nodefs/bridge.go
+8
-8
nodefs/inode.go
nodefs/inode.go
+17
-17
No files found.
nodefs/bridge.go
View file @
8d6ddcb2
...
...
@@ -126,9 +126,9 @@ func (b *rawBridge) addNewChild(parent *Inode, name string, child *Inode, file F
fh
=
b
.
registerFile
(
child
,
file
,
fileFlags
)
}
out
.
NodeId
=
child
.
nod
eAttr
.
Ino
out
.
Generation
=
child
.
nod
eAttr
.
Gen
out
.
Attr
.
Ino
=
child
.
nod
eAttr
.
Ino
out
.
NodeId
=
child
.
stabl
eAttr
.
Ino
out
.
Generation
=
child
.
stabl
eAttr
.
Gen
out
.
Attr
.
Ino
=
child
.
stabl
eAttr
.
Ino
b
.
mu
.
Unlock
()
unlockNodes
(
parent
,
child
)
...
...
@@ -406,8 +406,8 @@ func (b *rawBridge) getattr(ctx context.Context, n *Inode, f FileHandle, out *fu
}
if
errno
==
0
{
out
.
Ino
=
n
.
nod
eAttr
.
Ino
out
.
Mode
=
(
out
.
Attr
.
Mode
&
07777
)
|
n
.
nod
eAttr
.
Mode
out
.
Ino
=
n
.
stabl
eAttr
.
Ino
out
.
Mode
=
(
out
.
Attr
.
Mode
&
07777
)
|
n
.
stabl
eAttr
.
Mode
b
.
setAttr
(
&
out
.
Attr
)
b
.
setAttrTimeout
(
out
)
}
...
...
@@ -872,12 +872,12 @@ func (b *rawBridge) ReadDirPlus(cancel <-chan struct{}, input *fuse.ReadIn, out
b
.
addNewChild
(
n
,
e
.
Name
,
child
,
nil
,
0
,
entryOut
)
child
.
setEntryOut
(
entryOut
)
b
.
setEntryOutTimeout
(
entryOut
)
if
(
e
.
Mode
&^
07777
)
!=
(
child
.
nod
eAttr
.
Mode
&^
07777
)
{
if
(
e
.
Mode
&^
07777
)
!=
(
child
.
stabl
eAttr
.
Mode
&^
07777
)
{
// should go back and change the
// already serialized entry
log
.
Panicf
(
"mode mismatch between readdir %o and lookup %o"
,
e
.
Mode
,
child
.
nod
eAttr
.
Mode
)
log
.
Panicf
(
"mode mismatch between readdir %o and lookup %o"
,
e
.
Mode
,
child
.
stabl
eAttr
.
Mode
)
}
entryOut
.
Mode
=
child
.
nod
eAttr
.
Mode
|
(
entryOut
.
Mode
&
07777
)
entryOut
.
Mode
=
child
.
stabl
eAttr
.
Mode
|
(
entryOut
.
Mode
&
07777
)
}
}
...
...
nodefs/inode.go
View file @
8d6ddcb2
...
...
@@ -57,7 +57,7 @@ func (i *StableAttr) Reserved() bool {
// copied. Inodes should be obtained by calling Inode.NewInode() or
// Inode.NewPersistentInode().
type
Inode
struct
{
nod
eAttr
StableAttr
stabl
eAttr
StableAttr
ops
InodeEmbedder
bridge
*
rawBridge
...
...
@@ -97,7 +97,7 @@ type Inode struct {
}
func
(
n
*
Inode
)
IsDir
()
bool
{
return
n
.
nod
eAttr
.
Mode
&
syscall
.
S_IFDIR
!=
0
return
n
.
stabl
eAttr
.
Mode
&
syscall
.
S_IFDIR
!=
0
}
func
(
n
*
Inode
)
embed
()
*
Inode
{
...
...
@@ -110,7 +110,7 @@ func (n *Inode) EmbeddedInode() *Inode {
func
initInode
(
n
*
Inode
,
ops
InodeEmbedder
,
attr
StableAttr
,
bridge
*
rawBridge
,
persistent
bool
)
{
n
.
ops
=
ops
n
.
nod
eAttr
=
attr
n
.
stabl
eAttr
=
attr
n
.
bridge
=
bridge
n
.
persistent
=
persistent
n
.
parents
=
make
(
map
[
parentData
]
struct
{})
...
...
@@ -121,19 +121,19 @@ func initInode(n *Inode, ops InodeEmbedder, attr StableAttr, bridge *rawBridge,
// Set node ID and mode in EntryOut
func
(
n
*
Inode
)
setEntryOut
(
out
*
fuse
.
EntryOut
)
{
out
.
NodeId
=
n
.
nod
eAttr
.
Ino
out
.
Ino
=
n
.
nod
eAttr
.
Ino
out
.
Mode
=
(
out
.
Attr
.
Mode
&
07777
)
|
n
.
nod
eAttr
.
Mode
out
.
NodeId
=
n
.
stabl
eAttr
.
Ino
out
.
Ino
=
n
.
stabl
eAttr
.
Ino
out
.
Mode
=
(
out
.
Attr
.
Mode
&
07777
)
|
n
.
stabl
eAttr
.
Mode
}
// StableAttr returns the (Ino, Gen) tuple for this node.
func
(
n
*
Inode
)
StableAttr
()
Nod
eAttr
{
return
n
.
nod
eAttr
func
(
n
*
Inode
)
StableAttr
()
Stabl
eAttr
{
return
n
.
stabl
eAttr
}
// Mode returns the filetype
func
(
n
*
Inode
)
Mode
()
uint32
{
return
n
.
nod
eAttr
.
Mode
return
n
.
stabl
eAttr
.
Mode
}
// Returns the root of the tree
...
...
@@ -159,10 +159,10 @@ func (n *Inode) String() string {
defer
n
.
mu
.
Unlock
()
var
ss
[]
string
for
nm
,
ch
:=
range
n
.
children
{
ss
=
append
(
ss
,
fmt
.
Sprintf
(
"%q=%d[%s]"
,
nm
,
ch
.
nodeAttr
.
Ino
,
modeStr
(
ch
.
nod
eAttr
.
Mode
)))
ss
=
append
(
ss
,
fmt
.
Sprintf
(
"%q=%d[%s]"
,
nm
,
ch
.
stableAttr
.
Ino
,
modeStr
(
ch
.
stabl
eAttr
.
Mode
)))
}
return
fmt
.
Sprintf
(
"%d[%s]: %s"
,
n
.
nodeAttr
.
Ino
,
modeStr
(
n
.
nod
eAttr
.
Mode
),
strings
.
Join
(
ss
,
","
))
return
fmt
.
Sprintf
(
"%d[%s]: %s"
,
n
.
stableAttr
.
Ino
,
modeStr
(
n
.
stabl
eAttr
.
Mode
),
strings
.
Join
(
ss
,
","
))
}
// sortNodes rearranges inode group in consistent order.
...
...
@@ -391,7 +391,7 @@ retry:
}
n
.
bridge
.
mu
.
Lock
()
delete
(
n
.
bridge
.
nodes
,
n
.
nod
eAttr
.
Ino
)
delete
(
n
.
bridge
.
nodes
,
n
.
stabl
eAttr
.
Ino
)
n
.
bridge
.
mu
.
Unlock
()
unlockNodes
(
lockme
...
)
...
...
@@ -686,7 +686,7 @@ retry:
// tuple should be invalidated. On next access, a LOOKUP operation
// will be started.
func
(
n
*
Inode
)
NotifyEntry
(
name
string
)
syscall
.
Errno
{
status
:=
n
.
bridge
.
server
.
EntryNotify
(
n
.
nod
eAttr
.
Ino
,
name
)
status
:=
n
.
bridge
.
server
.
EntryNotify
(
n
.
stabl
eAttr
.
Ino
,
name
)
return
syscall
.
Errno
(
status
)
}
...
...
@@ -695,7 +695,7 @@ func (n *Inode) NotifyEntry(name string) syscall.Errno {
// to NotifyEntry, but also sends an event to inotify watchers.
func
(
n
*
Inode
)
NotifyDelete
(
name
string
,
child
*
Inode
)
syscall
.
Errno
{
// XXX arg ordering?
return
syscall
.
Errno
(
n
.
bridge
.
server
.
DeleteNotify
(
n
.
nodeAttr
.
Ino
,
child
.
nod
eAttr
.
Ino
,
name
))
return
syscall
.
Errno
(
n
.
bridge
.
server
.
DeleteNotify
(
n
.
stableAttr
.
Ino
,
child
.
stabl
eAttr
.
Ino
,
name
))
}
...
...
@@ -703,16 +703,16 @@ func (n *Inode) NotifyDelete(name string, child *Inode) syscall.Errno {
// inode should be flushed from buffers.
func
(
n
*
Inode
)
NotifyContent
(
off
,
sz
int64
)
syscall
.
Errno
{
// XXX how does this work for directories?
return
syscall
.
Errno
(
n
.
bridge
.
server
.
InodeNotify
(
n
.
nod
eAttr
.
Ino
,
off
,
sz
))
return
syscall
.
Errno
(
n
.
bridge
.
server
.
InodeNotify
(
n
.
stabl
eAttr
.
Ino
,
off
,
sz
))
}
// WriteCache stores data in the kernel cache.
func
(
n
*
Inode
)
WriteCache
(
offset
int64
,
data
[]
byte
)
syscall
.
Errno
{
return
syscall
.
Errno
(
n
.
bridge
.
server
.
InodeNotifyStoreCache
(
n
.
nod
eAttr
.
Ino
,
offset
,
data
))
return
syscall
.
Errno
(
n
.
bridge
.
server
.
InodeNotifyStoreCache
(
n
.
stabl
eAttr
.
Ino
,
offset
,
data
))
}
// ReadCache reads data from the kernel cache.
func
(
n
*
Inode
)
ReadCache
(
offset
int64
,
dest
[]
byte
)
(
count
int
,
errno
syscall
.
Errno
)
{
c
,
s
:=
n
.
bridge
.
server
.
InodeRetrieveCache
(
n
.
nod
eAttr
.
Ino
,
offset
,
dest
)
c
,
s
:=
n
.
bridge
.
server
.
InodeRetrieveCache
(
n
.
stabl
eAttr
.
Ino
,
offset
,
dest
)
return
c
,
syscall
.
Errno
(
s
)
}
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