Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 83ad983

Browse files
committed
add default value for HAMTShardingSize of 256 KiB
1 parent c8c496a commit 83ad983

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module github.com/ipfs/go-unixfs
22

33
require (
4+
github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a
45
github.com/gogo/protobuf v1.3.2
56
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c // indirect
67
github.com/ipfs/go-bitfield v1.0.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ
33
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
44
github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETFUpAzWW2ep1Y=
55
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
6+
github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a h1:E/8AP5dFtMhl5KPJz66Kt9G0n+7Sn41Fy1wv9/jHOrc=
7+
github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
68
github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8=
79
github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI=
810
github.com/btcsuite/btcd v0.0.0-20190605094302-a0d1e3e36d50 h1:4i3KsuVA0o0KoBxAC5x+MY7RbteiMK1V7gf/G08NGIQ=

io/directory.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/ipfs/go-unixfs/hamt"
99
"github.com/ipfs/go-unixfs/private/linksize"
1010

11+
"github.com/alecthomas/units"
1112
"github.com/ipfs/go-cid"
1213
ipld "github.com/ipfs/go-ipld-format"
1314
logging "github.com/ipfs/go-log"
@@ -23,7 +24,7 @@ var log = logging.Logger("unixfs")
2324
// The size is not the *exact* block size of the encoded BasicDirectory but just
2425
// the estimated size based byte length of links name and CID (BasicDirectory's
2526
// ProtoNode doesn't use the Data field so this estimate is pretty accurate).
26-
var HAMTShardingSize = 0
27+
var HAMTShardingSize = int(256 * units.KiB)
2728

2829
// DefaultShardWidth is the default value used for hamt sharding width.
2930
// Needs to be a power of two (shard entry size) and multiple of 8 (bitfield size).

0 commit comments

Comments
 (0)