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
5f7c757e
Commit
5f7c757e
authored
Mar 08, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
ef23c06e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
wcfs/wcfs.go
wcfs/wcfs.go
+7
-4
No files found.
wcfs/wcfs.go
View file @
5f7c757e
...
...
@@ -495,10 +495,12 @@ type BigFile struct {
head
*
Head
// ZBigFile top-level object. Kept activated during lifetime of current transaction.
// XXX kill "Kept activated ..."
zbf
*
ZBigFile
// zbf.Size(). It is constant during lifetime of current transaction.
zbfSize
int64
blksize
int64
// zbf.blksize
zbfSize
int64
// zbf.Size() XXX -> .size
// tail change history of this file.
δFtail
*
ΔTailI64
// [](rev↑, []#blk)
...
...
@@ -1215,7 +1217,7 @@ func (f *BigFile) getattr(out *fuse.Attr) {
// .Blksize
// FIXME lastChange should cover all bigfile data, not only ZBigFile itself
//
mtime := f.δFtail[-1] || zbf.PSerial?
//
XXX -> f.lastRev (initially serial, later ~ f.δFtail[-1])
lastChange
:=
f
.
zbf
.
PSerial
()
// XXX activate (if zbf becomes not activated during txn)
mtime
:=
lastChange
.
Time
()
.
Time
...
...
@@ -1228,8 +1230,6 @@ func (f *BigFile) Read(_ nodefs.File, dest []byte, off int64, fctx *fuse.Context
f
.
head
.
zconnMu
.
RLock
()
defer
f
.
head
.
zconnMu
.
RUnlock
()
zbf
:=
f
.
zbf
// cap read request to file size
end
:=
off
+
int64
(
len
(
dest
))
// XXX overflow?
if
end
>
f
.
zbfSize
{
...
...
@@ -1240,6 +1240,8 @@ func (f *BigFile) Read(_ nodefs.File, dest []byte, off int64, fctx *fuse.Context
return
fuse
.
ReadResultData
(
nil
),
fuse
.
OK
}
zbf
:=
f
.
zbf
// widen read request to be aligned with blksize granularity
// (we can load only whole ZBlk* blocks)
aoff
:=
off
-
(
off
%
zbf
.
blksize
)
...
...
@@ -1267,6 +1269,7 @@ func (f *BigFile) Read(_ nodefs.File, dest []byte, off int64, fctx *fuse.Context
err
:=
wg
.
Wait
()
if
err
!=
nil
{
// XXX -> err2LogStatus
log
.
Errorf
(
"%s"
,
err
)
// XXX + /bigfile/XXX: read [a,b): -> ...
return
nil
,
fuse
.
EIO
}
...
...
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