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
61d438a4
Commit
61d438a4
authored
Oct 02, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
ac777ea5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
16 deletions
+24
-16
wcfs/wcfs.go
wcfs/wcfs.go
+22
-14
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+2
-2
No files found.
wcfs/wcfs.go
View file @
61d438a4
...
...
@@ -294,11 +294,11 @@ type BigFileHead struct {
//x *BigFileDir
data
*
BigFileData
at
*
BigFileAt
//
at *BigFileAt
//inv *BigFileInvalidations
}
// BigFile is
internal object for
"/bigfile/<bigfileX>/<rev>/{data,at}"
// BigFile is
object that serves
"/bigfile/<bigfileX>/<rev>/{data,at}"
type
BigFile
struct
{
// current read-only transaction under which we access ZODB data
txnCtx
context
.
Context
// XXX -> better directly store txn
...
...
@@ -321,12 +321,12 @@ type BigFileData struct {
bigfile
*
BigFile
}
// BigFileAt represents "/bigfile/<bigfileX>/head/at"
type
BigFileAt
struct
{
nodefs
.
Node
bigfile
*
BigFile
}
//
//
BigFileAt represents "/bigfile/<bigfileX>/head/at"
//
type BigFileAt struct {
//
nodefs.Node
//
//
bigfile *BigFile
//
}
// /bigfile -> Mkdir receives client request to create /bigfile/<bigfileX>.
...
...
@@ -434,13 +434,13 @@ func (bfroot *BigFileRoot) Mkdir(name string, mode uint32, fctx *fuse.Context) (
bigfile
:
bf
,
}
bfat
:=
&
BigFileAt
{
Node
:
nodefs
.
NewDefaultNode
(),
bigfile
:
bf
,
}
//
bfat := &BigFileAt{
//
Node: nodefs.NewDefaultNode(),
//
bigfile: bf,
//
}
bfhead
.
data
=
bfdata
bfhead
.
at
=
bfat
//
bfhead.at = bfat
bfroot
.
tab
[
oid
]
=
bfdir
bfroot
.
mu
.
Unlock
()
...
...
@@ -449,7 +449,7 @@ func (bfroot *BigFileRoot) Mkdir(name string, mode uint32, fctx *fuse.Context) (
mkdir
(
bfroot
,
name
,
bfdir
)
mkdir
(
bfdir
,
"head"
,
bfhead
)
mkfile
(
bfhead
,
"data"
,
bfdata
)
mkfile
(
bfhead
,
"at"
,
bfat
)
mkfile
(
bfhead
,
"at"
,
NewSmallFile
(
bf
.
readAt
)
)
// XXX mkfile(bh, "invalidations", bh.inv)
return
bfdir
.
Inode
(),
fuse
.
OK
...
...
@@ -485,6 +485,14 @@ func (bf *BigFileData) Read(_ nodefs.File, dest []byte, off int64, _ fuse.Contex
}
*/
// /bigfile/<bigfileX>/head/at -> served by readAt.
func
(
bf
*
BigFile
)
readAt
()
[]
byte
{
// XXX locking
// XXX zconn -> zbf.PJar() ?
return
[]
byte
(
bf
.
zconn
.
At
()
.
String
())
}
...
...
wcfs/wcfs_test.py
View file @
61d438a4
...
...
@@ -154,8 +154,8 @@ def test_bigfile_empty():
assert
st
.
st_size
==
0
assert
st
.
st_mtime
==
tidtime
(
tid1
)
assert
readfile
(
fpath
+
"/head/at"
)
==
'txn2'
# XXX head/at = last txn of whole db
# head/at = last txn of whole db
assert
readfile
(
fpath
+
"/head/at"
)
==
tid2
.
encode
(
'hex'
)
wc
.
close
()
...
...
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