Bump reva
This commit is contained in:
+8
@@ -406,6 +406,14 @@ func (lu *Lookup) GenerateSpaceID(spaceType string, owner *user.User) (string, e
|
||||
}
|
||||
}
|
||||
|
||||
func (lu *Lookup) PurgeNode(n *node.Node) error {
|
||||
rerr := os.RemoveAll(n.InternalPath())
|
||||
if cerr := lu.IDCache.Delete(context.Background(), n.SpaceID, n.ID); cerr != nil {
|
||||
return cerr
|
||||
}
|
||||
return rerr
|
||||
}
|
||||
|
||||
// TimeManager returns the time manager
|
||||
func (lu *Lookup) TimeManager() node.TimeManager {
|
||||
return lu.tm
|
||||
|
||||
Generated
Vendored
+12
@@ -34,6 +34,7 @@ import (
|
||||
"github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs/metadata/prefixes"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs/node"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs/options"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/utils"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rogpeppe/go-internal/lockedfile"
|
||||
"go.opentelemetry.io/otel"
|
||||
@@ -349,6 +350,17 @@ func (lu *Lookup) CopyMetadataWithSourceLock(ctx context.Context, sourceNode, ta
|
||||
return lu.MetadataBackend().SetMultiple(ctx, targetNode, newAttrs, acquireTargetLock)
|
||||
}
|
||||
|
||||
func (lu *Lookup) PurgeNode(n *node.Node) error {
|
||||
// remove node
|
||||
if err := utils.RemoveItem(n.InternalPath()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// remove child entry in parent
|
||||
src := filepath.Join(n.ParentPath(), n.Name)
|
||||
return os.Remove(src)
|
||||
}
|
||||
|
||||
// TimeManager returns the time manager
|
||||
func (lu *Lookup) TimeManager() node.TimeManager {
|
||||
return lu.tm
|
||||
|
||||
+3
-9
@@ -29,7 +29,6 @@ import (
|
||||
"hash/adler32"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -165,6 +164,8 @@ type PathLookup interface {
|
||||
ReadBlobIDAndSizeAttr(ctx context.Context, n metadata.MetadataNode, attrs Attributes) (string, int64, error)
|
||||
CopyMetadataWithSourceLock(ctx context.Context, sourceNode, targetNode metadata.MetadataNode, filter func(attributeName string, value []byte) (newValue []byte, copy bool), lockedSource *lockedfile.File, acquireTargetLock bool) (err error)
|
||||
CopyMetadata(ctx context.Context, sourceNode, targetNode metadata.MetadataNode, filter func(attributeName string, value []byte) (newValue []byte, copy bool), acquireTargetLock bool) (err error)
|
||||
|
||||
PurgeNode(n *Node) error
|
||||
}
|
||||
|
||||
type IDCacher interface {
|
||||
@@ -1195,14 +1196,7 @@ func (n *Node) DeleteGrant(ctx context.Context, g *provider.Grant, acquireLock b
|
||||
|
||||
// Purge removes a node from disk. It does not move it to the trash
|
||||
func (n *Node) Purge(ctx context.Context) error {
|
||||
// remove node
|
||||
if err := utils.RemoveItem(n.InternalPath()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// remove child entry in parent
|
||||
src := filepath.Join(n.ParentPath(), n.Name)
|
||||
return os.Remove(src)
|
||||
return n.lu.PurgeNode(n)
|
||||
}
|
||||
|
||||
// ListGrants lists all grants of the current node.
|
||||
|
||||
Reference in New Issue
Block a user