enhance:add enableBcache to mountoptions.

Signed-off-by: tianjiongzhang <236556116@qq.com>
This commit is contained in:
tianjiongzhang 2022-07-25 19:25:17 +08:00 committed by leonrayang
parent 0d28d123d4
commit 560516a8df

View File

@ -696,7 +696,8 @@ func parseMountOption(cfg *config.Config) (*proto.MountOptions, error) {
opt.ReadThreads = GlobalMountOptions[proto.ReadThreads].GetInt64()
opt.WriteThreads = GlobalMountOptions[proto.WriteThreads].GetInt64()
opt.BcacheDir = GlobalMountOptions[proto.BcacheDir].GetString()
if _, err := os.Stat(bcache.UnixSocketPath); err == nil {
opt.EnableBcache = GlobalMountOptions[proto.EnableBcache].GetBool()
if _, err := os.Stat(bcache.UnixSocketPath); err == nil && !opt.EnableBcache {
opt.EnableBcache = true
}
opt.BuffersTotalLimit = GlobalMountOptions[proto.BuffersTotalLimit].GetInt64()