@@ -5432,10 +5432,11 @@ static int sanitize_cmd(int argc, char **argv, struct command *acmd, struct plug
54325432 "3 = Start overwrite, 4 = Start crypto erase, 5 = Exit media verification" ;
54335433 const char * ovrpat_desc = "Overwrite pattern." ;
54345434
5435- _cleanup_nvme_global_ctx_ struct nvme_global_ctx * ctx = NULL ;
54365435 _cleanup_nvme_transport_handle_ struct nvme_transport_handle * hdl = NULL ;
5437- int err ;
5436+ _cleanup_nvme_global_ctx_ struct nvme_global_ctx * ctx = NULL ;
5437+ struct nvme_passthru_cmd cmd ;
54385438 nvme_print_flags_t flags ;
5439+ int err ;
54395440
54405441 struct config {
54415442 bool no_dealloc ;
@@ -5519,19 +5520,9 @@ static int sanitize_cmd(int argc, char **argv, struct command *acmd, struct plug
55195520 }
55205521 }
55215522
5522- struct nvme_sanitize_nvm_args args = {
5523- .args_size = sizeof (args ),
5524- .sanact = cfg .sanact ,
5525- .ause = cfg .ause ,
5526- .owpass = cfg .owpass ,
5527- .oipbp = cfg .oipbp ,
5528- .nodas = cfg .no_dealloc ,
5529- .ovrpat = cfg .ovrpat ,
5530- .result = NULL ,
5531- .emvs = cfg .emvs ,
5532- };
5533-
5534- err = nvme_sanitize_nvm (hdl , & args );
5523+ nvme_init_sanitize_nvm (& cmd , cfg .sanact , cfg .ause , cfg .owpass ,
5524+ cfg .oipbp , cfg .no_dealloc , cfg .emvs , cfg .ovrpat );
5525+ err = nvme_submit_admin_passthru (hdl , & cmd , NULL );
55355526 if (err < 0 )
55365527 nvme_show_error ("sanitize: %s" , nvme_strerror (- err ));
55375528 else if (err > 0 )
0 commit comments