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
a97d8c11
Commit
a97d8c11
authored
Dec 26, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
19738029
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
wcfs/wcfs.go
wcfs/wcfs.go
+18
-5
No files found.
wcfs/wcfs.go
View file @
a97d8c11
...
...
@@ -533,12 +533,22 @@ func (r *Root) zwatcher(ctx context.Context) (err error) {
defer
xerr
.
Contextf
(
&
err
,
"zwatch"
)
// XXX more in context?
// XXX unmount on error? -> always EIO?
zwatch
:=
r
.
zstor
.
Watch
()
// XXX -> create before zwatcher is started
zwatchq
:=
make
(
chan
zodb
.
WatchEvent
)
r
.
zstor
.
AddWatch
(
zwatchq
)
defer
r
.
zstor
.
DelWatch
(
zwatchq
)
var
zevent
zodb
.
WatchEvent
var
ok
bool
for
{
zevent
,
err
:=
zwatch
.
Read
(
ctx
)
if
err
!=
nil
{
return
err
select
{
case
<-
ctx
.
Done
()
:
return
ctx
.
Err
()
case
zevent
,
ok
=
<-
zwatchq
:
if
!
ok
{
return
nil
// closed XXX ok?
}
}
r
.
zhandle1
(
zevent
)
...
...
@@ -642,6 +652,9 @@ func (f *BigFile) invalidateBlk(ctx context.Context, blk int64) error {
// store retrieved data back to OS cache for file @<rev>/file[blk]
blkrev
,
_
:=
f
.
δFtail
.
LastRevOf
(
blk
,
f
.
head
.
zconn
.
At
())
frev
,
err
:=
groot
.
mkrevfile
(
blkrev
,
f
.
zbf
.
POid
())
if
err
!=
nil
{
// XXX
}
st
=
fsconn
.
FileNotifyStoreCache
(
frev
.
Inode
(),
off
,
blkdata
)
if
st
!=
fuse
.
OK
{
// XXX log - dup wrt readBlk -> common func.
...
...
@@ -689,7 +702,7 @@ func (root *Root) mkrevfile(rev zodb.Tid, fid zodb.Oid) (_ *BigFile, err error)
defer
f
.
Close
()
xfrev
=
fsconn
.
LookupNode
(
root
.
Inode
(),
frevpath
)
// must be !nil as open succeeded
// must be !nil as open succeeded
XXX better recheck
return
xfrev
.
Node
()
.
(
*
BigFile
),
nil
}
...
...
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