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
a214a315
Commit
a214a315
authored
Oct 01, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
ab73858d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
3 deletions
+32
-3
wcfs/wcfs.go
wcfs/wcfs.go
+32
-3
No files found.
wcfs/wcfs.go
View file @
a214a315
...
...
@@ -311,7 +311,7 @@ type BigFileData struct {
// XXX do we need to keep it here explicitly?
zconn
*
zodb
.
Connection
zbf
*
ZBigFile
zbf
*
ZBigFile
// XXX kept always activated
// TODO
// lastChange zodb.Tid // last change to whole bigfile as of .zconn.At view
...
...
@@ -382,6 +382,17 @@ func (bfroot *BigFileRoot) Mkdir(name string, mode uint32, fctx *fuse.Context) (
return
nil
,
fuse
.
EINVAL
}
// acticate ZBigFile and keep it this way
err
=
zbf
.
PActivate
(
ctx
)
if
err
!=
nil
{
log
.
Printf
(
"/bigfile: mkdir %q: %s"
,
name
,
err
)
return
nil
,
fuse
.
EIO
}
defer
func
()
{
if
status
!=
fuse
.
OK
{
zbf
.
PDeactivate
()
}
}()
// relock bfroot and either mkdir or EEXIST if the directory was maybe
// simultanously created while we were not holding bfroot.mu
...
...
@@ -426,6 +437,23 @@ func (bfroot *BigFileRoot) Mkdir(name string, mode uint32, fctx *fuse.Context) (
// XXX do we need to support rmdir? (probably no)
// /bigfile/<bigfileX>/head/data -> Getattr serves stat.
func
(
bfdata
*
BigFileData
)
GetAttr
(
out
*
fuse
.
Attr
,
_
nodefs
.
File
,
fctx
*
fuse
.
Context
)
fuse
.
Status
{
out
.
Mode
=
fuse
.
S_IFREG
|
0444
out
.
Size
=
0
// FIXME
// .Blocks
// FIXME lastChange should cover all bigfile data, not only ZBigFile itself
//mtime := &bfdata.lastChange.Time().Time
lastChange
:=
bfdata
.
zbf
.
PSerial
()
mtime
:=
lastChange
.
Time
()
.
Time
out
.
SetTimes
(
/*atime=*/
nil
,
/*mtime=*/
&
mtime
,
/*ctime=*/
&
mtime
)
return
fuse
.
OK
}
// Read implements reading from /bigfile/<bigfileX>/head/data.
// XXX and from /bigfile/<bigfileX>/@<tidX>/data.
/*
...
...
@@ -437,11 +465,10 @@ func (bf *BigFileData) Read(_ nodefs.File, dest []byte, off int64, _ fuse.Contex
*/
// zodbCacheControl implements LiveCacheControl to tune ZODB to never evict
// zodbCacheControl implements LiveCacheControl to tune ZODB to never evict
// LOBTree/LOBucket from live cache. We want to keep LOBTree/LOBucket always alive
// becuse it is essentially the index where to find ZBigFile data.
//
...
...
@@ -458,6 +485,8 @@ func (cc *zodbCacheControl) WantEvict(obj zodb.IPersistent) bool {
case
*
btree
.
LOBTree
:
case
*
btree
.
LOBucket
:
// XXX + ZBigFile ?
}
return
false
...
...
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