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
5115f254
Commit
5115f254
authored
Feb 04, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b3c92399
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
wcfs/wcfs.go
wcfs/wcfs.go
+16
-2
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+2
-0
No files found.
wcfs/wcfs.go
View file @
5115f254
...
...
@@ -655,6 +655,10 @@ func (root *Root) zδhandle1(zevent zodb.CommitEvent) {
return
file
.
invalidateBlk
(
ctx
,
blk
)
})
}
// invalidate kernel cache for attributes
// XXX we need to do it only if we see topoligy (i.e. btree) change
wg
.
Go
(
file
.
invalidateAttr
)
}
err
:=
wg
.
Wait
()
if
err
!=
nil
{
...
...
@@ -668,6 +672,7 @@ func (root *Root) zδhandle1(zevent zodb.CommitEvent) {
// XXX dir.mu locking (not needed bcause zconnMu locked)
for
_
,
file
:=
range
bfdir
.
fileTab
{
file
.
zbf
.
PDeactivate
()
// XXX we need to reread size only for files in toinvalidate
file
.
zbfSize
=
-
1
// just in case
}
...
...
@@ -705,7 +710,7 @@ func (root *Root) zδhandle1(zevent zodb.CommitEvent) {
}
}
// invalidateBlk invalidates 1 file block
. XXX
// invalidateBlk invalidates 1 file block
in kernel cache.
//
// see "4.4) for all file/blk to in invalidate we do"
//
...
...
@@ -746,6 +751,15 @@ func (f *BigFile) invalidateBlk(ctx context.Context, blk int64) error {
panic
(
"TODO"
)
}
// invalidateAttr invalidates file attributes in kernel cache.
func
(
f
*
BigFile
)
invalidateAttr
()
error
{
fsconn
:=
gfsconn
st
:=
fsconn
.
FileNotify
(
f
.
Inode
(),
-
1
,
-
1
)
// metadata only
// st != ok
_
=
st
panic
(
"TODO"
)
}
// mkrevfile makes sure inode ID of /@<rev>/bigfile/<fid> is known to kernel.
//
...
...
@@ -1344,7 +1358,7 @@ func main() {
mkdir
(
root
,
"head"
,
head
)
mkdir
(
head
,
"bigfile"
,
bfdir
)
mkfile
(
head
,
"at"
,
NewSmallFile
(
head
.
readAt
))
// TODO mtime(at) = tidtime(at)
// XXX ^^^ invalidate cache or direct io
// XXX ^^^ invalidate cache or direct io
XXX no FOPEN_KEEP_CACHE -> direct io
// for debugging/testing
_wcfs
:=
newDefaultNode
()
...
...
wcfs/wcfs_test.py
View file @
5115f254
...
...
@@ -204,6 +204,8 @@ def test_wcfs():
s
=
b"hello world"
memcpy
(
vma
,
s
)
print
(
"
\
n
\
n
\
n
"
)
#import time; time.sleep(2)
commit
()
wcsync
()
# sync wcfs to ZODB
...
...
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