aboutsummaryrefslogtreecommitdiff
path: root/weed/command/mount_linux.go
blob: b49e7fff2a43b9bc48fcce91132644ed09402866 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package command

import (
	"strings"

	"github.com/chrislusf/seaweedfs/weed/util"
	"github.com/seaweedfs/fuse"
)

func osSpecificMountOptions() []fuse.MountOption {
	return []fuse.MountOption{
		fuse.AllowNonEmptyMount(),
	}
}

func checkMountPointAvailable(dir string) bool {
	mountPoint := dir
	if mountPoint != "/" && strings.HasSuffix(mountPoint, "/") {
		mountPoint = mountPoint[0 : len(mountPoint)-1]
	}

	if mounted, err := util.Mounted(mountPoint); err != nil || mounted {
		return false
	}

	return true
}