Skip to content

Commit f6d3a9f

Browse files
authored
Rename "FillByFAllocate" to "FillByFallocate" (#217)
Signed-off-by: cwen0 <[email protected]> Signed-off-by: cwen0 <[email protected]>
1 parent 98f3ca4 commit f6d3a9f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cmd/attack/disk.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func NewDiskFillCommand(dep fx.Option, options *core.DiskOption) *cobra.Command
114114
Short: "fill disk",
115115
Run: func(*cobra.Command, []string) {
116116
options.Action = core.DiskFillAction
117-
utils.FxNewAppWithoutLog(dep, fx.Invoke(processDiskAttack), fx.NopLogger).Run()
117+
utils.FxNewAppWithoutLog(dep, fx.Invoke(processDiskAttack)).Run()
118118
},
119119
}
120120

@@ -128,7 +128,7 @@ func NewDiskFillCommand(dep fx.Option, options *core.DiskOption) *cobra.Command
128128
"If path not provided, a temp file will be generated and deleted immediately after data filled in or allocated")
129129
cmd.Flags().StringVarP(&options.Percent, "percent", "c", "",
130130
"'percent' how many percent data of disk will fill in the file path")
131-
cmd.Flags().BoolVarP(&options.FillByFAllocate, "fallocate", "f", true, "fill disk by fallocate instead of dd")
131+
cmd.Flags().BoolVarP(&options.FillByFallocate, "fallocate", "f", true, "fill disk by fallocate instead of dd")
132132
return cmd
133133
}
134134

pkg/core/disk.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type DiskOption struct {
7777
Percent string `json:"percent,omitempty"`
7878
PayloadProcessNum uint8 `json:"payload-process-num,omitempty"`
7979

80-
FillByFAllocate bool `json:"fill-by-fallocate,omitempty"`
80+
FillByFallocate bool `json:"fallocate,omitempty"`
8181
}
8282

8383
func NewDiskOption() *DiskOption {
@@ -86,7 +86,7 @@ func NewDiskOption() *DiskOption {
8686
Kind: DiskAttack,
8787
},
8888
PayloadProcessNum: 1,
89-
FillByFAllocate: true,
89+
FillByFallocate: true,
9090
}
9191
}
9292

@@ -105,7 +105,7 @@ func (opt *DiskOption) PreProcess() (*DiskAttackConfig, error) {
105105
return nil, err
106106
}
107107

108-
if opt.Action == DiskFillAction && opt.FillByFAllocate && byteSize != 0 {
108+
if opt.Action == DiskFillAction && opt.FillByFallocate && byteSize != 0 {
109109
return &DiskAttackConfig{
110110
CommonAttackConfig: opt.CommonAttackConfig,
111111
DdOptions: nil,

0 commit comments

Comments
 (0)