Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
15123fbf
Commit
15123fbf
authored
Oct 12, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
100995d6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
+17
-9
wcfs/wcfs.go
wcfs/wcfs.go
+15
-9
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+2
-0
No files found.
wcfs/wcfs.go
View file @
15123fbf
...
@@ -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_RETRIEV
E
))
{
if
!
(
supports
(
fuse
.
NOTIFY_STORE
_CACHE
)
&&
supports
(
fuse
.
NOTIFY_RETRIEVE_CACH
E
))
{
log
.
Fatalf
(
"kernel FUSE does not support pagecache control"
)
log
.
Fatalf
(
"kernel FUSE does not support pagecache control"
)
}
}
...
...
wcfs/wcfs_test.py
View file @
15123fbf
...
@@ -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"
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment