update reva vendor files

This commit is contained in:
Saw-jan
2023-05-15 16:34:39 +05:45
parent 82b64b2dde
commit fb8de129e7
6 changed files with 32 additions and 12 deletions

View File

@@ -61,8 +61,9 @@ func (h *Handler) getGrantee(ctx context.Context, name string) (provider.Grantee
log.Debug().Str("name", name).Msg("no user found")
groupRes, err := client.GetGroupByClaim(ctx, &groupv1beta1.GetGroupByClaimRequest{
Claim: "group_name",
Value: name,
Claim: "group_name",
Value: name,
SkipFetchingMembers: true,
})
if err == nil && groupRes.Status.Code == rpc.Code_CODE_OK {
return provider.Grantee{

View File

@@ -211,9 +211,6 @@ func (cache cacheStore) List(opts ...microstore.ListOption) ([]string, error) {
if err != nil {
return nil, err
}
for i, key := range keys {
keys[i] = strings.TrimPrefix(key, cache.table)
}
return keys, nil
}

View File

@@ -405,8 +405,8 @@ func (n *Node) Child(ctx context.Context, name string) (*Node, error) {
return c, nil
}
// Parent returns the parent node
func (n *Node) Parent() (p *Node, err error) {
// ParentWithReader returns the parent node
func (n *Node) ParentWithReader(r io.Reader) (p *Node, err error) {
if n.ParentID == "" {
return nil, fmt.Errorf("decomposedfs: root has no parent")
}
@@ -417,6 +417,9 @@ func (n *Node) Parent() (p *Node, err error) {
SpaceRoot: n.SpaceRoot,
}
// fill metadata cache using the reader
_, _ = p.XattrsWithReader(r)
// lookup name and parent id in extended attributes
p.ParentID, _ = p.XattrString(prefixes.ParentidAttr)
p.Name, _ = p.XattrString(prefixes.NameAttr)
@@ -428,6 +431,11 @@ func (n *Node) Parent() (p *Node, err error) {
return
}
// Parent returns the parent node
func (n *Node) Parent() (p *Node, err error) {
return n.ParentWithReader(nil)
}
// Owner returns the space owner
func (n *Node) Owner() *userpb.UserId {
return n.SpaceRoot.owner

View File

@@ -19,6 +19,7 @@
package node
import (
"io"
"strconv"
"github.com/pkg/xattr"
@@ -84,21 +85,34 @@ func (n *Node) RemoveXattr(key string) error {
return n.lu.MetadataBackend().Remove(n.InternalPath(), key)
}
// Xattrs returns the extended attributes of the node. If the attributes have already
// XattrsWithReader returns the extended attributes of the node. If the attributes have already
// been cached they are not read from disk again.
func (n *Node) Xattrs() (Attributes, error) {
func (n *Node) XattrsWithReader(r io.Reader) (Attributes, error) {
if n.xattrsCache != nil {
return n.xattrsCache, nil
}
attrs, err := n.lu.MetadataBackend().All(n.InternalPath())
var attrs Attributes
var err error
if r != nil {
attrs, err = n.lu.MetadataBackend().AllWithLockedSource(n.InternalPath(), r)
} else {
attrs, err = n.lu.MetadataBackend().All(n.InternalPath())
}
if err != nil {
return nil, err
}
n.xattrsCache = attrs
return n.xattrsCache, nil
}
// Xattrs returns the extended attributes of the node. If the attributes have already
// been cached they are not read from disk again.
func (n *Node) Xattrs() (Attributes, error) {
return n.XattrsWithReader(nil)
}
// Xattr returns an extended attribute of the node. If the attributes have already
// been cached it is not read from disk again.
func (n *Node) Xattr(key string) ([]byte, error) {

View File

@@ -731,7 +731,7 @@ func (t *Tree) Propagate(ctx context.Context, n *node.Node, sizeDiff int64) (err
}
}()
if n, err = n.Parent(); err != nil {
if n, err = n.ParentWithReader(f); err != nil {
return err
}

2
vendor/modules.txt vendored
View File

@@ -349,7 +349,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1
github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1
github.com/cs3org/go-cs3apis/cs3/tx/v1beta1
github.com/cs3org/go-cs3apis/cs3/types/v1beta1
# github.com/cs3org/reva/v2 v2.13.3-0.20230510083816-98d8707dea33
# github.com/cs3org/reva/v2 v2.13.3-0.20230515075524-e00c55c0a4d3
## explicit; go 1.19
github.com/cs3org/reva/v2/cmd/revad/internal/grace
github.com/cs3org/reva/v2/cmd/revad/runtime