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
07dbbe39
Commit
07dbbe39
authored
Oct 21, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6d940c61
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
wcfs/wcfs.go
wcfs/wcfs.go
+3
-4
No files found.
wcfs/wcfs.go
View file @
07dbbe39
...
@@ -1389,7 +1389,7 @@ func traceIso(format string, argv ...interface{}) {
...
@@ -1389,7 +1389,7 @@ func traceIso(format string, argv ...interface{}) {
//
//
// must be called with atMu rlocked.
// must be called with atMu rlocked.
//
//
//
XXX error - when? or close watch on any error?
//
TODO close watch on any error
func
(
w
*
Watch
)
pin
(
ctx
context
.
Context
,
blk
int64
,
rev
zodb
.
Tid
)
(
err
error
)
{
func
(
w
*
Watch
)
pin
(
ctx
context
.
Context
,
blk
int64
,
rev
zodb
.
Tid
)
(
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"wlink%d: f<%s>"
,
w
.
link
.
id
,
w
.
file
.
zfile
.
POid
())
defer
xerr
.
Contextf
(
&
err
,
"wlink%d: f<%s>"
,
w
.
link
.
id
,
w
.
file
.
zfile
.
POid
())
return
w
.
_pin
(
ctx
,
blk
,
rev
)
return
w
.
_pin
(
ctx
,
blk
,
rev
)
...
@@ -1559,7 +1559,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, blkrevMax zodb
...
@@ -1559,7 +1559,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, blkrevMax zodb
return
err
return
err
}
}
//fmt.Printf("S: read #%d: watch @%s: pin -> @%s\n", blk, w.at, pinrev)
//fmt.Printf("S: read #%d: watch @%s: pin -> @%s\n", blk, w.at, pinrev)
//
XXX
close watcher on any error
//
TODO
close watcher on any error
return
w
.
pin
(
ctx
,
blk
,
pinrev
)
return
w
.
pin
(
ctx
,
blk
,
pinrev
)
})
})
}
}
...
@@ -1687,7 +1687,7 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
...
@@ -1687,7 +1687,7 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
f
.
watchMu
.
Unlock
()
f
.
watchMu
.
Unlock
()
wlink
.
byfileMu
.
Unlock
()
wlink
.
byfileMu
.
Unlock
()
//
XXX defer -> unregister watch if error?
//
TODO defer -> unregister watch if error
// pin all tracked file blocks that were changed in (at, head] range.
// pin all tracked file blocks that were changed in (at, head] range.
toPin
:=
map
[
int64
]
zodb
.
Tid
{}
// blk -> @rev
toPin
:=
map
[
int64
]
zodb
.
Tid
{}
// blk -> @rev
...
@@ -1738,7 +1738,6 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
...
@@ -1738,7 +1738,6 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
// if a block was previously pinned, but ∉ δ(at, head] -> unpin it to head.
// if a block was previously pinned, but ∉ δ(at, head] -> unpin it to head.
for
blk
,
pinPrev
:=
range
w
.
pinned
{
for
blk
,
pinPrev
:=
range
w
.
pinned
{
// only 1 setupWatch can be run simultaneously for one file
// only 1 setupWatch can be run simultaneously for one file
// XXX assert pinPrev.rev != zodb.TidMax
pinNew
,
pinning
:=
toPin
[
blk
]
pinNew
,
pinning
:=
toPin
[
blk
]
if
!
pinning
{
if
!
pinning
{
...
...
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