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
00110399
Commit
00110399
authored
Dec 19, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2a4703b2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
17 deletions
+19
-17
bigfile/_bigfile.c
bigfile/_bigfile.c
+2
-0
wcfs/misc.go
wcfs/misc.go
+10
-10
wcfs/wcfs.go
wcfs/wcfs.go
+7
-7
No files found.
bigfile/_bigfile.c
View file @
00110399
...
...
@@ -905,6 +905,8 @@ out:
/* PyBigFile: mmap methods.
* They redirect op X to type.blkmmapper.X without going to Python level */
// XXX make sure not to hold the GIL ?
static
void
*
pybigfile_mmap_setup_read
(
VMA
*
vma
,
BigFile
*
file0
,
blk_t
blk
,
size_t
blklen
)
{
...
...
wcfs/misc.go
View file @
00110399
...
...
@@ -130,7 +130,7 @@ type fsNode struct {
xpath
atomic
.
Value
}
func
(
n
*
fsNode
)
Open
(
flags
uint32
,
fctx
*
fuse
.
Context
)
(
nodefs
.
File
,
fuse
.
Status
)
{
func
(
n
*
fsNode
)
Open
(
flags
uint32
,
_
*
fuse
.
Context
)
(
nodefs
.
File
,
fuse
.
Status
)
{
return
&
nodefs
.
WithFlags
{
File
:
nil
,
FuseFlags
:
fuse
.
FOPEN_KEEP_CACHE
,
...
...
@@ -215,22 +215,22 @@ func NewSmallFile(readData func() []byte) *SmallFile {
return
newSmallFile
(
readData
,
fuse
.
FOPEN_DIRECT_IO
)
}
func
(
f
*
SmallFile
)
Open
(
flags
uint32
,
fctx
*
fuse
.
Context
)
(
nodefs
.
File
,
fuse
.
Status
)
{
func
(
f
*
SmallFile
)
Open
(
flags
uint32
,
_
*
fuse
.
Context
)
(
nodefs
.
File
,
fuse
.
Status
)
{
return
&
nodefs
.
WithFlags
{
File
:
nil
,
FuseFlags
:
f
.
fuseFlags
,
},
fuse
.
OK
}
func
(
f
*
SmallFile
)
GetAttr
(
out
*
fuse
.
Attr
,
_
nodefs
.
File
,
_
*
fuse
.
Context
)
fuse
.
Status
{
data
:=
f
.
readData
()
func
(
f
*
SmallFile
)
GetAttr
(
out
*
fuse
.
Attr
,
_
nodefs
.
File
,
fctx
*
fuse
.
Context
)
fuse
.
Status
{
data
:=
f
.
readData
()
// XXX pass in fctx, so that the call could be canceled
out
.
Size
=
uint64
(
len
(
data
))
out
.
Mode
=
fuse
.
S_IFREG
|
0644
return
fuse
.
OK
}
func
(
f
*
SmallFile
)
Read
(
_
nodefs
.
File
,
dest
[]
byte
,
off
int64
,
_
*
fuse
.
Context
)
(
fuse
.
ReadResult
,
fuse
.
Status
)
{
data
:=
f
.
readData
()
func
(
f
*
SmallFile
)
Read
(
_
nodefs
.
File
,
dest
[]
byte
,
off
int64
,
fctx
*
fuse
.
Context
)
(
fuse
.
ReadResult
,
fuse
.
Status
)
{
data
:=
f
.
readData
()
// XXX +fctx -> cancel
l
:=
int64
(
len
(
data
))
end
:=
off
+
l
if
end
>
l
{
...
...
@@ -339,8 +339,8 @@ func (sk *FileSock) Write(data []byte) (n int, err error) {
}
// Read implements nodefs.File and is paired with filesock.Write().
func
(
f
*
skFile
)
Read
(
dest
[]
byte
,
/*ignored*/
off
int64
)
(
fuse
.
ReadResult
,
fuse
.
Status
)
{
n
,
err
:=
f
.
rx
.
Read
(
dest
)
func
(
f
*
skFile
)
Read
(
dest
[]
byte
,
/*ignored*/
off
int64
,
fctx
*
fuse
.
Context
)
(
fuse
.
ReadResult
,
fuse
.
Status
)
{
n
,
err
:=
f
.
rx
.
Read
(
dest
)
// XXX fctx.cancel
if
n
!=
0
{
err
=
nil
}
...
...
@@ -365,7 +365,7 @@ func (sk *FileSock) Read(dest []byte) (n int, err error) {
}
// Write implements nodefs.File and is paired with filesock.Read()
func
(
f
*
skFile
)
Write
(
data
[]
byte
,
/*ignored*/
off
int64
)
(
uint32
,
fuse
.
Status
)
{
func
(
f
*
skFile
)
Write
(
data
[]
byte
,
/*ignored*/
off
int64
,
fctx
*
fuse
.
Context
)
(
uint32
,
fuse
.
Status
)
{
// cap data to 2GB (not 4GB not to overflow int on 32-bit platforms)
l
:=
len
(
data
)
if
l
>
math
.
MaxInt32
{
...
...
@@ -373,7 +373,7 @@ func (f *skFile) Write(data []byte, /*ignored*/off int64) (uint32, fuse.Status)
data
=
data
[
:
l
]
}
n
,
err
:=
f
.
tx
.
Write
(
data
)
n
,
err
:=
f
.
tx
.
Write
(
data
)
// XXX fctx.cancel
if
n
!=
0
{
err
=
nil
}
...
...
wcfs/wcfs.go
View file @
00110399
...
...
@@ -1126,7 +1126,7 @@ func (root *Root) lockRevFile(rev zodb.Tid, fid zodb.Oid) (_ *BigFile, unlock fu
// /(head|<rev>)/bigfile/<bigfileX> -> Read serves reading bigfile data.
func
(
f
*
BigFile
)
Read
(
_
nodefs
.
File
,
dest
[]
byte
,
off
int64
,
fctx
*
fuse
.
Context
)
(
fuse
.
ReadResult
,
fuse
.
Status
)
{
f
.
head
.
zheadMu
.
RLock
()
f
.
head
.
zheadMu
.
RLock
()
// XXX +fctx to cancel
defer
f
.
head
.
zheadMu
.
RUnlock
()
// cap read request to file size
...
...
@@ -1941,7 +1941,7 @@ func (bfdir *BigFileDir) lookup(out *fuse.Attr, name string, fctx *fuse.Context)
return
nil
,
eINVALf
(
"not oid"
)
}
bfdir
.
head
.
zheadMu
.
RLock
()
bfdir
.
head
.
zheadMu
.
RLock
()
// XXX +fctx -> cancel
defer
bfdir
.
head
.
zheadMu
.
RUnlock
()
defer
func
()
{
...
...
@@ -2160,10 +2160,10 @@ func (h *Head) readAt() []byte {
}
// /(head|<rev>)/ -> Getattr serves stat.
func
(
head
*
Head
)
GetAttr
(
out
*
fuse
.
Attr
,
_
nodefs
.
File
,
_
*
fuse
.
Context
)
fuse
.
Status
{
func
(
head
*
Head
)
GetAttr
(
out
*
fuse
.
Attr
,
_
nodefs
.
File
,
fctx
*
fuse
.
Context
)
fuse
.
Status
{
at
:=
head
.
rev
if
at
==
0
{
head
.
zheadMu
.
RLock
()
head
.
zheadMu
.
RLock
()
// XXX +fctx -> cancel
at
=
head
.
zconn
.
At
()
head
.
zheadMu
.
RUnlock
()
}
...
...
@@ -2175,8 +2175,8 @@ func (head *Head) GetAttr(out *fuse.Attr, _ nodefs.File, _ *fuse.Context) fuse.S
}
// /(head|<rev>)/bigfile/<bigfileX> -> Getattr serves stat.
func
(
f
*
BigFile
)
GetAttr
(
out
*
fuse
.
Attr
,
_
nodefs
.
File
,
_
*
fuse
.
Context
)
fuse
.
Status
{
f
.
head
.
zheadMu
.
RLock
()
func
(
f
*
BigFile
)
GetAttr
(
out
*
fuse
.
Attr
,
_
nodefs
.
File
,
fctx
*
fuse
.
Context
)
fuse
.
Status
{
f
.
head
.
zheadMu
.
RLock
()
// XXX +fctx -> cancel
defer
f
.
head
.
zheadMu
.
RUnlock
()
f
.
getattr
(
out
)
...
...
@@ -2235,7 +2235,7 @@ func (zh *_wcfs_Zhead) Open(flags uint32, fctx *fuse.Context) (nodefs.File, fuse
sk
:=
NewFileSock
()
sk
.
CloseRead
()
groot
.
head
.
zheadMu
.
Lock
()
groot
.
head
.
zheadMu
.
Lock
()
// XXX +fctx -> cancel
defer
groot
.
head
.
zheadMu
.
Unlock
()
// XXX del zheadSockTab[sk] on sk.File.Release (= client drops opened handle)
...
...
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