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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
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
Hide 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 {
root
*
BigFileRoot
}
// BigFile represents "/bigfile/<bigfileX>/head"
type
BigFile
struct
{
// BigFile
Head
represents "/bigfile/<bigfileX>/head"
type
BigFile
Head
struct
{
nodefs
.
Node
x
*
BigFileX
...
...
@@ -282,10 +282,17 @@ type BigFile struct {
//inv *BigFileInvalidations
}
// BigFileData represents "/bigfile/<bigfileX>/head/data"
type
BigFileData
struct
{
// BigFile represents "/bigfile/<bigfileX>/head/data"
// XXX also @<tidX>/data ?
type
BigFile
struct
{
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 {
func
NewBigFile
(
x
*
BigFileX
)
*
BigFile
{
f
:=
&
BigFile
{
Node
:
nodefs
.
NewDefaultNode
(),
x
:
x
}
f
.
data
=
NewBigFile
Data
(
f
)
func
NewBigFile
Head
(
x
*
BigFileX
)
*
BigFileHead
{
f
:=
&
BigFile
Head
{
Node
:
nodefs
.
NewDefaultNode
(),
x
:
x
}
f
.
data
=
NewBigFile
(
f
)
// XXX + .at
...
...
@@ -322,8 +329,8 @@ func NewBigFile(x *BigFileX) *BigFile {
}
func
NewBigFile
Data
(
head
*
BigFile
)
*
BigFileData
{
return
&
BigFile
Data
{
Node
:
nodefs
.
NewDefaultNode
(),
head
:
head
}
func
NewBigFile
(
head
*
BigFileHead
)
*
BigFile
{
return
&
BigFile
{
Node
:
nodefs
.
NewDefaultNode
(),
head
:
head
}
}
...
...
@@ -352,13 +359,13 @@ func (br *BigFileRoot) Mkdir(name string, mode uint32, _ *fuse.Context) (*nodefs
bx
:=
NewBigFileX
(
oid
,
br
)
br
.
tab
[
oid
]
=
bx
b
f
:=
NewBigFile
(
bx
)
b
h
:=
NewBigFileHead
(
bx
)
mkdir
(
br
,
name
,
bx
)
// XXX takes treeLock - ok under br.mu ?
mkdir
(
bx
,
"head"
,
b
f
)
mkfile
(
b
f
,
"data"
,
bf
.
data
)
// XXX mkfile(b
f, "at", bf
.at)
// XXX mkfile(b
f, "invalidations", bf
.inv)
mkdir
(
bx
,
"head"
,
b
h
)
mkfile
(
b
h
,
"data"
,
bh
.
data
)
// XXX mkfile(b
h, "at", bh
.at)
// XXX mkfile(b
h, "invalidations", bh
.inv)
return
bx
.
Inode
(),
fuse
.
OK
}
...
...
@@ -366,6 +373,29 @@ func (br *BigFileRoot) Mkdir(name string, mode uint32, _ *fuse.Context) (*nodefs
// 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 ?
...
...
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