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
cd97de63
Commit
cd97de63
authored
Jul 19, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
30f5ddc7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
7 deletions
+12
-7
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+1
-0
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+1
-0
wcfs/wcfs.go
wcfs/wcfs.go
+6
-3
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+4
-4
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
cd97de63
...
...
@@ -826,6 +826,7 @@ func (δBtail *ΔBtail) GetAt(ctx context.Context, root *Tree, key Key, at zodb.
// key not in history tail at all.
// use @head[key]
// XXX can we avoid requiring live root?
// @tail[key] is not present - key was not changing in (tail, head].
// since at ∈ (tail, head] we can use @head[key] as the result
xvalue
,
ok
,
err
:=
root
.
Get
(
ctx
,
key
)
...
...
wcfs/internal/zdata/δftail.go
View file @
cd97de63
...
...
@@ -749,6 +749,7 @@ func (δFtail *ΔFtail) _LastBlkRev(ctx context.Context, zf *ZBigFile, blk int64
var
root
zodb
.
Oid
var
rootObj
*
btree
.
LOBTree
if
i
==
l
{
// XXX can use δftail.root instead of activate/deactivate zfile
err
:=
zf
.
PActivate
(
ctx
)
if
err
!=
nil
{
// file deleted
...
...
wcfs/wcfs.go
View file @
cd97de63
...
...
@@ -864,6 +864,7 @@ retry:
zhead
:=
head
.
zconn
bfdir
:=
head
.
bfdir
oldHead
:=
zhead
.
At
()
// invalidate kernel cache for data in changed files
// NOTE no δFmu lock needed because zhead is WLocked
...
...
@@ -913,7 +914,7 @@ retry:
for
blk
:=
range
δfile
.
Blocks
{
blk
:=
blk
wg
.
Go
(
func
(
ctx
context
.
Context
)
error
{
return
file
.
invalidateBlk
(
ctx
,
blk
)
return
file
.
invalidateBlk
(
ctx
,
blk
,
oldHead
)
})
}
}
...
...
@@ -961,6 +962,7 @@ retry:
file
:=
bfdir
.
fileTab
[
foid
]
// must be present
zfile
:=
file
.
zfile
// XXX need to do only if δfile.Size changed
size
,
sizePath
,
err
:=
zfile
.
Size
(
ctx
)
if
err
!=
nil
{
return
err
...
...
@@ -1044,7 +1046,7 @@ func (head *Head) zheadWait(ctx context.Context, at zodb.Tid) (err error) {
//
// see "4.4) for all file/blk to in invalidate we do"
// called with zheadMu wlocked.
func
(
f
*
BigFile
)
invalidateBlk
(
ctx
context
.
Context
,
blk
int64
)
(
err
error
)
{
func
(
f
*
BigFile
)
invalidateBlk
(
ctx
context
.
Context
,
blk
int64
,
oldHead
zodb
.
Tid
)
(
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"%s: invalidate blk #%d:"
,
f
.
path
(),
blk
)
fsconn
:=
gfsconn
...
...
@@ -1086,7 +1088,8 @@ func (f *BigFile) invalidateBlk(ctx context.Context, blk int64) (err error) {
func
()
{
// store retrieved data back to OS cache for file @<rev>/file[blk]
δFtail
:=
f
.
head
.
bfdir
.
δFtail
blkrev
,
_
:=
δFtail
.
LastBlkRev
(
ctx
,
f
.
zfile
,
blk
,
f
.
head
.
zconn
.
At
())
// blkrev, _ := δFtail.LastBlkRev(ctx, f.zfile, blk, f.head.zconn.At())
blkrev
,
_
:=
δFtail
.
LastBlkRev
(
ctx
,
f
.
zfile
,
blk
,
oldHead
)
frev
,
funlock
,
err
:=
groot
.
lockRevFile
(
blkrev
,
f
.
zfile
.
POid
())
if
err
!=
nil
{
log
.
Errorf
(
"BUG: %s: invalidate blk #%d: %s (ignoring, but reading @revX/bigfile will be slow)"
,
f
.
path
(),
blk
,
err
)
...
...
wcfs/wcfs_test.py
View file @
cd97de63
...
...
@@ -1214,10 +1214,10 @@ def test_wcfs_basic():
t
=
tDB
();
zf
=
t
.
zfile
defer
(
t
.
close
)
# >>> lookup non-BigFile -> must be rejected
with
raises
(
OSError
)
as
exc
:
t
.
wc
.
_stat
(
"head/bigfile/%s"
%
h
(
t
.
nonzfile
.
_p_oid
))
assert
exc
.
value
.
errno
==
EINVAL
#
#
>>> lookup non-BigFile -> must be rejected
#
with raises(OSError) as exc:
#
t.wc._stat("head/bigfile/%s" % h(t.nonzfile._p_oid))
#
assert exc.value.errno == EINVAL
# >>> file initially empty
f
=
t
.
open
(
zf
)
...
...
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