Skip to content

Commit

Permalink
Merge branch 'edge' into nodes-per-space
Browse files Browse the repository at this point in the history
  • Loading branch information
butonic committed Feb 15, 2022
2 parents 02da046 + d217886 commit 2401678
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
3 changes: 0 additions & 3 deletions pkg/storage/utils/decomposedfs/xattrs/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

//go:build !darwin
// +build !darwin

package xattrs

import (
Expand Down
11 changes: 5 additions & 6 deletions pkg/storage/utils/decomposedfs/xattrs/xattrs.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"strings"

provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
"github.com/pkg/errors"
"github.com/pkg/xattr"
)

Expand Down Expand Up @@ -137,7 +136,7 @@ func CopyMetadata(s, t string, filter func(attributeName string) bool) error {
func Set(filePath string, key string, val string) error {

if err := xattr.Set(filePath, key, []byte(val)); err != nil {
return errors.Wrap(err, "xattrs: Could not write xtended attribute")
return err
}
return nil
}
Expand All @@ -160,7 +159,7 @@ func Get(filePath, key string) (string, error) {

v, err := xattr.Get(filePath, key)
if err != nil {
return "", errors.Wrap(err, "xattrs: Can not read xattr")
return "", err
}
val := string(v)
return val, nil
Expand All @@ -174,7 +173,7 @@ func GetInt64(filePath, key string) (int64, error) {
}
v, err := strconv.ParseInt(attr, 10, 64)
if err != nil {
return 0, errors.Wrapf(err, "invalid xattr format")
return 0, err
}
return v, nil
}
Expand All @@ -183,14 +182,14 @@ func GetInt64(filePath, key string) (int64, error) {
func All(filePath string) (map[string]string, error) {
attrNames, err := xattr.List(filePath)
if err != nil {
return nil, errors.Wrap(err, "xattrs: Can not list extended attributes")
return nil, err
}

attribs := make(map[string]string, len(attrNames))
for _, name := range attrNames {
val, err := xattr.Get(filePath, name)
if err != nil {
return nil, errors.Wrap(err, "Failed to read extended attrib")
return nil, err
}
attribs[name] = string(val)
}
Expand Down

0 comments on commit 2401678

Please sign in to comment.