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
bbab9e89
Commit
bbab9e89
authored
Oct 21, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8fd39879
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
23 deletions
+21
-23
wcfs/wcfs.go
wcfs/wcfs.go
+21
-23
No files found.
wcfs/wcfs.go
View file @
bbab9e89
...
...
@@ -604,12 +604,12 @@ type BigFile struct {
// things read/computed from .zfile; constant during lifetime of current transaction.
// i.e. changed under zhead.W
blksize
int64
// zfile.blksize
size
int64
// zfile.Size()
rev
zodb
.
Tid
//
last revision that modified zfile data
// XXX
we can't know rev fully as some later blocks could be learnt only
// while populating δFtail lazily
// XXX or then it is not "constant during lifetime of current txn"
blksize
int64
// zfile.blksize
size
int64
// zfile.Size()
rev
Approx
zodb
.
Tid
// approx
last revision that modified zfile data
// (
we can't know rev fully as some later blocks could be learnt only
// while populating δFtail lazily. For simplicity we don't delve into
// updating revApprox during lifetime of current transaction )
// inflight loadings of ZBigFile from ZODB.
// successful load results are kept here until blkdata is put into OS pagecache.
...
...
@@ -946,9 +946,9 @@ retry:
bfdir
.
δFtail
.
Track
(
zfile
,
-
1
,
sizePath
,
blkCov
,
nil
)
}
//
XXX
we can miss a change to file if δblk is not yet tracked
//
-> need to update file.rev at read time -> locking=XXX
file
.
rev
=
zhead
.
At
()
//
NOTE
we can miss a change to file if δblk is not yet tracked
//
that's why revision is only approximated
file
.
rev
Approx
=
zhead
.
At
()
}
// notify .wcfs/zhead
...
...
@@ -2194,12 +2194,10 @@ func (head *Head) bigfopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err e
return
nil
,
err
}
blksize
:=
zfile
.
BlkSize
()
//
XXX it
should be revision of both ZBigFile and its data. But we
//
NOTE file revision
should be revision of both ZBigFile and its data. But we
// cannot get data revision without expensive scan of all ZBigFile's objects.
// -> approximate mtime initially with ZBigFile object mtime.
//
// XXX for @rev/... we can know initial mtime more exactly?
rev
:=
zfile
.
PSerial
()
revApprox
:=
zfile
.
PSerial
()
zfile
.
PDeactivate
()
size
,
sizePath
,
blkCov
,
err
:=
zfile
.
Size
(
ctx
)
...
...
@@ -2208,13 +2206,13 @@ func (head *Head) bigfopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err e
}
f
:=
&
BigFile
{
fsNode
:
newFSNode
(
&
fsOptions
{
Sticky
:
false
}),
// XXX + BigFile.OnForget -> del .head.bfdir.fileTab[]
head
:
head
,
zfile
:
zfile
,
blksize
:
blksize
,
size
:
size
,
rev
:
rev
,
loading
:
make
(
map
[
int64
]
*
blkLoadState
),
fsNode
:
newFSNode
(
&
fsOptions
{
Sticky
:
false
}),
// XXX + BigFile.OnForget -> del .head.bfdir.fileTab[]
head
:
head
,
zfile
:
zfile
,
blksize
:
blksize
,
size
:
size
,
rev
Approx
:
revApprox
,
loading
:
make
(
map
[
int64
]
*
blkLoadState
),
}
// only head/ needs δFtail and watches.
...
...
@@ -2280,7 +2278,7 @@ func (f *BigFile) getattr(out *fuse.Attr) {
out
.
Blksize
=
uint32
(
f
.
blksize
)
// NOTE truncating 64 -> 32
// .Blocks
mtime
:=
f
.
rev
.
Time
()
.
Time
mtime
:=
f
.
rev
Approx
.
Time
()
.
Time
out
.
SetTimes
(
/*atime=*/
nil
,
/*mtime=*/
&
mtime
,
/*ctime=*/
&
mtime
)
}
...
...
@@ -2487,7 +2485,7 @@ func _main() (err error) {
// add entries to /
mkdir
(
root
,
"head"
,
head
)
mkdir
(
head
,
"bigfile"
,
bfdir
)
mkfile
(
head
,
"at"
,
NewSmallFile
(
head
.
readAt
))
// TODO mtime(at) = tidtime(at)
mkfile
(
head
,
"at"
,
NewSmallFile
(
head
.
readAt
))
// TODO mtime(at) = tidtime(at)
mkfile
(
head
,
"watch"
,
wnode
)
// for debugging/testing
...
...
@@ -2537,7 +2535,7 @@ func _main() (err error) {
if
errors
.
Cause
(
err
)
!=
context
.
Canceled
{
log
.
Error
(
err
)
log
.
Errorf
(
"zwatcher failed -> switching filesystem to EIO mode (TODO)"
)
//
panic("TODO: switch fs to EIO mode") // XXX
//
TODO: switch fs to EIO mode
}
// wait for unmount
...
...
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