diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-03-27 00:30:55 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-03-27 00:30:55 -0700 |
| commit | e1911760a773fadc236a3463cd2d6a4c0f2dd5d1 (patch) | |
| tree | 7cc739478bd7c42f5e345f5bf39f594b3653064f | |
| parent | 2f5ed29c37c204fb461498b9f3c51f76442ca01c (diff) | |
| download | seaweedfs-e1911760a773fadc236a3463cd2d6a4c0f2dd5d1.tar.xz seaweedfs-e1911760a773fadc236a3463cd2d6a4c0f2dd5d1.zip | |
refactoring
| -rw-r--r-- | weed/filesys/fscache.go | 4 | ||||
| -rw-r--r-- | weed/operation/upload_content.go | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/weed/filesys/fscache.go b/weed/filesys/fscache.go index bf6f6cd00..ca8c7de5b 100644 --- a/weed/filesys/fscache.go +++ b/weed/filesys/fscache.go @@ -99,7 +99,6 @@ func (c *FsCache) Move(oldPath util.FullPath, newPath util.FullPath) *FsNode { if f.entry != nil { f.entry.Name = f.Name } - f.dir = target.parent.node.(*Dir) } parent.disconnectChild(target) @@ -119,6 +118,9 @@ func (n *FsNode) connectToParent(parent *FsNode) { if dir, ok := n.node.(*Dir); ok { dir.parent = parent.node.(*Dir) } + if f, ok := n.node.(*File); ok { + f.dir = parent.node.(*Dir) + } n.childrenLock.Lock() parent.children[n.name] = n n.childrenLock.Unlock() diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go index b74663c36..56c820f00 100644 --- a/weed/operation/upload_content.go +++ b/weed/operation/upload_content.go @@ -80,7 +80,6 @@ func doUploadData(uploadUrl string, filename string, cipher bool, data []byte, i if !isInputGzipped { if shouldBeZipped, iAmSure := util.IsGzippableFileType(filepath.Base(filename), mtype); iAmSure && shouldBeZipped { shouldGzipNow = true - contentIsGzipped = true } else if len(data) > 128 { var compressed []byte compressed, err = util.GzipData(data[0:128]) |
