SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
Skip parent directory creation in mount (#4310)
Patrick Schmidt71b33faef092
diff --git a/weed/mount/weedfs_dir_mkrm.go b/weed/mount/weedfs_dir_mkrm.goindex 9f03d81c23..e69c9796ef 100644--- a/weed/mount/weedfs_dir_mkrm.go+++ b/weed/mount/weedfs_dir_mkrm.go@@ -3,14 +3,16 @@ package mountimport ("context""fmt"- "github.com/hanwen/go-fuse/v2/fuse"- "github.com/seaweedfs/seaweedfs/weed/filer"- "github.com/seaweedfs/seaweedfs/weed/glog"- "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb""os""strings""syscall""time"++ "github.com/hanwen/go-fuse/v2/fuse"++ "github.com/seaweedfs/seaweedfs/weed/filer"+ "github.com/seaweedfs/seaweedfs/weed/glog"+ "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb")/** Create a directory@@ -54,9 +56,10 @@ func (wfs *WFS) Mkdir(cancel <-chan struct{}, in *fuse.MkdirIn, name string, outdefer wfs.mapPbIdFromFilerToLocal(newEntry)request := &filer_pb.CreateEntryRequest{- Directory: string(dirFullPath),- Entry: newEntry,- Signatures: []int32{wfs.signature},+ Directory: string(dirFullPath),+ Entry: newEntry,+ Signatures: []int32{wfs.signature},+ SkipCheckParentDirectory: true,}glog.V(1).Infof("mkdir: %v", request)diff --git a/weed/mount/weedfs_link.go b/weed/mount/weedfs_link.goindex cfff69dd9c..15b7e081e4 100644--- a/weed/mount/weedfs_link.go+++ b/weed/mount/weedfs_link.go@@ -2,12 +2,14 @@ package mountimport ("context"+ "syscall"+ "time"+"github.com/hanwen/go-fuse/v2/fuse"+"github.com/seaweedfs/seaweedfs/weed/filer""github.com/seaweedfs/seaweedfs/weed/glog""github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"- "syscall"- "time")/*@@ -72,7 +74,8 @@ func (wfs *WFS) Link(cancel <-chan struct{}, in *fuse.LinkIn, name string, out *HardLinkId: oldEntry.HardLinkId,HardLinkCounter: oldEntry.HardLinkCounter,},- Signatures: []int32{wfs.signature},+ Signatures: []int32{wfs.signature},+ SkipCheckParentDirectory: true,}// apply changes to the filer, and also apply to local metaCachediff --git a/weed/mount/weedfs_symlink.go b/weed/mount/weedfs_symlink.goindex e484c88dbf..8842ec3e6e 100644--- a/weed/mount/weedfs_symlink.go+++ b/weed/mount/weedfs_symlink.go@@ -3,13 +3,15 @@ package mountimport ("context""fmt"+ "os"+ "syscall"+ "time"+"github.com/hanwen/go-fuse/v2/fuse"+"github.com/seaweedfs/seaweedfs/weed/filer""github.com/seaweedfs/seaweedfs/weed/glog""github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"- "os"- "syscall"- "time")/** Create a symbolic link */@@ -42,7 +44,8 @@ func (wfs *WFS) Symlink(cancel <-chan struct{}, header *fuse.InHeader, target stSymlinkTarget: target,},},- Signatures: []int32{wfs.signature},+ Signatures: []int32{wfs.signature},+ SkipCheckParentDirectory: true,}err := wfs.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {