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
Hide 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
...
@@ -498,9 +498,9 @@ type BigFile struct {
...
@@ -498,9 +498,9 @@ type BigFile struct {
zbf
*
ZBigFile
zbf
*
ZBigFile
// things read/computed from .zbf; constant during lifetime of current transaction.
// things read/computed from .zbf; constant during lifetime of current transaction.
blksize
int64
// zbf.blksize
blksize
int64
// zbf.blksize
zbfSize
int64
// zbf.Size() XXX -> .size
size
int64
// zbf.Size()
rev
zodb
.
Tid
// last revision that modified
file
data
rev
zodb
.
Tid
// last revision that modified
zbf
data
// tail change history of this file.
// tail change history of this file.
δFtail
*
ΔTailI64
// [](rev↑, []#blk)
δFtail
*
ΔTailI64
// [](rev↑, []#blk)
...
@@ -802,12 +802,12 @@ retry:
...
@@ -802,12 +802,12 @@ retry:
// XXX -> parallel?
// XXX -> parallel?
// XXX locking
// XXX locking
for
file
:=
range
toinvalidate
{
for
file
:=
range
toinvalidate
{
zbfS
ize
,
treePath
,
err
:=
file
.
zbf
.
Size
(
ctx
)
s
ize
,
treePath
,
err
:=
file
.
zbf
.
Size
(
ctx
)
if
err
!=
nil
{
if
err
!=
nil
{
panic
(
err
)
// XXX
panic
(
err
)
// XXX
}
}
file
.
zbfSize
=
zbfS
ize
file
.
size
=
s
ize
bfdir
.
indexLooked
.
Add
(
file
,
treePath
)
bfdir
.
indexLooked
.
Add
(
file
,
treePath
)
file
.
rev
=
zhead
.
At
()
file
.
rev
=
zhead
.
At
()
...
@@ -1141,7 +1141,7 @@ func (head *Head) bigopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err er
...
@@ -1141,7 +1141,7 @@ func (head *Head) bigopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err er
rev
:=
zbf
.
PSerial
()
rev
:=
zbf
.
PSerial
()
zbf
.
PDeactivate
()
zbf
.
PDeactivate
()
zbfS
ize
,
treePath
,
err
:=
zbf
.
Size
(
ctx
)
s
ize
,
treePath
,
err
:=
zbf
.
Size
(
ctx
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -1152,7 +1152,7 @@ func (head *Head) bigopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err er
...
@@ -1152,7 +1152,7 @@ func (head *Head) bigopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err er
head
:
head
,
head
:
head
,
zbf
:
zbf
,
zbf
:
zbf
,
blksize
:
blksize
,
blksize
:
blksize
,
zbfSize
:
zbfS
ize
,
size
:
s
ize
,
rev
:
rev
,
rev
:
rev
,
// XXX this is needed only for head/
// XXX this is needed only for head/
...
@@ -1208,7 +1208,7 @@ func (f *BigFile) GetAttr(out *fuse.Attr, _ nodefs.File, _ *fuse.Context) fuse.S
...
@@ -1208,7 +1208,7 @@ func (f *BigFile) GetAttr(out *fuse.Attr, _ nodefs.File, _ *fuse.Context) fuse.S
func
(
f
*
BigFile
)
getattr
(
out
*
fuse
.
Attr
)
{
func
(
f
*
BigFile
)
getattr
(
out
*
fuse
.
Attr
)
{
out
.
Mode
=
fuse
.
S_IFREG
|
0444
out
.
Mode
=
fuse
.
S_IFREG
|
0444
out
.
Size
=
uint64
(
f
.
zbfS
ize
)
out
.
Size
=
uint64
(
f
.
s
ize
)
// .Blocks
// .Blocks
// .Blksize
// .Blksize
...
@@ -1224,8 +1224,8 @@ func (f *BigFile) Read(_ nodefs.File, dest []byte, off int64, fctx *fuse.Context
...
@@ -1224,8 +1224,8 @@ func (f *BigFile) Read(_ nodefs.File, dest []byte, off int64, fctx *fuse.Context
// cap read request to file size
// cap read request to file size
end
:=
off
+
int64
(
len
(
dest
))
// XXX overflow?
end
:=
off
+
int64
(
len
(
dest
))
// XXX overflow?
if
end
>
f
.
zbfS
ize
{
if
end
>
f
.
s
ize
{
end
=
f
.
zbfS
ize
end
=
f
.
s
ize
}
}
if
end
<=
off
{
if
end
<=
off
{
// XXX off >= size -> EINVAL? (but when size=0 kernel issues e.g. [0 +4K) read)
// 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