Commit 8a124b5b authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f13aa600
...@@ -80,8 +80,14 @@ func err2LogStatus(err error) fuse.Status { ...@@ -80,8 +80,14 @@ func err2LogStatus(err error) fuse.Status {
return fuse.Status(ecode) 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 // otherwise log as warnings EINVAL and as errors everything else
switch errors.Cause(err).(type) { switch e.(type) {
case *eInvalError: case *eInvalError:
log.WarningDepth(1, err) log.WarningDepth(1, err)
return fuse.EINVAL return fuse.EINVAL
...@@ -93,16 +99,6 @@ func err2LogStatus(err error) fuse.Status { ...@@ -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. // fsNode should be used instead of nodefs.DefaultNode in wcfs.
// //
// nodefs.DefaultNode.Open returns ENOSYS. This is convenient for filesystems // nodefs.DefaultNode.Open returns ENOSYS. This is convenient for filesystems
...@@ -331,7 +327,7 @@ func (sk *FileSock) File() nodefs.File { ...@@ -331,7 +327,7 @@ func (sk *FileSock) File() nodefs.File {
// if it was a socket. // if it was a socket.
return &nodefs.WithFlags{ return &nodefs.WithFlags{
File: sk.file, 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) ...@@ -543,7 +539,7 @@ func (r *Root) zopenAt(ctx context.Context, rev zodb.Tid) (_ *ZConn, err error)
return nil, err return nil, err
} }
// relock revTab and either register zconn, or returun another zconn2, // relock revTab and either register zconn, or return another zconn2,
// that might have been opened while we were not holding revMu. // that might have been opened while we were not holding revMu.
r.revMu.Lock() r.revMu.Lock()
defer r.revMu.Unlock() defer r.revMu.Unlock()
......
...@@ -1027,7 +1027,7 @@ func (f *BigFile) Read(_ nodefs.File, dest []byte, off int64, fctx *fuse.Context ...@@ -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 dest = make([]byte, aend - aoff) // ~> [aoff:aend) in file
// XXX better ctx = transaction.PutIntoContext(ctx, txn) // 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() defer cancel()
// read/load all block(s) in parallel // read/load all block(s) in parallel
...@@ -1327,7 +1327,7 @@ func (w *Watcher) _serve() (err error) { ...@@ -1327,7 +1327,7 @@ func (w *Watcher) _serve() (err error) {
oid, at, err := parseWatch(msg) oid, at, err := parseWatch(msg)
if err != nil { if err != nil {
// XXX write to peer too // XXX write to peer too
return fmt.Errorf("rx %d: %s", err) return fmt.Errorf("rx %d: %s", stream, err)
} }
_ = oid _ = oid
...@@ -1381,7 +1381,7 @@ func (bfdir *BigFileDir) lookup(out *fuse.Attr, name string, fctx *fuse.Context) ...@@ -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 // 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 { if err != nil {
return nil, err return nil, err
} }
...@@ -1440,9 +1440,8 @@ func (root *Root) lookup(name string, fctx *fuse.Context) (_ *Head, err error) { ...@@ -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 // not there - without revMu lock proceed to open @rev view of ZODB
ctx := asctx(fctx) // zconnRev, err := root.zopenAt(fctx, rev)
// zconnRev, err := root.zopenAt(ctx, rev) zconnRev, err := zopen(fctx, root.zdb, &zodb.ConnOptions{At: rev})
zconnRev, err := zopen(ctx, root.zdb, &zodb.ConnOptions{At: rev})
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment