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
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
Joshua
wendelin.core
Commits
e177e16e
Commit
e177e16e
authored
Jul 04, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
13c24a35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
wcfs/wcfs.go
wcfs/wcfs.go
+7
-8
No files found.
wcfs/wcfs.go
View file @
e177e16e
...
@@ -1164,8 +1164,8 @@ func (f *BigFile) readBlk(ctx context.Context, blk int64, dest []byte) (err erro
...
@@ -1164,8 +1164,8 @@ func (f *BigFile) readBlk(ctx context.Context, blk int64, dest []byte) (err erro
}
}
// we have the data - it can be used after watchers are updated
// we have the data - it can be used after watchers are updated
// XXX should we use ctx here? (see
update
Watchers comments)
// XXX should we use ctx here? (see
pin
Watchers comments)
f
.
update
Watchers
(
ctx
,
blk
,
treepath
,
zblk
,
blkrevMax
)
f
.
pin
Watchers
(
ctx
,
blk
,
treepath
,
zblk
,
blkrevMax
)
// data can be used now
// data can be used now
close
(
loading
.
ready
)
close
(
loading
.
ready
)
...
@@ -1323,8 +1323,8 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
...
@@ -1323,8 +1323,8 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
return
nil
return
nil
}
}
//
updateWatchers complements readBlk: it updates watchers of the file after a
//
pinWatchers complements readBlk: it sends `pin blk` for watchers of the file
// block was loaded from ZODB and before block data is returned to kernel.
//
after a
block was loaded from ZODB and before block data is returned to kernel.
//
//
// See "7.2) for all registered client@at watchers ..."
// See "7.2) for all registered client@at watchers ..."
//
//
...
@@ -1333,14 +1333,13 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
...
@@ -1333,14 +1333,13 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
// XXX do we really need to use/propagate caller context here? ideally update
// XXX do we really need to use/propagate caller context here? ideally update
// watchers should be synchronous, and in practice we just use 30s timeout.
// watchers should be synchronous, and in practice we just use 30s timeout.
// Should a READ interrupt cause watch update failure?
// Should a READ interrupt cause watch update failure?
// XXX -> pinWatchers? pinOnRead?
func
(
f
*
BigFile
)
pinWatchers
(
ctx
context
.
Context
,
blk
int64
,
treepath
[]
btree
.
LONode
,
zblk
zBlk
,
blkrevMax
zodb
.
Tid
)
{
func
(
f
*
BigFile
)
updateWatchers
(
ctx
context
.
Context
,
blk
int64
,
treepath
[]
btree
.
LONode
,
zblk
zBlk
,
blkrevMax
zodb
.
Tid
)
{
// only head/ is being watched for
// only head/ is being watched for
if
f
.
head
.
rev
!=
0
{
if
f
.
head
.
rev
!=
0
{
return
return
}
}
fmt
.
Printf
(
"S: read #%d ->
update
watchers (#%d)
\n
"
,
blk
,
len
(
f
.
watchTab
))
fmt
.
Printf
(
"S: read #%d ->
pin
watchers (#%d)
\n
"
,
blk
,
len
(
f
.
watchTab
))
// update δFtail index
// update δFtail index
bfdir
:=
f
.
head
.
bfdir
bfdir
:=
f
.
head
.
bfdir
...
@@ -1363,7 +1362,7 @@ func (f *BigFile) updateWatchers(ctx context.Context, blk int64, treepath []btre
...
@@ -1363,7 +1362,7 @@ func (f *BigFile) updateWatchers(ctx context.Context, blk int64, treepath []btre
for
w
:=
range
f
.
watchTab
{
for
w
:=
range
f
.
watchTab
{
w
:=
w
w
:=
w
fmt
.
Printf
(
"S: read ->
update
watchers: w @%s
\n
"
,
w
.
at
)
fmt
.
Printf
(
"S: read ->
pin
watchers: w @%s
\n
"
,
w
.
at
)
// XXX locking (w)
// XXX locking (w)
...
...
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