Skip to content

Commit

Permalink
Remove unused revision code
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck committed Aug 14, 2024
1 parent ba7048e commit fce42f4
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions pkg/storage/fs/posix/tree/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package tree

import (
"bytes"
"context"
"fmt"
"io"
Expand Down Expand Up @@ -663,35 +662,7 @@ func (t *Tree) removeNode(ctx context.Context, path string, n *node.Node) error
}

// delete revisions
revs, err := filepath.Glob(n.InternalPath() + node.RevisionIDDelimiter + "*")
if err != nil {
log.Error().Err(err).Str("path", n.InternalPath()+node.RevisionIDDelimiter+"*").Msg("glob failed badly")
return err
}
for _, rev := range revs {
if t.lookup.MetadataBackend().IsMetaFile(rev) {
continue
}

bID, err := t.lookup.ReadBlobIDAttr(ctx, rev)
if err != nil {
log.Error().Err(err).Str("revision", rev).Msg("error reading blobid attribute")
return err
}

if err := utils.RemoveItem(rev); err != nil {
log.Error().Err(err).Str("revision", rev).Msg("error removing revision node")
return err
}

if bID != "" {
if err := t.DeleteBlob(&node.Node{SpaceID: n.SpaceID, BlobID: bID}); err != nil {
log.Error().Err(err).Str("revision", rev).Str("blobID", bID).Msg("error removing revision node blob")
return err
}
}

}
// posixfs doesn't do revisions yet

return nil
}
Expand Down

0 comments on commit fce42f4

Please sign in to comment.