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
3dce6f5d
Commit
3dce6f5d
authored
Apr 22, 2015
by
Frederick Akalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increment generation on inode reuse
parent
92a4cb63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
fuse/nodefs/handle.go
fuse/nodefs/handle.go
+6
-3
No files found.
fuse/nodefs/handle.go
View file @
3dce6f5d
...
@@ -45,9 +45,10 @@ const _ALREADY_MSG = "Object already has a handle"
...
@@ -45,9 +45,10 @@ const _ALREADY_MSG = "Object already has a handle"
type
portableHandleMap
struct
{
type
portableHandleMap
struct
{
sync
.
RWMutex
sync
.
RWMutex
used
int
generation
uint64
handles
[]
*
handled
used
int
freeIds
[]
uint64
handles
[]
*
handled
freeIds
[]
uint64
}
}
func
newPortableHandleMap
()
*
portableHandleMap
{
func
newPortableHandleMap
()
*
portableHandleMap
{
...
@@ -70,6 +71,7 @@ func (m *portableHandleMap) Register(obj *handled) (handle, generation uint64) {
...
@@ -70,6 +71,7 @@ func (m *portableHandleMap) Register(obj *handled) (handle, generation uint64) {
}
else
{
}
else
{
handle
=
m
.
freeIds
[
len
(
m
.
freeIds
)
-
1
]
handle
=
m
.
freeIds
[
len
(
m
.
freeIds
)
-
1
]
m
.
freeIds
=
m
.
freeIds
[
:
len
(
m
.
freeIds
)
-
1
]
m
.
freeIds
=
m
.
freeIds
[
:
len
(
m
.
freeIds
)
-
1
]
m
.
generation
++
m
.
handles
[
handle
]
=
obj
m
.
handles
[
handle
]
=
obj
}
}
m
.
used
++
m
.
used
++
...
@@ -78,6 +80,7 @@ func (m *portableHandleMap) Register(obj *handled) (handle, generation uint64) {
...
@@ -78,6 +80,7 @@ func (m *portableHandleMap) Register(obj *handled) (handle, generation uint64) {
handle
=
obj
.
handle
handle
=
obj
.
handle
}
}
obj
.
count
++
obj
.
count
++
generation
=
m
.
generation
m
.
Unlock
()
m
.
Unlock
()
return
return
}
}
...
...
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