Skip to content

Commit 6698e8d

Browse files
committed
Block read cache
ref: kahing#758
1 parent 0c6ddc5 commit 6698e8d

18 files changed

+1257
-646
lines changed

.clang-format

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: LLVM
4+
AccessModifierOffset: -4
5+
AlignAfterOpenBracket: Align
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveDeclarations: false
8+
AlignEscapedNewlinesLeft: true
9+
AlignOperands: true
10+
AlignTrailingComments: true
11+
AllowAllParametersOfDeclarationOnNextLine: true
12+
AllowShortBlocksOnASingleLine: false
13+
AllowShortCaseLabelsOnASingleLine: false
14+
AllowShortFunctionsOnASingleLine: Inline
15+
AllowShortIfStatementsOnASingleLine: false
16+
AllowShortLoopsOnASingleLine: false
17+
AlwaysBreakAfterDefinitionReturnType: None
18+
AlwaysBreakAfterReturnType: None
19+
AlwaysBreakBeforeMultilineStrings: true
20+
AlwaysBreakTemplateDeclarations: true
21+
BinPackArguments: true
22+
BinPackParameters: true
23+
BraceWrapping:
24+
AfterClass: false
25+
AfterControlStatement: false
26+
AfterEnum: false
27+
AfterFunction: false
28+
AfterNamespace: false
29+
AfterObjCDeclaration: false
30+
AfterStruct: false
31+
AfterUnion: false
32+
BeforeCatch: false
33+
BeforeElse: false
34+
IndentBraces: false
35+
BreakBeforeBinaryOperators: None
36+
BreakBeforeBraces: Attach
37+
BreakBeforeTernaryOperators: true
38+
BreakConstructorInitializersBeforeComma: false
39+
BreakAfterJavaFieldAnnotations: false
40+
BreakStringLiterals: true
41+
ColumnLimit: 80
42+
CommentPragmas: '^ IWYU pragma:'
43+
CompactNamespaces: false
44+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
45+
ConstructorInitializerIndentWidth: 8
46+
ContinuationIndentWidth: 8
47+
Cpp11BracedListStyle: true
48+
DerivePointerAlignment: false
49+
DisableFormat: false
50+
ExperimentalAutoDetectBinPacking: false
51+
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
52+
IncludeCategories:
53+
- Regex: '^<.*\.h>'
54+
Priority: 1
55+
- Regex: '^<.*'
56+
Priority: 2
57+
- Regex: '.*'
58+
Priority: 3
59+
IncludeIsMainRegex: '([-_](test|unittest))?$'
60+
IndentCaseLabels: true
61+
IndentWidth: 4
62+
IndentWrappedFunctionNames: false
63+
JavaScriptQuotes: Leave
64+
JavaScriptWrapImports: true
65+
KeepEmptyLinesAtTheStartOfBlocks: false
66+
MacroBlockBegin: ''
67+
MacroBlockEnd: ''
68+
MaxEmptyLinesToKeep: 1
69+
NamespaceIndentation: None
70+
ObjCBlockIndentWidth: 2
71+
ObjCSpaceAfterProperty: false
72+
ObjCSpaceBeforeProtocolList: false
73+
PenaltyBreakBeforeFirstCallParameter: 1
74+
PenaltyBreakComment: 300
75+
PenaltyBreakFirstLessLess: 120
76+
PenaltyBreakString: 1000
77+
PenaltyExcessCharacter: 1000000
78+
PenaltyReturnTypeOnItsOwnLine: 200
79+
PointerAlignment: Left
80+
ReflowComments: true
81+
SortIncludes: true
82+
SpaceAfterCStyleCast: false
83+
SpaceBeforeAssignmentOperators: true
84+
SpaceBeforeParens: ControlStatements
85+
SpaceInEmptyParentheses: false
86+
SpacesBeforeTrailingComments: 2
87+
SpacesInAngles: false
88+
SpacesInContainerLiterals: true
89+
SpacesInCStyleCastParentheses: false
90+
SpacesInParentheses: false
91+
SpacesInSquareBrackets: false
92+
Standard: Auto
93+
TabWidth: 8
94+
UseTab: Never
95+
...

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ goofys
33
goofys.test
44
xout
55
s3proxy.jar
6+
/s3proxy.sh
7+
/mnt

api/api.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ func Mount(
4040
fuseLog.Level = logrus.DebugLevel
4141
log.Level = logrus.DebugLevel
4242
mountCfg.DebugLogger = GetStdLogger(fuseLog, logrus.DebugLevel)
43+
} else {
44+
GetLogger("fuse").Level = logrus.InfoLevel
4345
}
4446

4547
if flags.Backend == nil {

api/common/config.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,14 @@ type FlagStorage struct {
4545
Backend interface{}
4646

4747
// Tuning
48-
Cheap bool
49-
ExplicitDir bool
50-
StatCacheTTL time.Duration
51-
TypeCacheTTL time.Duration
52-
HTTPTimeout time.Duration
48+
Cheap bool
49+
ExplicitDir bool
50+
BlockReadCache bool
51+
BlockReadCacheSize uint64
52+
BlockReadCacheMemRatio float64
53+
StatCacheTTL time.Duration
54+
TypeCacheTTL time.Duration
55+
HTTPTimeout time.Duration
5356

5457
// Debugging
5558
DebugFuse bool

go.mod

Lines changed: 66 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,77 @@
11
module github.com/kahing/goofys
22

3-
go 1.14
3+
go 1.20
44

55
require (
6-
cloud.google.com/go/storage v1.14.0
6+
cloud.google.com/go/storage v1.30.1
77
github.com/Azure/azure-pipeline-go v0.2.3
8-
github.com/Azure/azure-sdk-for-go v61.4.0+incompatible
9-
github.com/Azure/azure-storage-blob-go v0.14.0
10-
github.com/Azure/go-autorest/autorest v0.11.18
11-
github.com/Azure/go-autorest/autorest/adal v0.9.13
12-
github.com/Azure/go-autorest/autorest/azure/auth v0.5.7
13-
github.com/Azure/go-autorest/autorest/azure/cli v0.4.2
14-
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
15-
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
16-
github.com/aws/aws-sdk-go v1.44.37
17-
github.com/gofrs/uuid v4.2.0+incompatible
18-
github.com/google/uuid v1.2.0
19-
github.com/gopherjs/gopherjs v0.0.0-20210413103415-7d3cbed7d026 // indirect
20-
github.com/jacobsa/fuse v0.0.0-20221016084658-a4cd154343d8
8+
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible
9+
github.com/Azure/azure-storage-blob-go v0.15.0
10+
github.com/Azure/go-autorest/autorest v0.11.29
11+
github.com/Azure/go-autorest/autorest/adal v0.9.23
12+
github.com/Azure/go-autorest/autorest/azure/auth v0.5.12
13+
github.com/Azure/go-autorest/autorest/azure/cli v0.4.6
14+
github.com/aws/aws-sdk-go v1.44.278
15+
github.com/gofrs/uuid v4.4.0+incompatible
16+
github.com/google/uuid v1.3.0
17+
github.com/jacobsa/fuse v0.0.0-20230509090321-7263f3a2b474
2118
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0
2219
github.com/mitchellh/go-homedir v1.1.0
23-
github.com/sevlyar/go-daemon v0.1.5
20+
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
21+
github.com/sevlyar/go-daemon v0.1.6
2422
github.com/shirou/gopsutil/v3 v3.24.5
25-
github.com/sirupsen/logrus v1.4.3-0.20190807103436-de736cf91b92
26-
github.com/smartystreets/assertions v1.2.0 // indirect
27-
github.com/urfave/cli v1.21.1-0.20190807111034-521735b7608a
28-
golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558
29-
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
23+
github.com/sirupsen/logrus v1.9.3
24+
github.com/urfave/cli v1.22.13
25+
golang.org/x/oauth2 v0.8.0
26+
golang.org/x/sync v0.2.0
3027
golang.org/x/sys v0.20.0
31-
google.golang.org/api v0.43.0
28+
google.golang.org/api v0.125.0
3229
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
33-
gopkg.in/ini.v1 v1.51.0
30+
gopkg.in/ini.v1 v1.67.0
31+
)
32+
33+
require (
34+
cloud.google.com/go v0.110.0 // indirect
35+
cloud.google.com/go/compute v1.19.3 // indirect
36+
cloud.google.com/go/compute/metadata v0.2.3 // indirect
37+
cloud.google.com/go/iam v0.13.0 // indirect
38+
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
39+
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
40+
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
41+
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
42+
github.com/Azure/go-autorest/logger v0.2.1 // indirect
43+
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
44+
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
45+
github.com/dimchansky/utfbom v1.1.1 // indirect
46+
github.com/go-ole/go-ole v1.2.6 // indirect
47+
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
48+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
49+
github.com/golang/protobuf v1.5.3 // indirect
50+
github.com/google/go-cmp v0.6.0 // indirect
51+
github.com/google/s2a-go v0.1.4 // indirect
52+
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
53+
github.com/googleapis/gax-go/v2 v2.10.0 // indirect
54+
github.com/hashicorp/golang-lru/v2 v2.0.7
55+
github.com/jmespath/go-jmespath v0.4.0 // indirect
56+
github.com/kr/pretty v0.2.1 // indirect
57+
github.com/kr/text v0.1.0 // indirect
58+
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
59+
github.com/mattn/go-ieproxy v0.0.1 // indirect
60+
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
61+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
62+
github.com/shoenig/go-m1cpu v0.1.6 // indirect
63+
github.com/tklauser/go-sysconf v0.3.12 // indirect
64+
github.com/tklauser/numcpus v0.6.1 // indirect
65+
github.com/yusufpapurcu/wmi v1.2.4 // indirect
66+
go.opencensus.io v0.24.0 // indirect
67+
golang.org/x/crypto v0.9.0 // indirect
68+
golang.org/x/net v0.10.0 // indirect
69+
golang.org/x/text v0.9.0 // indirect
70+
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
71+
google.golang.org/appengine v1.6.7 // indirect
72+
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect
73+
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
74+
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
75+
google.golang.org/grpc v1.55.0 // indirect
76+
google.golang.org/protobuf v1.30.0 // indirect
3477
)

0 commit comments

Comments
 (0)