aboutsummaryrefslogtreecommitdiff
path: root/pkg/mountmanager/socket.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/mountmanager/socket.go')
-rw-r--r--pkg/mountmanager/socket.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/pkg/mountmanager/socket.go b/pkg/mountmanager/socket.go
new file mode 100644
index 0000000..bd63146
--- /dev/null
+++ b/pkg/mountmanager/socket.go
@@ -0,0 +1,16 @@
+package mountmanager
+
+import (
+ "fmt"
+
+ "github.com/seaweedfs/seaweedfs/weed/util"
+)
+
+// LocalSocketPath returns the unix socket path used to communicate with the weed mount process.
+func LocalSocketPath(volumeID string) string {
+ hash := util.HashToInt32([]byte(volumeID))
+ if hash < 0 {
+ hash = -hash
+ }
+ return fmt.Sprintf("/tmp/seaweedfs-mount-%d.sock", hash)
+}