support write once read many

fix https://github.com/seaweedfs/seaweedfs/issues/5954
This commit is contained in:
chrislu
2024-09-04 02:25:07 -07:00
parent 18afdb15b6
commit eb02946c97
5 changed files with 15 additions and 2 deletions

View File

@@ -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")

View File

@@ -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