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
4795d8d5
Commit
4795d8d5
authored
Oct 18, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
cda8c398
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+6
-8
No files found.
wcfs/internal/zdata/δftail.go
View file @
4795d8d5
...
...
@@ -302,13 +302,11 @@ func (δFtail *ΔFtail) Track(file *ZBigFile, blk int64, path []btree.LONode, bl
}
}
//
rebuild1IfNeeded rebuilds vδE for a file if there is such need
.
//
vδEForFile returns vδE and current root for specified file
.
//
// It also returns corresponding δftail.root for convenience.
// the only case when vδE actually needs to be rebuilt is when the file just started to be tracked.
//
// XXX naming -> vδEForFile ? vδEBuildIfNeeded?
func
(
δFtail
*
ΔFtail
)
rebuild1IfNeeded
(
foid
zodb
.
Oid
)
(
vδE
[]
_ΔFileEpoch
,
headRoot
zodb
.
Oid
,
err
error
)
{
// It builds vδE for that file if there is such need.
// The only case when vδE actually needs to be built is when the file just started to be tracked.
func
(
δFtail
*
ΔFtail
)
vδEForFile
(
foid
zodb
.
Oid
)
(
vδE
[]
_ΔFileEpoch
,
headRoot
zodb
.
Oid
,
err
error
)
{
δFtail
.
mu
.
Lock
()
// TODO verify that there is no in-progress writers
defer
δFtail
.
mu
.
Unlock
()
...
...
@@ -661,7 +659,7 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
// δFile ────────o───────o──────x─────x────────────────────────
vδE
,
headRoot
,
err
:=
δFtail
.
rebuild1IfNeeded
(
foid
)
vδE
,
headRoot
,
err
:=
δFtail
.
vδEForFile
(
foid
)
if
err
!=
nil
{
panic
(
err
)
// XXX
}
...
...
@@ -981,7 +979,7 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6
panicf
(
"zconn.at out of bounds: zconn.at: @%s, (tail, head] = (@%s, @%s]"
,
zconnAt
,
tail
,
head
)
}
vδE
,
headRoot
,
err
:=
δFtail
.
rebuild1IfNeeded
(
foid
)
vδE
,
headRoot
,
err
:=
δFtail
.
vδEForFile
(
foid
)
if
err
!=
nil
{
return
zodb
.
InvalidTid
,
false
,
err
}
...
...
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