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
22c2700d
Commit
22c2700d
authored
Mar 28, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gofmt.
parent
ac9c5fa8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
16 deletions
+16
-16
example/bulkstat/bulkstat.go
example/bulkstat/bulkstat.go
+1
-1
example/zipfs/zipfs.go
example/zipfs/zipfs.go
+1
-1
fuse/fuse.go
fuse/fuse.go
+1
-1
fuse/loopback_test.go
fuse/loopback_test.go
+1
-1
fuse/pathfilesystem.go
fuse/pathfilesystem.go
+12
-12
No files found.
example/bulkstat/bulkstat.go
View file @
22c2700d
...
...
@@ -77,7 +77,7 @@ func BulkStat(parallelism int, files []string) float64 {
}
allEnd
:=
time
.
Nanoseconds
()
avg
:=
total
/
float64
(
len
(
files
))
avg
:=
total
/
float64
(
len
(
files
))
fmt
.
Printf
(
"Elapsed: %f sec. Average stat %f ms
\n
"
,
float64
(
allEnd
-
allStart
)
*
1e-9
,
avg
)
...
...
example/zipfs/zipfs.go
View file @
22c2700d
...
...
@@ -37,6 +37,6 @@ func main() {
fuse
.
PrintMap
(
latency
)
counts
:=
state
.
OperationCounts
()
fmt
.
Println
(
"Counts: "
,
counts
)
fmt
.
Println
(
"Memory stats"
,
state
.
Stats
())
}
fuse/fuse.go
View file @
22c2700d
...
...
@@ -390,7 +390,7 @@ func (me *MountState) dispatch(req *fuseRequest) {
if
h
.
Opcode
==
FUSE_RENAME
{
nm
=
"n: '"
+
string
(
data
)
+
"'"
}
log
.
Printf
(
"Dispatch: %v, NodeId: %v %s
\n
"
,
operationName
(
h
.
Opcode
),
h
.
NodeId
,
nm
)
}
...
...
fuse/loopback_test.go
View file @
22c2700d
...
...
@@ -40,7 +40,7 @@ type testCase struct {
func
(
me
*
testCase
)
Setup
(
t
*
testing
.
T
)
{
me
.
tester
=
t
paranoia
=
true
const
name
string
=
"hello.txt"
const
subdir
string
=
"subdir"
...
...
fuse/pathfilesystem.go
View file @
22c2700d
...
...
@@ -53,7 +53,7 @@ const initDirSize = 20
func
(
me
*
inode
)
verify
()
{
if
!
(
me
.
NodeId
==
FUSE_ROOT_ID
||
me
.
LookupCount
>
0
||
len
(
me
.
Children
)
>
0
)
{
panic
(
fmt
.
Sprintf
(
"node should be dead: %v"
,
me
))
panic
(
fmt
.
Sprintf
(
"node should be dead: %v"
,
me
))
}
for
n
,
ch
:=
range
me
.
Children
{
if
ch
==
nil
{
...
...
@@ -89,7 +89,7 @@ func (me *inode) GetPath() (path string, mount *mountData) {
}
components
:=
make
([]
string
,
len
(
rev_components
))
for
i
,
v
:=
range
rev_components
{
components
[
len
(
rev_components
)
-
i
-
1
]
=
v
components
[
len
(
rev_components
)
-
i
-
1
]
=
v
}
fullPath
:=
strings
.
Join
(
components
,
"/"
)
return
fullPath
,
mount
...
...
@@ -136,13 +136,13 @@ type PathFileSystemConnectorOptions struct {
type
PathFileSystemConnector
struct
{
DefaultRawFuseFileSystem
// Protects the hashmap, its contents and the nextFreeInode counter.
lock
sync
.
RWMutex
// Invariants: see the verify() method.
inodeMap
map
[
uint64
]
*
inode
nextFreeInode
uint64
inodeMap
map
[
uint64
]
*
inode
nextFreeInode
uint64
options
PathFileSystemConnectorOptions
Debug
bool
...
...
@@ -164,15 +164,15 @@ func (me *PathFileSystemConnector) newInode() *inode {
data
:=
new
(
inode
)
data
.
NodeId
=
me
.
nextFreeInode
me
.
nextFreeInode
++
me
.
inodeMap
[
data
.
NodeId
]
=
data
return
data
}
func
(
me
*
PathFileSystemConnector
)
lookupUpdate
(
parent
*
inode
,
name
string
,
isDir
bool
)
*
inode
{
defer
me
.
verify
()
me
.
lock
.
Lock
()
defer
me
.
lock
.
Unlock
()
...
...
@@ -281,7 +281,7 @@ func NewPathFileSystemConnector(fs PathFilesystem) (out *PathFileSystemConnector
rootData
.
NodeId
=
FUSE_ROOT_ID
rootData
.
Type
=
ModeToType
(
S_IFDIR
)
rootData
.
Children
=
make
(
map
[
string
]
*
inode
,
initDirSize
)
out
.
options
.
NegativeTimeout
=
0.0
out
.
options
.
AttrTimeout
=
1.0
out
.
options
.
EntryTimeout
=
1.0
...
...
@@ -291,7 +291,7 @@ func NewPathFileSystemConnector(fs PathFilesystem) (out *PathFileSystemConnector
}
out
.
verify
()
return
out
}
...
...
@@ -418,10 +418,10 @@ func (me *PathFileSystemConnector) internalLookup(parent *inode, name string, lo
return
nil
,
err
}
data
:=
me
.
lookupUpdate
(
parent
,
name
,
attr
.
Mode
&
S_IFDIR
!=
0
)
data
:=
me
.
lookupUpdate
(
parent
,
name
,
attr
.
Mode
&
S_IFDIR
!=
0
)
data
.
LookupCount
+=
lookupCount
data
.
Type
=
ModeToType
(
attr
.
Mode
)
out
=
new
(
EntryOut
)
out
.
NodeId
=
data
.
NodeId
out
.
Generation
=
1
// where to get the generation?
...
...
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