This commit is contained in:
zzq09494 2022-03-17 14:19:48 +08:00
parent ee5417a5b3
commit 40b0033fa7
10 changed files with 13 additions and 13 deletions

View file

@ -151,7 +151,7 @@ func (f *Filer) RollbackTransaction(ctx context.Context) error {
return f.Store.RollbackTransaction(ctx)
}
func (f *Filer) CreateEntry(ctx context.Context, entry *Entry, o_excl bool, isFromOtherCluster bool, signatures []int32,needEnsureParentDir bool) error {
func (f *Filer) CreateEntry(ctx context.Context, entry *Entry, o_excl bool, isFromOtherCluster bool, signatures []int32, needEnsureParentDir bool) error {
if string(entry.FullPath) == "/" {
return nil

View file

@ -43,7 +43,7 @@ func (f *Filer) appendToFile(targetFile string, data []byte) error {
entry.Chunks = append(entry.Chunks, uploadResult.ToPbFileChunk(assignResult.Fid, offset))
// update the entry
err = f.CreateEntry(context.Background(), entry, false, false, nil,true)
err = f.CreateEntry(context.Background(), entry, false, false, nil, true)
return err
}

View file

@ -31,7 +31,7 @@ func TestCreateAndFind(t *testing.T) {
},
}
if err := testFiler.CreateEntry(ctx, entry1, false, false, nil,true); err != nil {
if err := testFiler.CreateEntry(ctx, entry1, false, false, nil, true); err != nil {
t.Errorf("create entry %v: %v", entry1.FullPath, err)
return
}

View file

@ -28,7 +28,7 @@ func TestCreateAndFind(t *testing.T) {
},
}
if err := testFiler.CreateEntry(ctx, entry1, false, false, nil,true); err != nil {
if err := testFiler.CreateEntry(ctx, entry1, false, false, nil, true); err != nil {
t.Errorf("create entry %v: %v", entry1.FullPath, err)
return
}

View file

@ -28,7 +28,7 @@ func TestCreateAndFind(t *testing.T) {
},
}
if err := testFiler.CreateEntry(ctx, entry1, false, false, nil,true); err != nil {
if err := testFiler.CreateEntry(ctx, entry1, false, false, nil, true); err != nil {
t.Errorf("create entry %v: %v", entry1.FullPath, err)
return
}

View file

@ -148,7 +148,7 @@ func (fs *FilerServer) CreateEntry(ctx context.Context, req *filer_pb.CreateEntr
newEntry := filer.FromPbEntry(req.Directory, req.Entry)
newEntry.Chunks = chunks
createErr := fs.filer.CreateEntry(ctx, newEntry, req.OExcl, req.IsFromOtherCluster, req.Signatures,true)
createErr := fs.filer.CreateEntry(ctx, newEntry, req.OExcl, req.IsFromOtherCluster, req.Signatures, true)
if createErr == nil {
fs.filer.DeleteChunks(garbage)
@ -271,7 +271,7 @@ func (fs *FilerServer) AppendToEntry(ctx context.Context, req *filer_pb.AppendTo
glog.V(0).Infof("MaybeManifestize: %v", err)
}
err = fs.filer.CreateEntry(context.Background(), entry, false, false, nil,true)
err = fs.filer.CreateEntry(context.Background(), entry, false, false, nil, true)
return &filer_pb.AppendToEntryResponse{}, err
}

View file

@ -173,7 +173,7 @@ func (fs *FilerServer) moveSelfEntry(ctx context.Context, stream filer_pb.Seawee
Remote: entry.Remote,
Quota: entry.Quota,
}
if createErr := fs.filer.CreateEntry(ctx, newEntry, false, false, signatures,true); createErr != nil {
if createErr := fs.filer.CreateEntry(ctx, newEntry, false, false, signatures, true); createErr != nil {
return createErr
}
if stream != nil {

View file

@ -43,7 +43,7 @@ func (fs *FilerServer) PutTaggingHandler(w http.ResponseWriter, r *http.Request)
}
}
if dbErr := fs.filer.CreateEntry(ctx, existingEntry, false, false, nil,true); dbErr != nil {
if dbErr := fs.filer.CreateEntry(ctx, existingEntry, false, false, nil, true); dbErr != nil {
glog.V(0).Infof("failing to update %s tagging : %v", path, dbErr)
writeJsonError(w, r, http.StatusInternalServerError, err)
return
@ -107,7 +107,7 @@ func (fs *FilerServer) DeleteTaggingHandler(w http.ResponseWriter, r *http.Reque
return
}
if dbErr := fs.filer.CreateEntry(ctx, existingEntry, false, false, nil,true); dbErr != nil {
if dbErr := fs.filer.CreateEntry(ctx, existingEntry, false, false, nil, true); dbErr != nil {
glog.V(0).Infof("failing to delete %s tagging : %v", path, dbErr)
writeJsonError(w, r, http.StatusInternalServerError, err)
return

View file

@ -247,7 +247,7 @@ func (fs *FilerServer) saveMetaData(ctx context.Context, r *http.Request, fileNa
}
}
if dbErr := fs.filer.CreateEntry(ctx, entry, false, false, nil,needEnsureParentDirEntry(r)); dbErr != nil {
if dbErr := fs.filer.CreateEntry(ctx, entry, false, false, nil, needEnsureParentDirEntry(r)); dbErr != nil {
replyerr = dbErr
filerResult.Error = dbErr.Error()
glog.V(0).Infof("failing to write %s to filer server : %v", path, dbErr)
@ -324,7 +324,7 @@ func (fs *FilerServer) mkdir(ctx context.Context, w http.ResponseWriter, r *http
Name: util.FullPath(path).Name(),
}
if dbErr := fs.filer.CreateEntry(ctx, entry, false, false, nil,true); dbErr != nil {
if dbErr := fs.filer.CreateEntry(ctx, entry, false, false, nil, true); dbErr != nil {
replyerr = dbErr
filerResult.Error = dbErr.Error()
glog.V(0).Infof("failing to create dir %s on filer server : %v", path, dbErr)

View file

@ -93,7 +93,7 @@ func (fs *FilerServer) encrypt(ctx context.Context, w http.ResponseWriter, r *ht
Size: int64(pu.OriginalDataSize),
}
if dbErr := fs.filer.CreateEntry(ctx, entry, false, false, nil,true); dbErr != nil {
if dbErr := fs.filer.CreateEntry(ctx, entry, false, false, nil, true); dbErr != nil {
fs.filer.DeleteChunks(entry.Chunks)
err = dbErr
filerResult.Error = dbErr.Error()