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
e46e233e
Commit
e46e233e
authored
Jun 28, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
cbe6a003
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
15 deletions
+45
-15
wcfs/wcfs.go
wcfs/wcfs.go
+45
-15
No files found.
wcfs/wcfs.go
View file @
e46e233e
...
@@ -272,8 +272,8 @@ type BigFileX struct {
...
@@ -272,8 +272,8 @@ type BigFileX struct {
root
*
BigFileRoot
root
*
BigFileRoot
}
}
// BigFile represents "/bigfile/<bigfileX>/head"
// BigFile
Head
represents "/bigfile/<bigfileX>/head"
type
BigFile
struct
{
type
BigFile
Head
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
NewBigFile
Head
(
x
*
BigFileX
)
*
BigFileHead
{
f
:=
&
BigFile
{
Node
:
nodefs
.
NewDefaultNode
(),
x
:
x
}
f
:=
&
BigFile
Head
{
Node
:
nodefs
.
NewDefaultNode
(),
x
:
x
}
f
.
data
=
NewBigFile
Data
(
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
NewBigFile
Data
(
head
*
BigFile
)
*
BigFileData
{
func
NewBigFile
(
head
*
BigFileHead
)
*
BigFile
{
return
&
BigFile
Data
{
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
b
f
:=
NewBigFile
(
bx
)
b
h
:=
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"
,
b
f
)
mkdir
(
bx
,
"head"
,
b
h
)
mkfile
(
b
f
,
"data"
,
bf
.
data
)
mkfile
(
b
h
,
"data"
,
bh
.
data
)
// XXX mkfile(b
f, "at", bf
.at)
// XXX mkfile(b
h, "at", bh
.at)
// XXX mkfile(b
f, "invalidations", bf
.inv)
// XXX mkfile(b
h, "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 ?
...
...
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