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
ebf38926
Commit
ebf38926
authored
Apr 05, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
83b604f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
wcfs/wcfs.go
wcfs/wcfs.go
+3
-2
wcfs/zblk.go
wcfs/zblk.go
+7
-5
No files found.
wcfs/wcfs.go
View file @
ebf38926
...
...
@@ -1169,7 +1169,6 @@ func (f *BigFile) updateWatchers(ctx context.Context, blk int64, treepath []btre
// XXX close watcher on any error
return
w
.
pin
(
ctx
,
blk
,
blkrevmax
)
})
_
=
w
}
err
:=
wg
.
Wait
()
if
err
!=
nil
{
...
...
@@ -1248,7 +1247,8 @@ retry:
// -------- invalidation protocol notification/serving --------
// pin makes sure that file[blk] on client side is the same as of @rev state.
// pin makes sure that file[blk] on client side is the same as of @rev state. XXX no
// XXX what is passed here is rev(blk, @head) - we need to consider rev(blk, @w.at)
//
// XXX describe more.
// XXX explain that if rev ≤ .at there is no rev_next: rev < rev_next ≤ at.
...
...
@@ -1269,6 +1269,7 @@ func (w *Watch) pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
return
// already pinned
}
// FIXME LastBlkRev call not needed here - we get blk rev as argument. - XXX no
// XXX comment
// XXX file.δtail has not full info
rev
,
_
=
w
.
file
.
LastBlkRev
(
blk
,
w
.
at
)
...
...
wcfs/zblk.go
View file @
ebf38926
...
...
@@ -55,8 +55,10 @@ import (
"./internal/pycompat"
)
// zBlk is the interface that every ZBlk* block implements
internally
.
// zBlk is the interface that every ZBlk* block implements.
type
zBlk
interface
{
zodb
.
IPersistent
// loadBlkData loads from database and returns data block stored by this ZBlk.
//
// If returned data size is less than the block size of containing ZBigFile,
...
...
@@ -444,7 +446,7 @@ func (bf *zBigFileState) PySetState(pystate interface{}) (err error) {
// - BTree path in .blktab for loaded block,
// - max(_.serial for _ in ZBlk(#blk), all BTree/Bucket that lead to ZBlk)
//
// XXX
better load into user-provided buf? mem.Buf?
// XXX
load into user-provided buf.
func
(
bf
*
ZBigFile
)
LoadBlk
(
ctx
context
.
Context
,
blk
int64
)
(
_
[]
byte
,
treePath
[]
btree
.
LONode
,
pathRevMax
zodb
.
Tid
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"bigfile %s: loadblk %d"
,
bf
.
POid
(),
blk
)
...
...
@@ -471,15 +473,15 @@ func (bf *ZBigFile) LoadBlk(ctx context.Context, blk int64) (_ []byte, treePath
return
nil
,
nil
,
0
,
fmt
.
Errorf
(
"expect ZBlk*; got %s"
,
typeOf
(
xzblk
))
}
blkdata
,
blkrev
,
err
:=
zblk
.
loadBlkData
(
ctx
)
blkdata
,
z
blkrev
,
err
:=
zblk
.
loadBlkData
(
ctx
)
if
err
!=
nil
{
return
nil
,
nil
,
0
,
err
}
pathRevMax
=
tidmax
(
pathRevMax
,
blkrev
)
pathRevMax
=
tidmax
(
pathRevMax
,
z
blkrev
)
l
:=
int64
(
len
(
blkdata
))
if
l
>
bf
.
blksize
{
return
nil
,
nil
,
0
,
fmt
.
Errorf
(
"
invalid blk: size = %d (> blksize = %d)"
,
l
,
bf
.
blksize
)
return
nil
,
nil
,
0
,
fmt
.
Errorf
(
"
zblk %s: invalid blk: size = %d (> blksize = %d)"
,
zblk
.
POid
()
,
l
,
bf
.
blksize
)
}
// append trailing \0 to data to reach .blksize
...
...
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