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

.

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