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
9b950aa9
Commit
9b950aa9
authored
Mar 22, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodefs: use S_IFREG (regular file) as default for NodeAttr
parent
804ff7cc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
7 deletions
+11
-7
nodefs/bridge.go
nodefs/bridge.go
+4
-0
nodefs/cache_test.go
nodefs/cache_test.go
+2
-2
nodefs/inode.go
nodefs/inode.go
+2
-1
nodefs/interrupt_test.go
nodefs/interrupt_test.go
+2
-3
nodefs/zip_test.go
nodefs/zip_test.go
+1
-1
No files found.
nodefs/bridge.go
View file @
9b950aa9
...
...
@@ -73,6 +73,10 @@ func (b *rawBridge) newInode(ops Operations, id NodeAttr, persistent bool) *Inod
return
old
}
id
.
Mode
=
id
.
Mode
&^
07777
if
id
.
Mode
==
0
{
id
.
Mode
=
fuse
.
S_IFREG
}
switch
id
.
Mode
{
case
fuse
.
S_IFDIR
:
_
=
ops
.
(
DirOperations
)
...
...
nodefs/cache_test.go
View file @
9b950aa9
...
...
@@ -71,13 +71,13 @@ func (r *keepCacheRoot) OnAdd() {
keepCache
:
true
,
}
f1
.
setContent
(
0
)
i
.
AddChild
(
"keep"
,
i
.
NewInode
(
f1
,
NodeAttr
{
Mode
:
fuse
.
S_IFREG
}),
true
)
i
.
AddChild
(
"keep"
,
i
.
NewInode
(
f1
,
NodeAttr
{}),
true
)
f2
:=
&
keepCacheFile
{
keepCache
:
false
,
}
f2
.
setContent
(
0
)
i
.
AddChild
(
"nokeep"
,
i
.
NewInode
(
f2
,
NodeAttr
{
Mode
:
fuse
.
S_IFREG
}),
true
)
i
.
AddChild
(
"nokeep"
,
i
.
NewInode
(
f2
,
NodeAttr
{}),
true
)
}
func
TestKeepCache
(
t
*
testing
.
T
)
{
...
...
nodefs/inode.go
View file @
9b950aa9
...
...
@@ -23,7 +23,8 @@ type parentData struct {
// NodeAttr holds immutable attributes of a object in the filesystem.
type
NodeAttr
struct
{
// Each Inode has a type, which does not change over the
// lifetime of the inode, for example fuse.S_IFDIR.
// lifetime of the inode, for example fuse.S_IFDIR. The default (0)
// is interpreted as S_IFREG (regular file).
Mode
uint32
// The inode number must be unique among the currently live
...
...
nodefs/interrupt_test.go
View file @
9b950aa9
...
...
@@ -30,9 +30,8 @@ func (r *interruptRoot) Lookup(ctx context.Context, name string, out *fuse.Entry
return
nil
,
fuse
.
ENOENT
}
ch
:=
InodeOf
(
r
)
.
NewInode
(
&
r
.
child
,
NodeAttr
{
Mode
:
fuse
.
S_IFREG
,
Ino
:
2
,
Gen
:
1
})
Ino
:
2
,
Gen
:
1
})
return
ch
,
fuse
.
OK
}
...
...
nodefs/zip_test.go
View file @
9b950aa9
...
...
@@ -189,7 +189,7 @@ func (zr *zipRoot) OnAdd() {
p
=
ch
}
ch
:=
InodeOf
(
zr
)
.
NewPersistentInode
(
&
zipFile
{
file
:
f
},
NodeAttr
{
Mode
:
fuse
.
S_IFREG
})
ch
:=
InodeOf
(
zr
)
.
NewPersistentInode
(
&
zipFile
{
file
:
f
},
NodeAttr
{})
p
.
AddChild
(
base
,
ch
,
true
)
}
}
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