github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/kbfs/libfuse/mounter_non_osx.go (about)

     1  // Copyright 2016 Keybase Inc. All rights reserved.
     2  // Use of this source code is governed by a BSD
     3  // license that can be found in the LICENSE file.
     4  //
     5  //go:build !darwin && !windows
     6  // +build !darwin,!windows
     7  
     8  package libfuse
     9  
    10  import (
    11  	"context"
    12  
    13  	"bazil.org/fuse"
    14  	"github.com/keybase/client/go/logger"
    15  )
    16  
    17  func getPlatformSpecificMountOptions(dir string, platformParams PlatformParams) ([]fuse.MountOption, error) {
    18  	options := []fuse.MountOption{}
    19  	options = append(options, fuse.MaxReadahead(500*1024))
    20  	options = append(options, fuse.AsyncRead())
    21  	return options, nil
    22  }
    23  
    24  // GetPlatformSpecificMountOptionsForTest makes cross-platform tests work
    25  func GetPlatformSpecificMountOptionsForTest() []fuse.MountOption {
    26  	return []fuse.MountOption{}
    27  }
    28  
    29  func translatePlatformSpecificError(err error, platformParams PlatformParams) error {
    30  	return err
    31  }
    32  
    33  func (m *mounter) reinstallMountDirIfPossible() {
    34  	// no-op
    35  }
    36  
    37  var noop = func() {}
    38  
    39  func wrapCtxWithShorterTimeoutForUnmount(
    40  	ctx context.Context, _ logger.Logger, _ int) (
    41  	newCtx context.Context, maybeUnmounting bool, cancel context.CancelFunc) {
    42  	return ctx, false, noop
    43  }