diff --git a/contrib/nydusify/cmd/nydusify.go b/contrib/nydusify/cmd/nydusify.go index dd0b1859151..553a86095bb 100644 --- a/contrib/nydusify/cmd/nydusify.go +++ b/contrib/nydusify/cmd/nydusify.go @@ -391,6 +391,12 @@ func main() { EnvVars: []string{"FS_CHUNK_SIZE"}, Aliases: []string{"chunk-size"}, }, + &cli.StringFlag{ + Name: "batch-size", + Value: "0", + Usage: "size of batch data chunks, must be power of two, between 0x1000-0x1000000 or zero, [default: 0]", + EnvVars: []string{"BATCH_SIZE"}, + }, &cli.StringFlag{ Name: "work-dir", Value: "./tmp", @@ -492,6 +498,7 @@ func main() { FsAlignChunk: c.Bool("backend-aligned-chunk") || c.Bool("fs-align-chunk"), Compressor: c.String("compressor"), ChunkSize: c.String("chunk-size"), + BatchSize: c.String("batch-size"), OCIRef: c.Bool("oci-ref"), AllPlatforms: c.Bool("all-platforms"), diff --git a/contrib/nydusify/pkg/converter/config.go b/contrib/nydusify/pkg/converter/config.go index 0ee12f4d0df..388fcf23ab8 100644 --- a/contrib/nydusify/pkg/converter/config.go +++ b/contrib/nydusify/pkg/converter/config.go @@ -28,6 +28,7 @@ func getConfig(opt Opt) map[string]string { cfg["fs_version"] = opt.FsVersion cfg["fs_align_chunk"] = strconv.FormatBool(opt.FsAlignChunk) cfg["fs_chunk_size"] = opt.ChunkSize + cfg["batch_size"] = opt.BatchSize // FIXME: still needs to be supported by acceld converter package. cfg["cache_ref"] = opt.CacheRef diff --git a/contrib/nydusify/pkg/converter/converter.go b/contrib/nydusify/pkg/converter/converter.go index da04cc16e09..1bb55674af8 100644 --- a/contrib/nydusify/pkg/converter/converter.go +++ b/contrib/nydusify/pkg/converter/converter.go @@ -42,6 +42,7 @@ type Opt struct { FsAlignChunk bool Compressor string ChunkSize string + BatchSize string PrefetchPatterns string OCIRef bool