diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-09-03 00:07:22 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-09-03 00:07:22 -0700 |
| commit | 7e1aad0b54bd3d6d1bc2bd8940aeeaf7186bcfa4 (patch) | |
| tree | 6aabe62fc9fd7d02ee92037386bb54de63910080 /weed/filesys/dir.go | |
| parent | 68e878adb5d63cb961fdff8585bd6eede3b616f1 (diff) | |
| download | seaweedfs-7e1aad0b54bd3d6d1bc2bd8940aeeaf7186bcfa4.tar.xz seaweedfs-7e1aad0b54bd3d6d1bc2bd8940aeeaf7186bcfa4.zip | |
mount: map uid/gid between local and filer
Diffstat (limited to 'weed/filesys/dir.go')
| -rw-r--r-- | weed/filesys/dir.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index 59c4b7965..f639693bd 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -148,6 +148,10 @@ func (dir *Dir) Create(ctx context.Context, req *fuse.CreateRequest, glog.V(1).Infof("create %s/%s: %v", dir.FullPath(), req.Name, req.Flags) if 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 { if strings.Contains(err.Error(), "EEXIST") { return fuse.EEXIST @@ -193,6 +197,9 @@ func (dir *Dir) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (fs.Node, err err := dir.wfs.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error { + dir.wfs.mapPbIdFromLocalToFiler(newEntry) + defer dir.wfs.mapPbIdFromFilerToLocal(newEntry) + request := &filer_pb.CreateEntryRequest{ Directory: dir.FullPath(), Entry: newEntry, @@ -458,6 +465,9 @@ func (dir *Dir) saveEntry() error { return dir.wfs.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error { + dir.wfs.mapPbIdFromLocalToFiler(dir.entry) + defer dir.wfs.mapPbIdFromFilerToLocal(dir.entry) + request := &filer_pb.UpdateEntryRequest{ Directory: parentDir, Entry: dir.entry, |
