diff options
| author | hasagi <30975629+LIBA-S@users.noreply.github.com> | 2020-09-22 21:38:38 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-22 21:38:38 +0800 |
| commit | d7bf2390e2bf4ac55132878faa68119b3558e8e4 (patch) | |
| tree | 48ede45893c2130d3e039f7fe4af8440835eb02d /weed/filesys/dir_link.go | |
| parent | 37e964d4bd60a9dd792a9cc24f05eaa05d3766f2 (diff) | |
| parent | ec5b9f1e91a8609d0e70bf9d26dc0840774153c4 (diff) | |
| download | seaweedfs-d7bf2390e2bf4ac55132878faa68119b3558e8e4.tar.xz seaweedfs-d7bf2390e2bf4ac55132878faa68119b3558e8e4.zip | |
Merge pull request #1 from chrislusf/master
catch up
Diffstat (limited to 'weed/filesys/dir_link.go')
| -rw-r--r-- | weed/filesys/dir_link.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/weed/filesys/dir_link.go b/weed/filesys/dir_link.go index 4990e743c..486dd0c9b 100644 --- a/weed/filesys/dir_link.go +++ b/weed/filesys/dir_link.go @@ -6,7 +6,7 @@ import ( "syscall" "time" - "github.com/chrislusf/seaweedfs/weed/filer2" + "github.com/chrislusf/seaweedfs/weed/filer" "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/seaweedfs/fuse" @@ -18,7 +18,7 @@ var _ = fs.NodeReadlinker(&File{}) func (dir *Dir) Symlink(ctx context.Context, req *fuse.SymlinkRequest) (fs.Node, error) { - glog.V(3).Infof("Symlink: %v/%v to %v", dir.FullPath(), req.NewName, req.Target) + glog.V(4).Infof("Symlink: %v/%v to %v", dir.FullPath(), req.NewName, req.Target) request := &filer_pb.CreateEntryRequest{ Directory: dir.FullPath(), @@ -34,15 +34,20 @@ func (dir *Dir) Symlink(ctx context.Context, req *fuse.SymlinkRequest) (fs.Node, SymlinkTarget: req.Target, }, }, + Signatures: []int32{dir.wfs.signature}, } err := dir.wfs.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error { + + dir.wfs.mapPbIdFromLocalToFiler(request.Entry) + defer dir.wfs.mapPbIdFromFilerToLocal(request.Entry) + if err := filer_pb.CreateEntry(client, request); err != nil { glog.V(0).Infof("symlink %s/%s: %v", dir.FullPath(), req.NewName, err) return fuse.EIO } - dir.wfs.metaCache.InsertEntry(context.Background(), filer2.FromPbEntry(request.Directory, request.Entry)) + dir.wfs.metaCache.InsertEntry(context.Background(), filer.FromPbEntry(request.Directory, request.Entry)) return nil }) @@ -63,7 +68,7 @@ func (file *File) Readlink(ctx context.Context, req *fuse.ReadlinkRequest) (stri return "", fuse.Errno(syscall.EINVAL) } - glog.V(3).Infof("Readlink: %v/%v => %v", file.dir.FullPath(), file.Name, file.entry.Attributes.SymlinkTarget) + glog.V(4).Infof("Readlink: %v/%v => %v", file.dir.FullPath(), file.Name, file.entry.Attributes.SymlinkTarget) return file.entry.Attributes.SymlinkTarget, nil |
