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
90e49967
Commit
90e49967
authored
Feb 23, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make splice errors more verbose.
parent
fa265b73
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
fuse/splice_linux.go
fuse/splice_linux.go
+2
-2
splice/pair.go
splice/pair.go
+9
-7
No files found.
fuse/splice_linux.go
View file @
90e49967
...
...
@@ -24,8 +24,8 @@ func (ms *MountState) trySplice(header []byte, req *request, fdData *ReadResultF
defer
splice
.
Done
(
pair
)
total
:=
len
(
header
)
+
fdData
.
Size
()
if
!
pair
.
Grow
(
total
)
{
return
fmt
.
Errorf
(
"splice.Grow failed."
)
if
err
:=
pair
.
Grow
(
total
);
err
!=
nil
{
return
err
}
_
,
err
=
pair
.
Write
(
header
)
...
...
splice/pair.go
View file @
90e49967
package
splice
import
(
"fmt"
"os"
)
...
...
@@ -10,27 +11,28 @@ type Pair struct {
}
func
(
p
*
Pair
)
MaxGrow
()
{
for
p
.
Grow
(
2
*
p
.
size
)
{
for
p
.
Grow
(
2
*
p
.
size
)
==
nil
{
}
}
func
(
p
*
Pair
)
Grow
(
n
int
)
bool
{
func
(
p
*
Pair
)
Grow
(
n
int
)
error
{
if
n
<=
p
.
size
{
return
true
return
nil
}
if
!
resizable
{
return
f
alse
return
f
mt
.
Errorf
(
"splice: want %d bytes, but not resizable"
,
n
)
}
if
n
>
maxPipeSize
{
return
f
alse
return
f
mt
.
Errorf
(
"splice: want %d bytes, max pipe size %d"
,
n
,
maxPipeSize
)
}
newsize
,
errNo
:=
fcntl
(
p
.
r
.
Fd
(),
F_SETPIPE_SZ
,
n
)
if
errNo
!=
0
{
return
f
alse
return
f
mt
.
Errorf
(
"splice: fcntl returned %v"
,
errNo
)
}
p
.
size
=
newsize
return
true
return
nil
}
func
(
p
*
Pair
)
Cap
()
int
{
...
...
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