Commit a52fa604 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a214a315
......@@ -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", bfat)
// 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)
......
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment