aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authorJakob Unterwurzacher2015-09-06 11:42:01 +0200
committerJakob Unterwurzacher2015-09-06 11:42:01 +0200
commit5f4c9240ca1092b47553fe34b9cc1b7836222b6a (patch)
tree4dd15443b1dd881f7df3ba9d8c4eb81364d0ab65 /frontend
parent58d1e24b7c4eb69376dd0ec230c42ea9aeb70f2d (diff)
Add streaming read and write benchmarks
Run using ./main_benchmark.bash Also, rewrite command line args handling
Diffstat (limited to 'frontend')
-rw-r--r--frontend/fe_file.go2
-rw-r--r--frontend/fe_fs.go10
2 files changed, 6 insertions, 6 deletions
diff --git a/frontend/fe_file.go b/frontend/fe_file.go
index b417227..4679589 100644
--- a/frontend/fe_file.go
+++ b/frontend/fe_file.go
@@ -68,7 +68,7 @@ func (f *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenR
func (f *File) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error {
- fmt.Printf("Read: o=%d l=%d\n", req.Offset, req.Size)
+ cryptfs.Debug.Printf("Read: o=%d l=%d\n", req.Offset, req.Size)
// Read the backing ciphertext in one go
iblocks := f.crfs.SplitRange(uint64(req.Offset), uint64(req.Size))
diff --git a/frontend/fe_fs.go b/frontend/fe_fs.go
index 4d49194..d1fa5b1 100644
--- a/frontend/fe_fs.go
+++ b/frontend/fe_fs.go
@@ -27,17 +27,17 @@ type nullTracer struct {}
func (nullTracer) Trace(op cluefs.FsOperTracer) {}
-func NewFS(key [16]byte, backing string, useOpenssl bool) *FS {
- var nt nullTracer
- clfs, err := cluefs.NewClueFS(backing, nt)
+func NewFS(key [16]byte, backing string, useOpenssl bool) (*FS, error) {
+ var tracer nullTracer
+ clfs, err := cluefs.NewClueFS(backing, tracer)
if err != nil {
- panic(err)
+ return nil, err
}
return &FS {
CryptFS: cryptfs.NewCryptFS(key, useOpenssl),
ClueFS: clfs,
backing: backing,
- }
+ }, nil
}
func (fs *FS) Root() (fusefs.Node, error) {