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
424beee4
Commit
424beee4
authored
Mar 08, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
501b7b27
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
wcfs/wcfs.go
wcfs/wcfs.go
+10
-10
No files found.
wcfs/wcfs.go
View file @
424beee4
...
...
@@ -499,8 +499,8 @@ type BigFile struct {
// things read/computed from .zbf; constant during lifetime of current transaction.
blksize
int64
// zbf.blksize
zbfSize
int64
// zbf.Size() XXX -> .size
rev
zodb
.
Tid
// last revision that modified
file
data
size
int64
// zbf.Size()
rev
zodb
.
Tid
// last revision that modified
zbf
data
// tail change history of this file.
δFtail
*
ΔTailI64
// [](rev↑, []#blk)
...
...
@@ -802,12 +802,12 @@ retry:
// XXX -> parallel?
// XXX locking
for
file
:=
range
toinvalidate
{
zbfS
ize
,
treePath
,
err
:=
file
.
zbf
.
Size
(
ctx
)
s
ize
,
treePath
,
err
:=
file
.
zbf
.
Size
(
ctx
)
if
err
!=
nil
{
panic
(
err
)
// XXX
}
file
.
zbfSize
=
zbfS
ize
file
.
size
=
s
ize
bfdir
.
indexLooked
.
Add
(
file
,
treePath
)
file
.
rev
=
zhead
.
At
()
...
...
@@ -1141,7 +1141,7 @@ func (head *Head) bigopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err er
rev
:=
zbf
.
PSerial
()
zbf
.
PDeactivate
()
zbfS
ize
,
treePath
,
err
:=
zbf
.
Size
(
ctx
)
s
ize
,
treePath
,
err
:=
zbf
.
Size
(
ctx
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -1152,7 +1152,7 @@ func (head *Head) bigopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err er
head
:
head
,
zbf
:
zbf
,
blksize
:
blksize
,
zbfSize
:
zbfS
ize
,
size
:
s
ize
,
rev
:
rev
,
// XXX this is needed only for head/
...
...
@@ -1208,7 +1208,7 @@ func (f *BigFile) GetAttr(out *fuse.Attr, _ nodefs.File, _ *fuse.Context) fuse.S
func
(
f
*
BigFile
)
getattr
(
out
*
fuse
.
Attr
)
{
out
.
Mode
=
fuse
.
S_IFREG
|
0444
out
.
Size
=
uint64
(
f
.
zbfS
ize
)
out
.
Size
=
uint64
(
f
.
s
ize
)
// .Blocks
// .Blksize
...
...
@@ -1224,8 +1224,8 @@ func (f *BigFile) Read(_ nodefs.File, dest []byte, off int64, fctx *fuse.Context
// cap read request to file size
end
:=
off
+
int64
(
len
(
dest
))
// XXX overflow?
if
end
>
f
.
zbfS
ize
{
end
=
f
.
zbfS
ize
if
end
>
f
.
s
ize
{
end
=
f
.
s
ize
}
if
end
<=
off
{
// XXX off >= size -> EINVAL? (but when size=0 kernel issues e.g. [0 +4K) read)
...
...
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