Commit e46e233e authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent cbe6a003
......@@ -272,8 +272,8 @@ type BigFileX struct {
root *BigFileRoot
}
// BigFile represents "/bigfile/<bigfileX>/head"
type BigFile struct {
// BigFileHead represents "/bigfile/<bigfileX>/head"
type BigFileHead struct {
nodefs.Node
x *BigFileX
......@@ -282,10 +282,17 @@ type BigFile struct {
//inv *BigFileInvalidations
}
// BigFileData represents "/bigfile/<bigfileX>/head/data"
type BigFileData struct {
// BigFile represents "/bigfile/<bigfileX>/head/data"
// XXX also @<tidX>/data ?
type BigFile struct {
nodefs.Node
head *BigFile
head *BigFileHead
topoid zodb.Oid // oid of ZBigFile
blksize int64 // ZBigFile.blksize XXX if it is changed - invalidate all? allowed to change?
head zodb.Tid // current view of ZODB
lastChange zodb.Tid // last change to whole bigfile as of .head view
}
......@@ -312,9 +319,9 @@ func NewBigFileX(oid zodb.Oid, root *BigFileRoot) *BigFileX {
func NewBigFile(x *BigFileX) *BigFile {
f := &BigFile{Node: nodefs.NewDefaultNode(), x: x}
f.data = NewBigFileData(f)
func NewBigFileHead(x *BigFileX) *BigFileHead {
f := &BigFileHead{Node: nodefs.NewDefaultNode(), x: x}
f.data = NewBigFile(f)
// XXX + .at
......@@ -322,8 +329,8 @@ func NewBigFile(x *BigFileX) *BigFile {
}
func NewBigFileData(head *BigFile) *BigFileData {
return &BigFileData{Node: nodefs.NewDefaultNode(), head: head}
func NewBigFile(head *BigFileHead) *BigFile {
return &BigFile{Node: nodefs.NewDefaultNode(), head: head}
}
......@@ -352,13 +359,13 @@ func (br *BigFileRoot) Mkdir(name string, mode uint32, _ *fuse.Context) (*nodefs
bx := NewBigFileX(oid, br)
br.tab[oid] = bx
bf := NewBigFile(bx)
bh := NewBigFileHead(bx)
mkdir(br, name, bx) // XXX takes treeLock - ok under br.mu ?
mkdir(bx, "head", bf)
mkfile(bf, "data", bf.data)
// XXX mkfile(bf, "at", bf.at)
// XXX mkfile(bf, "invalidations", bf.inv)
mkdir(bx, "head", bh)
mkfile(bh, "data", bh.data)
// XXX mkfile(bh, "at", bh.at)
// XXX mkfile(bh, "invalidations", bh.inv)
return bx.Inode(), fuse.OK
}
......@@ -366,6 +373,29 @@ func (br *BigFileRoot) Mkdir(name string, mode uint32, _ *fuse.Context) (*nodefs
// XXX do we need to support rmdir? (probably no)
// module: "wendelin.bigfile.file_zodb"
//
// ZBigFile
// .blksize xint
// .blktab LOBtree{} blk -> ZBlk*(blkdata)
//
// ZBlk0 (aliased as ZBlk)
// str with trailing '\0' removed.
//
// ZBlk1
// .chunktab IOBtree{} offset -> ZData(chunk)
//
// ZData
// str (chunk)
// Read implements reading from /bigfile/<bigfileX>/head/data.
// XXX and from /bigfile/<bigfileX>/@<tidX>/data.
func (bf *BigFile) Read(_ nodefs.File, dest []byte, off int64, _ fuse.Context) (fuse.ReadResult, fuse.Status) {
.at
.topoid
// XXX
}
// XXX option to prevent starting if wcfs was already started ?
......
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