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
1b34b381
Commit
1b34b381
authored
May 22, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test for read buffers too.
parent
9a0103bf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
fuse/mountstate.go
fuse/mountstate.go
+9
-5
fuse/pressure_test.go
fuse/pressure_test.go
+6
-3
No files found.
fuse/mountstate.go
View file @
1b34b381
...
...
@@ -41,6 +41,7 @@ type MountState struct {
reqPool
[]
*
request
readPool
[][]
byte
reqReaders
int
outstandingReadBufs
int
}
func
(
ms
*
MountState
)
KernelSettings
()
raw
.
InitIn
{
...
...
@@ -168,6 +169,7 @@ func (ms *MountState) readRequest() (req *request, code Status) {
}
else
{
dest
=
make
([]
byte
,
ms
.
opts
.
MaxWrite
+
4096
)
}
ms
.
outstandingReadBufs
++
ms
.
reqReaders
++
ms
.
reqMu
.
Unlock
()
...
...
@@ -185,6 +187,7 @@ func (ms *MountState) readRequest() (req *request, code Status) {
ms
.
reqMu
.
Lock
()
if
!
gobbled
{
ms
.
outstandingReadBufs
--
ms
.
readPool
=
append
(
ms
.
readPool
,
dest
)
dest
=
nil
}
...
...
@@ -206,6 +209,7 @@ func (ms *MountState) returnRequest(req *request) {
ms
.
reqMu
.
Lock
()
if
req
.
bufferPoolOutputBuf
!=
nil
{
ms
.
readPool
=
append
(
ms
.
readPool
,
req
.
bufferPoolInputBuf
)
ms
.
outstandingReadBufs
--
req
.
bufferPoolInputBuf
=
nil
}
ms
.
reqPool
=
append
(
ms
.
reqPool
,
req
)
...
...
fuse/pressure_test.go
View file @
1b34b381
...
...
@@ -58,9 +58,12 @@ func TestMemoryPressure(t *testing.T) {
}(
i
)
}
time
.
Sleep
(
100
*
time
.
Millisecond
)
created
:=
state
.
buffers
.
createdBuffers
created
:=
state
.
buffers
.
createdBuffers
+
state
.
outstandingReadBufs
t
.
Logf
(
"Have %d read bufs"
,
state
.
outstandingReadBufs
)
if
created
>
2
*
_MAX_READERS
{
t
.
Errorf
(
"created %d buffers, max reader %d"
,
created
,
_MAX_READERS
)
}
wg
.
Wait
()
}
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