Revert "filer: support uploading file without needEnsureParentDir"

This reverts commit a93c4947ba.
This commit is contained in:
zzq09494
2022-03-17 10:27:17 +08:00
parent a93c4947ba
commit a6a8892255
7 changed files with 13 additions and 19 deletions

View File

@@ -130,10 +130,6 @@ func isAppend(r *http.Request) bool {
return r.URL.Query().Get("op") == "append"
}
func needEnsureParentDirEntry(r *http.Request) bool {
return r.Header.Get("ensureParentDir") != "false"
}
func (fs *FilerServer) saveMetaData(ctx context.Context, r *http.Request, fileName string, contentType string, so *operation.StorageOption, md5bytes []byte, fileChunks []*filer_pb.FileChunk, chunkOffset int64, content []byte) (filerResult *FilerPostResult, replyerr error) {
// detect file mode
@@ -247,7 +243,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); dbErr != nil {
replyerr = dbErr
filerResult.Error = dbErr.Error()
glog.V(0).Infof("failing to write %s to filer server : %v", path, dbErr)
@@ -324,7 +320,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); dbErr != nil {
replyerr = dbErr
filerResult.Error = dbErr.Error()
glog.V(0).Infof("failing to create dir %s on filer server : %v", path, dbErr)