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
09b49b68
Commit
09b49b68
authored
Jun 30, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e53af11f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
65 deletions
+8
-65
wcfs/wcfs.go
wcfs/wcfs.go
+8
-65
No files found.
wcfs/wcfs.go
View file @
09b49b68
...
...
@@ -525,7 +525,7 @@ type BigFileDir struct {
// δ tail of tracked BTree nodes of all BigFiles + -> which file
// (used only for head/, not revX/)
δFmu
sync
.
RWMutex
// XXX
doc zheadMu.W | ...
?
δFmu
sync
.
RWMutex
// XXX
zheadMu.W | zheadMu.R + δFmu.X
?
δFtail
*
ΔFtail
}
...
...
@@ -694,7 +694,8 @@ func traceZWatch(format string, argv ...interface{}) {
// see "4) when we receive an invalidation message from ZODB ..."
func
(
root
*
Root
)
zwatcher
(
ctx
context
.
Context
,
zwatchq
chan
zodb
.
Event
)
(
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"zwatch %s"
,
root
.
zstor
.
URL
())
// XXX error -> always EIO for data operations
// XXX error -> always EIO for data operations
// XXX unmount -> stop
traceZWatch
(
">>>"
)
var
zevent
zodb
.
Event
...
...
@@ -768,72 +769,12 @@ retry:
zhead
:=
head
.
zconn
bfdir
:=
head
.
bfdir
/*
// δZ = (tid↑, []oid)
for _, oid := range δZ.Changev {
// XXX zhead.Cache() lock/unlock
obj := zhead.Cache().Get(oid)
if obj == nil {
//fmt.Printf("%s: not in cache\n", oid)
continue // nothing to do - see invariant
}
//fmt.Printf("%s: in cache (%s)\n", oid, typeOf(obj))
switch obj := obj.(type) {
default:
continue // object not related to any bigfile
// XXX kill Tree/Bucket here (-> ΔFtail)
case *btree.LOBTree:
btreeChangev = append(btreeChangev, obj.POid())
case *btree.LOBucket:
btreeChangev = append(btreeChangev, obj.POid())
case zBlk: // ZBlk*
// blkBoundTo locking: no other bindZFile are running,
// since we write-locked head.zheadMu and bindZFile is
// run when loading objects - thus when head.zheadMu is
// read-locked.
//
// bfdir locking: similarly not needed, since we are
// exclusively holding head lock.
for zfile, objBlk := range obj.blkBoundTo() {
file, ok := bfdir.fileTab[zfile.POid()]
if !ok {
// even though zfile is in ZODB cache, the
// filesystem already forgot about this file.
continue
}
finv, ok := toinvalidate[file]
if !ok {
finv = &fileInvalidate{blkmap: SetI64{}}
toinvalidate[file] = finv
}
finv.blkmap.Update(objBlk)
}
case *ZBigFile:
// XXX check that .blksize and .blktab (it is only
// persistent reference) do not change.
// XXX shutdown fs with ^^^ message.
panic("ZBigFile changed")
}
// make sure obj won't be garbage-collected until we finish handling it.
runtime.KeepAlive(obj)
}
*/
// invalidate kernel cache for data in changed files
// XXX no
indexM
u lock needed because head is Locked
// XXX no
δFm
u lock needed because head is Locked
δF
:=
bfdir
.
δFtail
.
Update
(
δZ
,
zhead
)
if
false
{
fmt
.
Printf
(
"
\n\n
S:
zδhandle
: δF (#%d):
\n
"
,
len
(
δF
.
ByFile
))
fmt
.
Printf
(
"
\n\n
S:
handleδZ
: δF (#%d):
\n
"
,
len
(
δF
.
ByFile
))
for
file
,
δfile
:=
range
δF
.
ByFile
{
blkv
:=
δfile
.
Blocks
.
Elements
()
sort
.
Slice
(
blkv
,
func
(
i
,
j
int
)
bool
{
...
...
@@ -1221,6 +1162,8 @@ func (f *BigFile) readBlk(ctx context.Context, blk int64, dest []byte) (err erro
// and thus would trigger DB access again.
//
// XXX if direct-io: don't touch pagecache
// XXX upload parts only not covered by currrent read (not to e.g. wait for page lock)
// XXX skip upload completely if read is wide to cover whole blksize
go
f
.
uploadBlk
(
blk
,
loading
)
return
nil
...
...
@@ -2296,7 +2239,7 @@ func main() {
})
// XXX place = ok?
// XXX ctx = ok?
// XXX ctx = ok?
XXX -> joined ctx for fs.Serve + zwatcher ?
// XXX wait for zwatcher shutdown + log from it error
go
root
.
zwatcher
(
ctx
,
zwatchq
)
...
...
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