diff options
| author | Guang Jiong Lou <7991675+27149chen@users.noreply.github.com> | 2024-09-17 12:02:21 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-16 21:02:21 -0700 |
| commit | 6c986e9d70098404832d11d81faf7605b9c742a6 (patch) | |
| tree | cffcf609c9a316f86a680660ec71c6e041a52996 /weed/command | |
| parent | e73ab5c0c49dfbd1870bccbd1e6d694d46fc8d73 (diff) | |
| download | seaweedfs-6c986e9d70098404832d11d81faf7605b9c742a6.tar.xz seaweedfs-6c986e9d70098404832d11d81faf7605b9c742a6.zip | |
improve worm support (#5983)
* improve worm support
Signed-off-by: lou <alex1988@outlook.com>
* worm mode in filer
Signed-off-by: lou <alex1988@outlook.com>
* update after review
Signed-off-by: lou <alex1988@outlook.com>
* update after review
Signed-off-by: lou <alex1988@outlook.com>
* move to fs configure
Signed-off-by: lou <alex1988@outlook.com>
* remove flag
Signed-off-by: lou <alex1988@outlook.com>
* update after review
Signed-off-by: lou <alex1988@outlook.com>
* support worm hardlink
Signed-off-by: lou <alex1988@outlook.com>
* update after review
Signed-off-by: lou <alex1988@outlook.com>
* typo
Signed-off-by: lou <alex1988@outlook.com>
* sync filer conf
Signed-off-by: lou <alex1988@outlook.com>
---------
Signed-off-by: lou <alex1988@outlook.com>
Diffstat (limited to 'weed/command')
| -rw-r--r-- | weed/command/mount.go | 2 | ||||
| -rw-r--r-- | weed/command/mount_std.go | 24 |
2 files changed, 14 insertions, 12 deletions
diff --git a/weed/command/mount.go b/weed/command/mount.go index 594c2833e..3201fbb13 100644 --- a/weed/command/mount.go +++ b/weed/command/mount.go @@ -33,7 +33,6 @@ type MountOptions struct { localSocket *string disableXAttr *bool extraOptions []string - writeOnceReadMany *bool } var ( @@ -71,7 +70,6 @@ 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 53357eba6..0ab794bbd 100644 --- a/weed/command/mount_std.go +++ b/weed/command/mount_std.go @@ -6,6 +6,15 @@ package command import ( "context" "fmt" + "net" + "net/http" + "os" + "os/user" + "runtime" + "strconv" + "strings" + "time" + "github.com/hanwen/go-fuse/v2/fuse" "github.com/seaweedfs/seaweedfs/weed/glog" "github.com/seaweedfs/seaweedfs/weed/mount" @@ -17,14 +26,6 @@ import ( "github.com/seaweedfs/seaweedfs/weed/security" "github.com/seaweedfs/seaweedfs/weed/storage/types" "google.golang.org/grpc/reflection" - "net" - "net/http" - "os" - "os/user" - "runtime" - "strconv" - "strings" - "time" "github.com/seaweedfs/seaweedfs/weed/util" "github.com/seaweedfs/seaweedfs/weed/util/grace" @@ -247,7 +248,6 @@ func RunMount(option *MountOptions, umask os.FileMode) bool { Cipher: cipher, UidGidMapper: uidGidMapper, DisableXAttr: *option.disableXAttr, - WriteOnceReadMany: *option.writeOnceReadMany, }) // create mount root @@ -271,7 +271,11 @@ func RunMount(option *MountOptions, umask os.FileMode) bool { reflection.Register(grpcS) go grpcS.Serve(montSocketListener) - seaweedFileSystem.StartBackgroundTasks() + err = seaweedFileSystem.StartBackgroundTasks() + if err != nil { + fmt.Printf("failed to start background tasks: %v\n", err) + return false + } glog.V(0).Infof("mounted %s%s to %v", *option.filer, mountRoot, dir) glog.V(0).Infof("This is SeaweedFS version %s %s %s", util.Version(), runtime.GOOS, runtime.GOARCH) |
