From f94e49a8ba04e83e632b683bd0dba86ad55da309 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 28 Aug 2014 08:08:59 +1000 Subject: [PATCH] Make use of FUSE readahead --- fs/torrentfs.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/fs/torrentfs.go b/fs/torrentfs.go index 41877908..3d712a19 100644 --- a/fs/torrentfs.go +++ b/fs/torrentfs.go @@ -30,7 +30,18 @@ type torrentFS struct { mu sync.Mutex } -var _ fusefs.FSDestroyer = &torrentFS{} +var ( + _ fusefs.FSDestroyer = &torrentFS{} + _ fusefs.FSIniter = &torrentFS{} +) + +func (fs *torrentFS) Init(req *fuse.InitRequest, resp *fuse.InitResponse, intr fusefs.Intr) fuse.Error { + log.Print(req) + log.Print(resp) + resp.MaxReadahead = req.MaxReadahead + resp.Flags |= fuse.InitAsyncRead + return nil +} var _ fusefs.NodeForgetter = rootNode{} -- 2.48.1