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
c44d05f4
Commit
c44d05f4
authored
Sep 08, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reinstate debug info for paths and filehandles.
parent
62dac3a2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
9 deletions
+35
-9
fuse/api.go
fuse/api.go
+5
-1
fuse/cache_test.go
fuse/cache_test.go
+1
-1
fuse/fsmount.go
fuse/fsmount.go
+13
-4
fuse/fsops.go
fuse/fsops.go
+2
-1
fuse/pathfs.go
fuse/pathfs.go
+14
-2
No files found.
fuse/api.go
View file @
c44d05f4
...
...
@@ -153,10 +153,14 @@ type File interface {
Fsync
(
*
FsyncIn
)
(
code
Status
)
}
// Wrap a File return in this to set FUSE flags.
// Wrap a File return in this to set FUSE flags. Also used internally
// to store open file data.
type
WithFlags
struct
{
File
// For debugging.
Description
string
// Put FOPEN_* flags here.
FuseFlags
uint32
...
...
fuse/cache_test.go
View file @
c44d05f4
...
...
@@ -73,7 +73,7 @@ func TestCacheFs(t *testing.T) {
CheckSuccess
(
err
)
if
string
(
c
)
!=
"hello"
{
t
.
Fatalf
(
"expect 'hello' %q"
,
string
(
c
))
t
.
Fatalf
(
"
Page cache skipped:
expect 'hello' %q"
,
string
(
c
))
}
code
:=
pathfs
.
EntryNotify
(
""
,
"file.txt"
)
...
...
fuse/fsmount.go
View file @
c44d05f4
...
...
@@ -78,6 +78,9 @@ func (me *fileSystemMount) fileInfoToAttr(fi *os.FileInfo, out *AttrOut) {
func
(
me
*
FileSystemConnector
)
getOpenedFile
(
h
uint64
)
*
openedFile
{
b
:=
(
*
openedFile
)(
unsafe
.
Pointer
(
DecodeHandle
(
h
)))
if
me
.
Debug
{
log
.
Printf
(
"File %d = %s"
,
h
,
b
.
WithFlags
.
Description
)
}
return
b
}
...
...
@@ -112,10 +115,16 @@ func (me *fileSystemMount) registerFileHandle(node *Inode, dir rawDir, f File, f
OpenFlags
:
flags
,
},
}
withFlags
,
ok
:=
f
.
(
*
WithFlags
)
if
ok
{
b
.
WithFlags
.
FuseFlags
=
withFlags
.
FuseFlags
b
.
WithFlags
.
File
=
withFlags
.
File
for
{
withFlags
,
ok
:=
f
.
(
*
WithFlags
)
if
!
ok
{
break
}
b
.
WithFlags
.
FuseFlags
|=
withFlags
.
FuseFlags
b
.
WithFlags
.
Description
+=
withFlags
.
Description
f
=
withFlags
.
File
}
node
.
openFiles
=
append
(
node
.
openFiles
,
b
)
...
...
fuse/fsops.go
View file @
c44d05f4
...
...
@@ -174,7 +174,8 @@ func (me *FileSystemConnector) Open(header *InHeader, input *OpenIn) (flags uint
func
(
me
*
FileSystemConnector
)
SetAttr
(
header
*
InHeader
,
input
*
SetAttrIn
)
(
out
*
AttrOut
,
code
Status
)
{
var
f
File
if
input
.
Valid
&
FATTR_FH
!=
0
{
me
.
getOpenedFile
(
input
.
Fh
)
opened
:=
me
.
getOpenedFile
(
input
.
Fh
)
f
=
opened
.
WithFlags
.
File
}
node
:=
me
.
getInodeData
(
header
.
NodeId
)
...
...
fuse/pathfs.go
View file @
c44d05f4
...
...
@@ -164,7 +164,12 @@ func (me *pathInode) GetPath() (path string) {
if
n
!=
me
.
ifs
.
root
{
return
".deleted"
}
return
ReverseJoin
(
rev_components
,
"/"
)
p
:=
ReverseJoin
(
rev_components
,
"/"
)
if
me
.
ifs
.
Debug
{
log
.
Printf
(
"Inode %d = %q"
,
me
.
Inode
()
.
nodeId
,
p
)
}
return
p
}
func
(
me
*
pathInode
)
AddChild
(
name
string
,
child
FsNode
)
{
...
...
@@ -379,7 +384,14 @@ func (me *pathInode) createChild(name string) *pathInode {
}
func
(
me
*
pathInode
)
Open
(
flags
uint32
,
context
*
Context
)
(
file
File
,
code
Status
)
{
return
me
.
fs
.
Open
(
me
.
GetPath
(),
flags
,
context
)
file
,
code
=
me
.
fs
.
Open
(
me
.
GetPath
(),
flags
,
context
)
if
me
.
ifs
.
Debug
{
file
=
&
WithFlags
{
File
:
file
,
Description
:
me
.
GetPath
(),
}
}
return
}
func
(
me
*
pathInode
)
Lookup
(
name
string
,
context
*
Context
)
(
fi
*
os
.
FileInfo
,
node
FsNode
,
code
Status
)
{
...
...
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