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
7c8e7c98
Commit
7c8e7c98
authored
Feb 18, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
96451811
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
wcfs/wcfs.go
wcfs/wcfs.go
+20
-12
No files found.
wcfs/wcfs.go
View file @
7c8e7c98
...
...
@@ -482,6 +482,8 @@ type BigFileDir struct {
// visited BTree nodes of all BigFiles
// -> which file + ordering for toposort on δbtree
//
// (used only for head/, not revX/)
indexMu
sync
.
Mutex
indexLooked
*
δbtree
.
PathSet
// XXX naming
}
...
...
@@ -921,7 +923,7 @@ func (root *Root) mkrevfile(rev zodb.Tid, fid zodb.Oid) (_ *BigFile, err error)
if
err
!=
nil
{
return
nil
,
err
}
defer
f
.
Close
()
defer
f
.
Close
()
// XXX -> return to caller to release when inode no longer needed
xfrev
=
fsconn
.
LookupNode
(
root
.
Inode
(),
frevpath
)
// must be !nil as open succeeded XXX better recheck
...
...
@@ -1064,10 +1066,10 @@ func (root *Root) lookup(name string, fctx *fuse.Context) (_ *Head, err error) {
}
bfdir
:=
&
BigFileDir
{
Node
:
newDefaultNode
(),
head
:
revDir
,
fileTab
:
make
(
map
[
zodb
.
Oid
]
*
BigFile
),
// indexLooked = nil
for @revX/
Node
:
newDefaultNode
(),
head
:
revDir
,
fileTab
:
make
(
map
[
zodb
.
Oid
]
*
BigFile
),
indexLooked
:
nil
,
// δbtree index not needed/used
for @revX/
}
revDir
.
bfdir
=
bfdir
...
...
@@ -1141,9 +1143,12 @@ func (head *Head) bigopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err er
loading
:
make
(
map
[
int64
]
*
blkLoadState
),
}
head
.
bfdir
.
indexMu
.
Lock
()
// XXX locking ok?
head
.
bfdir
.
indexLooked
.
Add
(
f
,
treePath
)
head
.
bfdir
.
indexMu
.
Unlock
()
// only head/ needs δbtree index.
if
head
.
rev
==
0
{
head
.
bfdir
.
indexMu
.
Lock
()
// XXX locking ok?
head
.
bfdir
.
indexLooked
.
Add
(
f
,
treePath
)
head
.
bfdir
.
indexMu
.
Unlock
()
}
return
f
,
nil
}
...
...
@@ -1292,10 +1297,13 @@ func (f *BigFile) readBlk(ctx context.Context, blk int64, dest []byte) error {
loading
.
err
=
err
close
(
loading
.
ready
)
bfdir
:=
f
.
head
.
bfdir
bfdir
.
indexMu
.
Lock
()
// XXX locking correct?
bfdir
.
indexLooked
.
Add
(
f
,
treepath
)
// XXX needed only for head/
bfdir
.
indexMu
.
Unlock
()
// only head/ has δbtree index.
if
f
.
head
.
rev
==
0
{
bfdir
:=
f
.
head
.
bfdir
bfdir
.
indexMu
.
Lock
()
// XXX locking correct?
bfdir
.
indexLooked
.
Add
(
f
,
treepath
)
bfdir
.
indexMu
.
Unlock
()
}
// XXX before loading.ready?
blkrevmax
,
_
:=
f
.
δFtail
.
LastRevOf
(
blk
,
zbf
.
PJar
()
.
At
())
...
...
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