mirror of
https://github.com/ipfs/kubo.git
synced 2025-08-06 19:44:01 +08:00
mfs: inherit CID prefix from from parent directory
License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
This commit is contained in:
@ -115,6 +115,7 @@ func (d *Directory) switchToSharding(ctx context.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
s.SetPrefix(&d.dirnode.Prefix)
|
||||
|
||||
d.shard = s
|
||||
for _, lnk := range d.dirnode.Links() {
|
||||
@ -192,3 +193,11 @@ func (d *Directory) GetNode() (node.Node, error) {
|
||||
|
||||
return d.shard.Node()
|
||||
}
|
||||
|
||||
func (d *Directory) GetPrefix() *cid.Prefix {
|
||||
if d.shard == nil {
|
||||
return &d.dirnode.Prefix
|
||||
}
|
||||
|
||||
return d.shard.Prefix()
|
||||
}
|
||||
|
Reference in New Issue
Block a user