aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-09-04 02:25:07 -0700
committerchrislu <chris.lu@gmail.com>2024-09-04 02:25:07 -0700
commiteb02946c977be57a0325d9ed86847699e99661c1 (patch)
tree2111c09d45e608fa0ef2a1fa3ff0e2f3f3392183 /weed/command
parent18afdb15b6df2835ca600d566997fa7410e1ec9b (diff)
downloadseaweedfs-eb02946c977be57a0325d9ed86847699e99661c1.tar.xz
seaweedfs-eb02946c977be57a0325d9ed86847699e99661c1.zip
support write once read many
fix https://github.com/seaweedfs/seaweedfs/issues/5954
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/mount.go2
-rw-r--r--weed/command/mount_std.go1
2 files changed, 3 insertions, 0 deletions
diff --git a/weed/command/mount.go b/weed/command/mount.go
index f5972fd30..bdc0638c9 100644
--- a/weed/command/mount.go
+++ b/weed/command/mount.go
@@ -33,6 +33,7 @@ type MountOptions struct {
localSocket *string
disableXAttr *bool
extraOptions []string
+ writeOnceReadMany *bool
}
var (
@@ -70,6 +71,7 @@ func init() {
mountOptions.debugPort = cmdMount.Flag.Int("debug.port", 6061, "http port for debugging")
mountOptions.localSocket = cmdMount.Flag.String("localSocket", "", "default to /tmp/seaweedfs-mount-<mount_dir_hash>.sock")
mountOptions.disableXAttr = cmdMount.Flag.Bool("disableXAttr", false, "disable xattr")
+ mountOptions.writeOnceReadMany = cmdMount.Flag.Bool("writeOnceReadMany", false, "write once, read many times")
mountCpuProfile = cmdMount.Flag.String("cpuprofile", "", "cpu profile output file")
mountMemProfile = cmdMount.Flag.String("memprofile", "", "memory profile output file")
diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go
index f85e7386d..53357eba6 100644
--- a/weed/command/mount_std.go
+++ b/weed/command/mount_std.go
@@ -247,6 +247,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
Cipher: cipher,
UidGidMapper: uidGidMapper,
DisableXAttr: *option.disableXAttr,
+ WriteOnceReadMany: *option.writeOnceReadMany,
})
// create mount root