Commit e46e233e authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent cbe6a003
...@@ -272,8 +272,8 @@ type BigFileX struct { ...@@ -272,8 +272,8 @@ type BigFileX struct {
root *BigFileRoot root *BigFileRoot
} }
// BigFile represents "/bigfile/<bigfileX>/head" // BigFileHead represents "/bigfile/<bigfileX>/head"
type BigFile struct { type BigFileHead struct {
nodefs.Node nodefs.Node
x *BigFileX x *BigFileX
...@@ -282,10 +282,17 @@ type BigFile struct { ...@@ -282,10 +282,17 @@ type BigFile struct {
//inv *BigFileInvalidations //inv *BigFileInvalidations
} }
// BigFileData represents "/bigfile/<bigfileX>/head/data" // BigFile represents "/bigfile/<bigfileX>/head/data"
type BigFileData struct { // XXX also @<tidX>/data ?
type BigFile struct {
nodefs.Node 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 { ...@@ -312,9 +319,9 @@ func NewBigFileX(oid zodb.Oid, root *BigFileRoot) *BigFileX {
func NewBigFile(x *BigFileX) *BigFile { func NewBigFileHead(x *BigFileX) *BigFileHead {
f := &BigFile{Node: nodefs.NewDefaultNode(), x: x} f := &BigFileHead{Node: nodefs.NewDefaultNode(), x: x}
f.data = NewBigFileData(f) f.data = NewBigFile(f)
// XXX + .at // XXX + .at
...@@ -322,8 +329,8 @@ func NewBigFile(x *BigFileX) *BigFile { ...@@ -322,8 +329,8 @@ func NewBigFile(x *BigFileX) *BigFile {
} }
func NewBigFileData(head *BigFile) *BigFileData { func NewBigFile(head *BigFileHead) *BigFile {
return &BigFileData{Node: nodefs.NewDefaultNode(), head: head} return &BigFile{Node: nodefs.NewDefaultNode(), head: head}
} }
...@@ -352,13 +359,13 @@ func (br *BigFileRoot) Mkdir(name string, mode uint32, _ *fuse.Context) (*nodefs ...@@ -352,13 +359,13 @@ func (br *BigFileRoot) Mkdir(name string, mode uint32, _ *fuse.Context) (*nodefs
bx := NewBigFileX(oid, br) bx := NewBigFileX(oid, br)
br.tab[oid] = bx br.tab[oid] = bx
bf := NewBigFile(bx) bh := NewBigFileHead(bx)
mkdir(br, name, bx) // XXX takes treeLock - ok under br.mu ? mkdir(br, name, bx) // XXX takes treeLock - ok under br.mu ?
mkdir(bx, "head", bf) mkdir(bx, "head", bh)
mkfile(bf, "data", bf.data) mkfile(bh, "data", bh.data)
// XXX mkfile(bf, "at", bf.at) // XXX mkfile(bh, "at", bh.at)
// XXX mkfile(bf, "invalidations", bf.inv) // XXX mkfile(bh, "invalidations", bh.inv)
return bx.Inode(), fuse.OK return bx.Inode(), fuse.OK
} }
...@@ -366,6 +373,29 @@ func (br *BigFileRoot) Mkdir(name string, mode uint32, _ *fuse.Context) (*nodefs ...@@ -366,6 +373,29 @@ func (br *BigFileRoot) Mkdir(name string, mode uint32, _ *fuse.Context) (*nodefs
// XXX do we need to support rmdir? (probably no) // 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 ? // 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