Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
6c0aa796
Commit
6c0aa796
authored
Jul 16, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
4b71bba0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
wcfs/wcfs.go
wcfs/wcfs.go
+1
-1
wcfs/zodb.go
wcfs/zodb.go
+7
-4
No files found.
wcfs/wcfs.go
View file @
6c0aa796
...
@@ -457,7 +457,7 @@ func (bf *BigFile) Read(_ nodefs.File, dest []byte, off int64, _ fuse.Context) (
...
@@ -457,7 +457,7 @@ func (bf *BigFile) Read(_ nodefs.File, dest []byte, off int64, _ fuse.Context) (
*/
*/
// zodbCacheControl implements
Conn
CacheControl to tune ZODB to never evict
// zodbCacheControl implements
Live
CacheControl to tune ZODB to never evict
// ZBTree/ZBucket from live cache. We want to keep ZBTree/ZBucket always alive
// ZBTree/ZBucket from live cache. We want to keep ZBTree/ZBucket always alive
// becuse it is essentially the index where to find ZBigFile data.
// becuse it is essentially the index where to find ZBigFile data.
//
//
...
...
wcfs/zodb.go
View file @
6c0aa796
...
@@ -43,7 +43,7 @@ type Object interface {
...
@@ -43,7 +43,7 @@ type Object interface {
//
//
// Object data must be accessed only after corresponding PActivate
// Object data must be accessed only after corresponding PActivate
// call, which marks that object's data as being in use.
// call, which marks that object's data as being in use.
PActivate
(
ctx
context
.
Context
)
(
activated
bool
,
_
error
)
// XXX
+ -> nuse
?
PActivate
(
ctx
context
.
Context
)
(
activated
bool
,
_
error
)
// XXX
ret semantics
?
// PDeactivate indicates that corresponding PActivate caller finished access to object's data.
// PDeactivate indicates that corresponding PActivate caller finished access to object's data.
//
//
...
@@ -106,9 +106,9 @@ func (pyobj *pyObject) PyClass() pickle.Class { return pyobj.pyclass }
...
@@ -106,9 +106,9 @@ func (pyobj *pyObject) PyClass() pickle.Class { return pyobj.pyclass }
func
(
pyobj
*
pyObject
)
PyState
()
interface
{}
{
return
pyobj
.
pystate
}
func
(
pyobj
*
pyObject
)
PyState
()
interface
{}
{
return
pyobj
.
pystate
}
//
Conn
CacheControl is the interface that allows applications to influence
//
Live
CacheControl is the interface that allows applications to influence
// Connection's decisions with respect to its live cache.
// Connection's decisions with respect to its live cache.
type
Conn
CacheControl
interface
{
type
Live
CacheControl
interface
{
// WantEvict is called when object is going to be evicted from live cache and made ghost.
// WantEvict is called when object is going to be evicted from live cache and made ghost.
// If !ok the object will remain live.
// If !ok the object will remain live.
WantEvict
(
obj
Object
)
(
ok
bool
)
WantEvict
(
obj
Object
)
(
ok
bool
)
...
@@ -501,7 +501,7 @@ func (obj *object) pactivate(ctx context.Context) error {
...
@@ -501,7 +501,7 @@ func (obj *object) pactivate(ctx context.Context) error {
}
}
}
}
func
(
obj
*
object
)
pdeactivate
()
{
func
(
obj
*
object
)
pdeactivate
()
(
drop
bool
)
{
nuse
:=
atomic
.
AddInt32
(
&
obj
.
refcnt
,
-
1
)
nuse
:=
atomic
.
AddInt32
(
&
obj
.
refcnt
,
-
1
)
if
nuse
<
0
{
if
nuse
<
0
{
panic
(
"pdeactivate: nuse < 0"
)
panic
(
"pdeactivate: nuse < 0"
)
...
@@ -512,6 +512,7 @@ func (obj *object) pdeactivate() {
...
@@ -512,6 +512,7 @@ func (obj *object) pdeactivate() {
// no users left. Let's see whether we should transition this object to ghost.
// no users left. Let's see whether we should transition this object to ghost.
// TODO state=modified -> don't drop.
// TODO state=modified -> don't drop.
drop
=
true
if
drop
{
if
drop
{
if
cc
:=
obj
.
jar
.
cacheControl
;
cc
!=
nil
{
if
cc
:=
obj
.
jar
.
cacheControl
;
cc
!=
nil
{
...
@@ -522,6 +523,8 @@ func (obj *object) pdeactivate() {
...
@@ -522,6 +523,8 @@ func (obj *object) pdeactivate() {
if
drop
{
if
drop
{
obj
.
serial
=
0
obj
.
serial
=
0
}
}
return
drop
}
}
...
...
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