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
e98b6688
Commit
e98b6688
authored
May 26, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug: don't use cap() for max dirlist size, since we may use a
larger buffer.
parent
20b92a9a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
fuse/direntry.go
fuse/direntry.go
+3
-1
No files found.
fuse/direntry.go
View file @
e98b6688
...
...
@@ -23,12 +23,14 @@ type DirEntry struct {
type
DirEntryList
struct
{
buf
[]
byte
size
int
offset
uint64
}
func
NewDirEntryList
(
data
[]
byte
,
off
uint64
)
*
DirEntryList
{
return
&
DirEntryList
{
buf
:
data
[
:
0
],
size
:
len
(
data
),
offset
:
off
,
}
}
...
...
@@ -43,7 +45,7 @@ func (l *DirEntryList) Add(name string, inode uint64, mode uint32) bool {
oldLen
:=
len
(
l
.
buf
)
newLen
:=
delta
+
oldLen
if
newLen
>
cap
(
l
.
buf
)
{
if
newLen
>
l
.
size
{
return
false
}
l
.
buf
=
l
.
buf
[
:
newLen
]
...
...
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