diff options
author | Jakob Unterwurzacher | 2017-03-18 16:01:50 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2017-03-18 16:18:00 +0100 |
commit | 00df0771e3dd9fba0992cbc9a7d347f25aff856a (patch) | |
tree | 62c7a234184413ffd8250579d0c7935aa2941553 /internal/fusefrontend/fs.go | |
parent | 14038a1644f17f50b113a05d09a2a0a3b3e973b2 (diff) |
serialize_reads: add read serialization logic
Due to kernel readahead, we usually get multiple read requests
at the same time. These get submitted to the backing storage in
random order, which is a problem if seeking is very expensive.
Details: https://github.com/rfjakob/gocryptfs/issues/92
Diffstat (limited to 'internal/fusefrontend/fs.go')
-rw-r--r-- | internal/fusefrontend/fs.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/fusefrontend/fs.go b/internal/fusefrontend/fs.go index 9ffcff1..28c43b6 100644 --- a/internal/fusefrontend/fs.go +++ b/internal/fusefrontend/fs.go @@ -17,6 +17,7 @@ import ( "github.com/rfjakob/gocryptfs/internal/contentenc" "github.com/rfjakob/gocryptfs/internal/cryptocore" "github.com/rfjakob/gocryptfs/internal/nametransform" + "github.com/rfjakob/gocryptfs/internal/serialize_reads" "github.com/rfjakob/gocryptfs/internal/syscallcompat" "github.com/rfjakob/gocryptfs/internal/tlog" ) @@ -43,6 +44,10 @@ func NewFS(args Args) *FS { contentEnc := contentenc.New(cryptoCore, contentenc.DefaultBS) nameTransform := nametransform.New(cryptoCore.EMECipher, args.LongNames, args.Raw64) + if args.SerializeReads { + serialize_reads.Init() + } + return &FS{ FileSystem: pathfs.NewLoopbackFileSystem(args.Cipherdir), args: args, |