aboutsummaryrefslogtreecommitdiff
path: root/weed/command/mount_linux.go
blob: 591951d4f277fc4e2b2ffd8ce6b83aa53604c8fb (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
package command

import (
	"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
}