Rename "FillByFAllocate" to "FillByFallocate" (#217)

Signed-off-by: cwen0 <cwenyin0@gmail.com>

Signed-off-by: cwen0 <cwenyin0@gmail.com>
This commit is contained in:
Cwen Yin 2022-09-20 17:58:15 +08:00 committed by GitHub
parent 98f3ca40c1
commit f6d3a9fb1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -114,7 +114,7 @@ func NewDiskFillCommand(dep fx.Option, options *core.DiskOption) *cobra.Command
Short: "fill disk",
Run: func(*cobra.Command, []string) {
options.Action = core.DiskFillAction
utils.FxNewAppWithoutLog(dep, fx.Invoke(processDiskAttack), fx.NopLogger).Run()
utils.FxNewAppWithoutLog(dep, fx.Invoke(processDiskAttack)).Run()
},
}
@ -128,7 +128,7 @@ func NewDiskFillCommand(dep fx.Option, options *core.DiskOption) *cobra.Command
"If path not provided, a temp file will be generated and deleted immediately after data filled in or allocated")
cmd.Flags().StringVarP(&options.Percent, "percent", "c", "",
"'percent' how many percent data of disk will fill in the file path")
cmd.Flags().BoolVarP(&options.FillByFAllocate, "fallocate", "f", true, "fill disk by fallocate instead of dd")
cmd.Flags().BoolVarP(&options.FillByFallocate, "fallocate", "f", true, "fill disk by fallocate instead of dd")
return cmd
}

View File

@ -77,7 +77,7 @@ type DiskOption struct {
Percent string `json:"percent,omitempty"`
PayloadProcessNum uint8 `json:"payload-process-num,omitempty"`
FillByFAllocate bool `json:"fill-by-fallocate,omitempty"`
FillByFallocate bool `json:"fallocate,omitempty"`
}
func NewDiskOption() *DiskOption {
@ -86,7 +86,7 @@ func NewDiskOption() *DiskOption {
Kind: DiskAttack,
},
PayloadProcessNum: 1,
FillByFAllocate: true,
FillByFallocate: true,
}
}
@ -105,7 +105,7 @@ func (opt *DiskOption) PreProcess() (*DiskAttackConfig, error) {
return nil, err
}
if opt.Action == DiskFillAction && opt.FillByFAllocate && byteSize != 0 {
if opt.Action == DiskFillAction && opt.FillByFallocate && byteSize != 0 {
return &DiskAttackConfig{
CommonAttackConfig: opt.CommonAttackConfig,
DdOptions: nil,