Commit 15123fbf authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 100995d6
......@@ -218,7 +218,7 @@
// data directly into the file.
package main
// WCFS organization
// wcfs organization
//
// TODO
//
......@@ -273,26 +273,30 @@ import (
"github.com/pkg/errors"
)
// BigFileRoot represents "/bigfile"
// /bigfile/ - represented by BigFileRoot.
type BigFileRoot struct {
nodefs.Node
zstor zodb.IStorage
// {} oid -> <bigfileX>/
mu sync.Mutex
tab map[zodb.Oid]*BigFileDir
}
// BigFileDir represents "/bigfile/<bigfileX>"
// /bigfile/<bigfileX>/ - represented by BigFileDir.
type BigFileDir struct {
nodefs.Node
zdb *zodb.DB
// head/ (XXX just by fs entry)
// {} rev -> @<rev>/ bigfile snapshot
revMu sync.Mutex
revTab map[zodb.Tid]*BigFileRev
//revTab map[zodb.Tid]*BigFileRev
}
// BigFileHead represents "/bigfile/<bigfileX>/head"
// /bigfile/<bigfileX>/head/ - represented by BigFileHead.
// XXX -> BigFileRev (with head | @tid) ?
type BigFileHead struct {
nodefs.Node
......@@ -301,7 +305,7 @@ type BigFileHead struct {
//inv *BigFileInvalidations
}
// BigFile is object that serves "/bigfile/<bigfileX>/(head|<rev>)/{data,at}"
// /bigfile/<bigfileX>/(head|<rev>)/{data,at} - internally served by BigFile.
type BigFile struct {
// current read-only transaction under which we access ZODB data
txnCtx context.Context // XXX -> better directly store txn
......@@ -321,7 +325,7 @@ type BigFile struct {
// lastChange zodb.Tid // last change to whole bigfile as of .zconn.At view
}
// BigFileData represents "/bigfile/<bigfileX>/(head|<rev>)/data"
// /bigfile/<bigfileX>/(head|<rev>)/data - represented by BigFileData.
type BigFileData struct {
nodefs.Node
......@@ -478,6 +482,7 @@ func (bfroot *BigFileRoot) Mkdir(name string, mode uint32, fctx *fuse.Context) (
// XXX do we need to support rmdir? (probably no)
/*
// /bigfile/<bigfileX> -> Mkdir receives client request to create @<tid>.
func (bfdir *BigFileDir) Mkdir(name string, mode uint32, fctx *fuse.Context) (*nodefs.Inode, fuse.Status) {
var tid zodb.Tid
......@@ -536,7 +541,7 @@ func (bfdir *BigFileDir) Mkdir(name string, mode uint32, fctx *fuse.Context) (*n
// XXX -> zopen ?
func openBigFile(zopt *zodb.ConnOptions) (, err error){
func openBigFile(zopt *zodb.ConnOptions) (, err error) {
// XXX errctx
defer xerr.Contextf(&err, "XXX")
......@@ -562,6 +567,7 @@ func openBigFile(zopt *zodb.ConnOptions) (, err error){
//return nil, fuse.EIO
}
}
*/
// /bigfile/<bigfileX>/head/data -> Getattr serves stat.
......@@ -816,7 +822,7 @@ func main() {
// we require proper pagecache control (added to Linux 2.6.36 in 2010)
supports := fssrv.KernelSettings().SupportsNotify
if !(supports(fuse.NOTIFY_STORE) && supports(fuse.NOTIFY_RETRIEVE)) {
if !(supports(fuse.NOTIFY_STORE_CACHE) && supports(fuse.NOTIFY_RETRIEVE_CACHE)) {
log.Fatalf("kernel FUSE does not support pagecache control")
}
......
......@@ -255,6 +255,8 @@ def test_bigfile_empty():
assert tail2[:len(s2)] == s2
assert tail2[len(s2):] == b'\0'*(blksize - len(s2))
return # XXX temp
# path to f's state @tcommit1
fpath1 = fpath + ("/@%s" % tcommit1.encode("hex"))
......
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