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
8a124b5b
Commit
8a124b5b
authored
Mar 27, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f13aa600
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
19 deletions
+14
-19
wcfs/misc.go
wcfs/misc.go
+9
-13
wcfs/wcfs.go
wcfs/wcfs.go
+5
-6
No files found.
wcfs/misc.go
View file @
8a124b5b
...
...
@@ -80,8 +80,14 @@ func err2LogStatus(err error) fuse.Status {
return
fuse
.
Status
(
ecode
)
}
// handling canceled -> EINTR, don't log
e
:=
errors
.
Cause
(
err
)
if
e
==
context
.
Canceled
{
return
fuse
.
EINTR
}
// otherwise log as warnings EINVAL and as errors everything else
switch
e
rrors
.
Cause
(
err
)
.
(
type
)
{
switch
e
.
(
type
)
{
case
*
eInvalError
:
log
.
WarningDepth
(
1
,
err
)
return
fuse
.
EINVAL
...
...
@@ -93,16 +99,6 @@ func err2LogStatus(err error) fuse.Status {
}
// asctx represents fuse context as context.Context ready for interrupt handling.
//
// XXX temp. only after proper interrupt handling is not yet merged into go-fuse.
// https://github.com/hanwen/go-fuse/pull/15
func
asctx
(
fctx
*
fuse
.
Context
)
context
.
Context
{
// FIXME stub
return
context
.
Background
()
}
// fsNode should be used instead of nodefs.DefaultNode in wcfs.
//
// nodefs.DefaultNode.Open returns ENOSYS. This is convenient for filesystems
...
...
@@ -331,7 +327,7 @@ func (sk *FileSock) File() nodefs.File {
// if it was a socket.
return
&
nodefs
.
WithFlags
{
File
:
sk
.
file
,
FuseFlags
:
fuse
.
FOPEN_NONSEEKABLE
|
fuse
.
FOPEN_DIRECT_IO
,
FuseFlags
:
fuse
.
FOPEN_
STREAM
|
fuse
.
FOPEN_
NONSEEKABLE
|
fuse
.
FOPEN_DIRECT_IO
,
}
}
...
...
@@ -543,7 +539,7 @@ func (r *Root) zopenAt(ctx context.Context, rev zodb.Tid) (_ *ZConn, err error)
return nil, err
}
// relock revTab and either register zconn, or retur
u
n another zconn2,
// relock revTab and either register zconn, or return another zconn2,
// that might have been opened while we were not holding revMu.
r.revMu.Lock()
defer r.revMu.Unlock()
...
...
wcfs/wcfs.go
View file @
8a124b5b
...
...
@@ -1027,7 +1027,7 @@ func (f *BigFile) Read(_ nodefs.File, dest []byte, off int64, fctx *fuse.Context
dest
=
make
([]
byte
,
aend
-
aoff
)
// ~> [aoff:aend) in file
// XXX better ctx = transaction.PutIntoContext(ctx, txn)
ctx
,
cancel
:=
xcontext
.
Merge
(
asctx
(
fctx
)
,
f
.
head
.
zconn
.
txnCtx
)
ctx
,
cancel
:=
xcontext
.
Merge
(
fctx
,
f
.
head
.
zconn
.
txnCtx
)
defer
cancel
()
// read/load all block(s) in parallel
...
...
@@ -1327,7 +1327,7 @@ func (w *Watcher) _serve() (err error) {
oid
,
at
,
err
:=
parseWatch
(
msg
)
if
err
!=
nil
{
// XXX write to peer too
return
fmt
.
Errorf
(
"rx %d: %s"
,
err
)
return
fmt
.
Errorf
(
"rx %d: %s"
,
stream
,
err
)
}
_
=
oid
...
...
@@ -1381,7 +1381,7 @@ func (bfdir *BigFileDir) lookup(out *fuse.Attr, name string, fctx *fuse.Context)
}
// not there - without bfdir lock proceed to open BigFile from ZODB
f
,
err
=
bfdir
.
head
.
bigopen
(
asctx
(
fctx
)
,
oid
)
f
,
err
=
bfdir
.
head
.
bigopen
(
fctx
,
oid
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -1440,9 +1440,8 @@ func (root *Root) lookup(name string, fctx *fuse.Context) (_ *Head, err error) {
}
// not there - without revMu lock proceed to open @rev view of ZODB
ctx
:=
asctx
(
fctx
)
// zconnRev, err := root.zopenAt(ctx, rev)
zconnRev
,
err
:=
zopen
(
ctx
,
root
.
zdb
,
&
zodb
.
ConnOptions
{
At
:
rev
})
// zconnRev, err := root.zopenAt(fctx, rev)
zconnRev
,
err
:=
zopen
(
fctx
,
root
.
zdb
,
&
zodb
.
ConnOptions
{
At
:
rev
})
if
err
!=
nil
{
return
nil
,
err
}
...
...
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