Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed Feb 15, 2022
1 parent 752c692 commit 02da046
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
1 change: 1 addition & 0 deletions changelog/unreleased/decomposedfs-xattr-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ Enhancement: Refactored the xattrs package in the decomposedfs
The xattrs package now uses the xattr.ENOATTR instead of os.ENODATA or os.ENOATTR to check attribute existence.

https://github.com/cs3org/reva/pull/2540
https://github.com/cs3org/reva/pull/2541
7 changes: 1 addition & 6 deletions pkg/storage/utils/decomposedfs/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func (n *Node) Child(ctx context.Context, name string) (*Node, error) {

var c *Node
if strings.HasPrefix(link, "../") {
c, err = ReadNode(ctx, n.lu, filepath.Base(link))
c, err = ReadNode(ctx, n.lu, spaceID, filepath.Base(link))
if err != nil {
return nil, errors.Wrap(err, "could not read child node")
}
Expand Down Expand Up @@ -411,11 +411,6 @@ func (n *Node) LockFilePath() string {
return n.InternalPath() + ".lock"
}

// LockFilePath returns the internal path of the lock file of the node
func (n *Node) LockFilePath() string {
return n.lu.InternalPath(n.ID) + ".lock"
}

// CalculateEtag returns a hash of fileid + tmtime (or mtime)
func CalculateEtag(nodeID string, tmTime time.Time) (string, error) {
return calculateEtag(nodeID, tmTime)
Expand Down
6 changes: 2 additions & 4 deletions pkg/storage/utils/decomposedfs/spaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,11 +515,9 @@ func (fs *Decomposedfs) DeleteStorageSpace(ctx context.Context, req *provider.De
if len(matches) != 1 {
return fmt.Errorf("delete root node failed: found %d matching root nodes", len(matches))
}

n, err := node.ReadNode(ctx, fs.lu, spaceID, filepath.Base(target))
if err != nil {
return os.RemoveAll(matches[0])
}

// don't delete - just rename
dn := *n
deletionTime := time.Now().UTC().Format(time.RFC3339Nano)
Expand All @@ -540,7 +538,7 @@ func (fs *Decomposedfs) DeleteStorageSpace(ctx context.Context, req *provider.De
return os.Symlink(trashPath, np)
}

func (fs *Decomposedfs) createStorageSpace(ctx context.Context, spaceType, spaceID string) error {
func (fs *Decomposedfs) createStorageSpace(ctx context.Context, spaceType string, spaceID string) error {
// create space type dir
if err := os.MkdirAll(filepath.Join(fs.o.Root, "spaces", spaceType), 0700); err != nil {
return err
Expand Down

0 comments on commit 02da046

Please sign in to comment.