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
a52fa604
Commit
a52fa604
authored
Oct 02, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a214a315
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
12 deletions
+39
-12
wcfs/wcfs.go
wcfs/wcfs.go
+32
-11
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+7
-1
No files found.
wcfs/wcfs.go
View file @
a52fa604
...
...
@@ -294,16 +294,12 @@ type BigFileHead struct {
//x *BigFileDir
data
*
BigFileData
//
at *BigFileAt
at
*
BigFileAt
//inv *BigFileInvalidations
}
// BigFileData represents "/bigfile/<bigfileX>/head/data"
// XXX also @<tidX>/data ?
type
BigFileData
struct
{
nodefs
.
Node
//parent *BigFileHead
// BigFile is internal object for "/bigfile/<bigfileX>/<rev>/{data,at}"
type
BigFile
struct
{
// current read-only transaction under which we access ZODB data
txnCtx
context
.
Context
// XXX -> better directly store txn
...
...
@@ -317,6 +313,21 @@ type BigFileData struct {
// lastChange zodb.Tid // last change to whole bigfile as of .zconn.At view
}
// BigFileData represents "/bigfile/<bigfileX>/head/data"
// XXX also @<tidX>/data ?
type
BigFileData
struct
{
nodefs
.
Node
bigfile
*
BigFile
}
// BigFileAt represents "/bigfile/<bigfileX>/head/at"
type
BigFileAt
struct
{
nodefs
.
Node
bigfile
*
BigFile
}
// /bigfile -> Mkdir receives client request to create /bigfile/<bigfileX>.
//
...
...
@@ -412,14 +423,24 @@ func (bfroot *BigFileRoot) Mkdir(name string, mode uint32, fctx *fuse.Context) (
Node
:
nodefs
.
NewDefaultNode
(),
}
bfdata
:=
&
BigFileData
{
Node
:
nodefs
.
NewDefaultNode
(),
bf
:=
&
BigFile
{
txnCtx
:
txnCtx
,
zconn
:
zconn
,
zbf
:
zbf
,
}
bfdata
:=
&
BigFileData
{
Node
:
nodefs
.
NewDefaultNode
(),
bigfile
:
bf
,
}
bfat
:=
&
BigFileAt
{
Node
:
nodefs
.
NewDefaultNode
(),
bigfile
:
bf
,
}
bfhead
.
data
=
bfdata
bfhead
.
at
=
bfat
bfroot
.
tab
[
oid
]
=
bfdir
bfroot
.
mu
.
Unlock
()
...
...
@@ -428,7 +449,7 @@ func (bfroot *BigFileRoot) Mkdir(name string, mode uint32, fctx *fuse.Context) (
mkdir
(
bfroot
,
name
,
bfdir
)
mkdir
(
bfdir
,
"head"
,
bfhead
)
mkfile
(
bfhead
,
"data"
,
bfdata
)
// XXX mkfile(bh, "at", bh.
at)
mkfile
(
bfhead
,
"at"
,
bf
at
)
// XXX mkfile(bh, "invalidations", bh.inv)
return
bfdir
.
Inode
(),
fuse
.
OK
...
...
@@ -445,7 +466,7 @@ func (bfdata *BigFileData) GetAttr(out *fuse.Attr, _ nodefs.File, fctx *fuse.Con
// FIXME lastChange should cover all bigfile data, not only ZBigFile itself
//mtime := &bfdata.lastChange.Time().Time
lastChange
:=
bfdata
.
zbf
.
PSerial
()
lastChange
:=
bfdata
.
bigfile
.
zbf
.
PSerial
()
mtime
:=
lastChange
.
Time
()
.
Time
out
.
SetTimes
(
/*atime=*/
nil
,
/*mtime=*/
&
mtime
,
/*ctime=*/
&
mtime
)
...
...
wcfs/wcfs_test.py
View file @
a52fa604
...
...
@@ -69,7 +69,13 @@ def readfile(path):
# tidtime converts tid to transaction commit time.
def
tidtime
(
tid
):
return
TimeStamp
(
tid
).
timeTime
()
t
=
TimeStamp
(
tid
).
timeTime
()
# ZODB/py vs ZODB/go time resolution is not better than 1µs
# see e.g. https://lab.nexedi.com/kirr/neo/commit/9112f21e
#
# NOTE pytest.approx supports only ==, not e.g. <
return
round
(
t
,
6
)
# check that zurl does not change from one open to another storage open.
...
...
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