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
8bd60ffd
Commit
8bd60ffd
authored
Nov 17, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use log.Panicf rather than panic(fmt.Sprintf()).
parent
3936f28c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
15 deletions
+13
-15
fuse/fsconnector.go
fuse/fsconnector.go
+2
-3
fuse/inode.go
fuse/inode.go
+9
-10
fuse/misc.go
fuse/misc.go
+1
-1
fuse/mount.go
fuse/mount.go
+1
-1
No files found.
fuse/fsconnector.go
View file @
8bd60ffd
...
...
@@ -5,7 +5,6 @@ package fuse
// are in fsops.go
import
(
"fmt"
"log"
"os"
"path/filepath"
...
...
@@ -134,7 +133,7 @@ func (me *FileSystemConnector) forgetUpdate(node *Inode, forgetCount int) {
me
.
inodeMap
.
Forget
(
node
.
nodeId
)
node
.
nodeId
=
0
}
else
if
node
.
lookupCount
<
0
{
panic
(
fmt
.
Sprintf
(
"lookupCount underflow: %d: %v"
,
node
.
lookupCount
,
me
)
)
log
.
Panicf
(
"lookupCount underflow: %d: %v"
,
node
.
lookupCount
,
me
)
}
me
.
recursiveConsiderDropInode
(
node
)
...
...
@@ -159,7 +158,7 @@ func (me *FileSystemConnector) recursiveConsiderDropInode(n *Inode) (drop bool)
for
_
,
k
:=
range
delChildren
{
ch
:=
n
.
rmChild
(
k
)
if
ch
==
nil
{
panic
(
fmt
.
Sprintf
(
"trying to del child %q, but not present"
,
k
)
)
log
.
Panicf
(
"trying to del child %q, but not present"
,
k
)
}
// TODO - change name? This does not really mark the
// fuse Forget operation.
...
...
fuse/inode.go
View file @
8bd60ffd
package
fuse
import
(
"fmt"
"log"
"sync"
)
...
...
@@ -167,7 +166,7 @@ func (me *Inode) addChild(name string, child *Inode) {
if
paranoia
{
ch
:=
me
.
children
[
name
]
if
ch
!=
nil
{
panic
(
fmt
.
Sprintf
(
"Already have an Inode with same name: %v: %v"
,
name
,
ch
)
)
log
.
Panicf
(
"Already have an Inode with same name: %v: %v"
,
name
,
ch
)
}
}
me
.
children
[
name
]
=
child
...
...
@@ -229,31 +228,31 @@ const initDirSize = 20
func
(
me
*
Inode
)
verify
(
cur
*
fileSystemMount
)
{
if
me
.
lookupCount
<
0
{
panic
(
fmt
.
Sprintf
(
"negative lookup count %d on node %d"
,
me
.
lookupCount
,
me
.
nodeId
)
)
log
.
Panicf
(
"negative lookup count %d on node %d"
,
me
.
lookupCount
,
me
.
nodeId
)
}
if
(
me
.
lookupCount
==
0
)
!=
(
me
.
nodeId
==
0
)
{
panic
(
"kernel registration mismatch"
)
log
.
Panicf
(
"kernel registration mismatch: lookup %d id %d"
,
me
.
lookupCount
,
me
.
nodeId
)
}
if
me
.
mountPoint
!=
nil
{
if
me
!=
me
.
mountPoint
.
mountInode
{
panic
(
"mountpoint mismatch"
)
log
.
Panicf
(
"mountpoint mismatch %v %v"
,
me
,
me
.
mountPoint
.
mountInode
)
}
cur
=
me
.
mountPoint
}
if
me
.
mount
!=
cur
{
panic
(
fmt
.
Sprintf
(
"me.mount not set correctly %v %v"
,
me
.
mount
,
cur
)
)
log
.
Panicf
(
"me.mount not set correctly %v %v"
,
me
.
mount
,
cur
)
}
for
name
,
m
:=
range
me
.
mounts
{
if
m
.
mountInode
!=
me
.
children
[
name
]
{
panic
(
fmt
.
Sprint
f
(
"mountpoint parent mismatch: node:%v name:%v ch:%v"
,
me
.
mountPoint
,
name
,
me
.
children
)
)
log
.
Panic
f
(
"mountpoint parent mismatch: node:%v name:%v ch:%v"
,
me
.
mountPoint
,
name
,
me
.
children
)
}
}
for
_
,
ch
:=
range
me
.
children
{
for
n
,
ch
:=
range
me
.
children
{
if
ch
==
nil
{
panic
(
"Found nil child."
)
log
.
Panicf
(
"Found nil child: %q"
,
n
)
}
ch
.
verify
(
cur
)
}
...
...
fuse/misc.go
View file @
8bd60ffd
...
...
@@ -115,7 +115,7 @@ func ModeToType(mode uint32) uint32 {
func
CheckSuccess
(
e
error
)
{
if
e
!=
nil
{
panic
(
fmt
.
Sprintf
(
"Unexpected error: %v"
,
e
)
)
log
.
Panicf
(
"Unexpected error: %v"
,
e
)
}
}
...
...
fuse/mount.go
View file @
8bd60ffd
...
...
@@ -26,7 +26,7 @@ func Socketpair(network string) (l, r *os.File, err error) {
domain
=
syscall
.
AF_UNIX
typ
=
syscall
.
SOCK_SEQPACKET
default
:
panic
(
"unknown network "
+
network
)
log
.
Panicf
(
"unknown network %q"
,
network
)
}
fd
,
errno
:=
syscall
.
Socketpair
(
domain
,
typ
,
0
)
if
errno
!=
0
{
...
...
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