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
46329e84
Commit
46329e84
authored
Oct 21, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c3d12e3c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
16 deletions
+6
-16
wcfs/wcfs.go
wcfs/wcfs.go
+6
-16
No files found.
wcfs/wcfs.go
View file @
46329e84
...
@@ -602,9 +602,7 @@ type BigFileDir struct {
...
@@ -602,9 +602,7 @@ type BigFileDir struct {
// δ tail of tracked BTree nodes of all BigFiles + -> which file
// δ tail of tracked BTree nodes of all BigFiles + -> which file
// (used only for head/, not revX/)
// (used only for head/, not revX/)
// XXX read/write access protected by zheadMu
δFtail
*
zdata
.
ΔFtail
// read/write access protected by zheadMu.{R,W}
// δFmu sync.RWMutex // zheadMu.W | zheadMu.R + δFmu.X XXX kill δFmu
δFtail
*
zdata
.
ΔFtail
}
}
// /(head|<rev>)/bigfile/<bigfileX> - served by BigFile.
// /(head|<rev>)/bigfile/<bigfileX> - served by BigFile.
...
@@ -859,9 +857,7 @@ retry:
...
@@ -859,9 +857,7 @@ retry:
bfdir
:=
head
.
bfdir
bfdir
:=
head
.
bfdir
// invalidate kernel cache for data in changed files
// invalidate kernel cache for data in changed files
// NOTE no δFmu lock needed because zhead is WLocked
// δF, err := bfdir.δFtail.Update(δZ, zhead) // δF <- δZ |tracked
δF
,
err
:=
bfdir
.
δFtail
.
Update
(
δZ
)
// δF <- δZ |tracked
δF
,
err
:=
bfdir
.
δFtail
.
Update
(
δZ
)
// δF <- δZ |tracked
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
@@ -1524,14 +1520,10 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
...
@@ -1524,14 +1520,10 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
// fmt.Printf("S: read #%d -> pin watchers (#%d)\n", blk, len(f.watchTab))
// fmt.Printf("S: read #%d -> pin watchers (#%d)\n", blk, len(f.watchTab))
// update δFtail index XXX -> move upper into readBlk ?
// update δFtail index XXX -> move upper into readBlk ?
// (δFtail is just for δZ -> δF invalidation handling and is needed without isolation protocol)
// XXX ^^^ no - also need to query to send pins
// see "3) for */head/data the following invariant is maintained..."
// see "3) for */head/data the following invariant is maintained..."
bfdir
:=
f
.
head
.
bfdir
bfdir
:=
f
.
head
.
bfdir
δFtail
:=
bfdir
.
δFtail
δFtail
:=
bfdir
.
δFtail
// bfdir.δFmu.Lock() // XXX locking correct? XXX -> better push down?
δFtail
.
Track
(
f
.
zfile
,
blk
,
treepath
,
blkcov
,
zblk
)
// XXX pass in zblk.rev here?
δFtail
.
Track
(
f
.
zfile
,
blk
,
treepath
,
blkcov
,
zblk
)
// XXX pass in zblk.rev here?
// bfdir.δFmu.Unlock()
// make sure that file[blk] on clients side stays as of @w.at state.
// make sure that file[blk] on clients side stays as of @w.at state.
...
@@ -2084,7 +2076,7 @@ func (bfdir *BigFileDir) lookup(out *fuse.Attr, name string, fctx *fuse.Context)
...
@@ -2084,7 +2076,7 @@ func (bfdir *BigFileDir) lookup(out *fuse.Attr, name string, fctx *fuse.Context)
}
}
// not there - without bfdir lock proceed to open BigFile from ZODB
// not there - without bfdir lock proceed to open BigFile from ZODB
f
,
err
=
bfdir
.
head
.
bigopen
(
fctx
,
oid
)
f
,
err
=
bfdir
.
head
.
big
f
open
(
fctx
,
oid
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -2192,14 +2184,14 @@ func (root *Root) lookup(name string, fctx *fuse.Context) (_ *Head, err error) {
...
@@ -2192,14 +2184,14 @@ func (root *Root) lookup(name string, fctx *fuse.Context) (_ *Head, err error) {
}
}
// bigopen opens BigFile corresponding to oid on head.zconn.
// big
f
open opens BigFile corresponding to oid on head.zconn.
//
//
// A ZBigFile corresponding to oid is activated and statted.
// A ZBigFile corresponding to oid is activated and statted.
//
//
// head.z
conn
must be locked.
// head.z
headMu
must be locked.
func
(
head
*
Head
)
bigopen
(
ctx
context
.
Context
,
oid
zodb
.
Oid
)
(
_
*
BigFile
,
err
error
)
{
func
(
head
*
Head
)
big
f
open
(
ctx
context
.
Context
,
oid
zodb
.
Oid
)
(
_
*
BigFile
,
err
error
)
{
zconn
:=
head
.
zconn
zconn
:=
head
.
zconn
defer
xerr
.
Contextf
(
&
err
,
"bigopen %s @%s"
,
oid
,
zconn
.
At
())
defer
xerr
.
Contextf
(
&
err
,
"big
f
open %s @%s"
,
oid
,
zconn
.
At
())
// XXX better ctx = transaction.PutIntoContext(ctx, txn)
// XXX better ctx = transaction.PutIntoContext(ctx, txn)
ctx
,
cancel
:=
xcontext
.
Merge
(
ctx
,
zconn
.
TxnCtx
)
ctx
,
cancel
:=
xcontext
.
Merge
(
ctx
,
zconn
.
TxnCtx
)
...
@@ -2254,9 +2246,7 @@ func (head *Head) bigopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err er
...
@@ -2254,9 +2246,7 @@ func (head *Head) bigopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err er
// only head/ needs δFtail, f.δtail and watches.
// only head/ needs δFtail, f.δtail and watches.
if
head
.
rev
==
0
{
if
head
.
rev
==
0
{
// see "3) for */head/data the following invariant is maintained..."
// see "3) for */head/data the following invariant is maintained..."
// head.bfdir.δFmu.Lock() // XXX locking ok?
head
.
bfdir
.
δFtail
.
Track
(
f
.
zfile
,
-
1
,
sizePath
,
blkCov
,
nil
)
head
.
bfdir
.
δFtail
.
Track
(
f
.
zfile
,
-
1
,
sizePath
,
blkCov
,
nil
)
// head.bfdir.δFmu.Unlock()
f
.
watchTab
=
make
(
map
[
*
Watch
]
struct
{})
f
.
watchTab
=
make
(
map
[
*
Watch
]
struct
{})
}
}
...
...
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