Made struct ExprtesT test -lba_range ready for long block adresses

This commit is contained in:
2024-03-20 16:05:35 +01:00
parent 435521a2c9
commit cdffa4efee
6 changed files with 54 additions and 19 deletions

View File

@ -917,16 +917,39 @@ int Findjob_set_size_filter(struct FindjoB *o, int test_type,
}
int Findjob_set_lba_range(struct FindjoB *o, int start_lba, int count,
int Findjob_set_off_t_filter(struct FindjoB *o, int test_type,
off_t num1, off_t num2, int flag)
{
struct ExprtesT *t;
int ret;
ret= Findjob_default_and(o, 0);
if(ret <= 0)
return(ret);
t= o->cursor->test;
t->test_type= test_type;
t->arg1= calloc(sizeof(off_t), 1);
t->arg2= calloc(sizeof(off_t), 1);
if(t->arg1 == NULL || t->arg2 == NULL)
return(-1);
*((off_t *) t->arg1)= num1;
*((off_t *) t->arg2)= num2;
return(1);
}
int Findjob_set_lba_range(struct FindjoB *o, off_t start_lba, off_t count,
int flag)
{
int ret, end_lba;
int ret;
off_t end_lba;
if(start_lba > 0)
end_lba= start_lba + count - 1;
else
end_lba= start_lba - count + 1;
ret= Findjob_set_num_filter(o, 4, start_lba, end_lba, 0);
ret= Findjob_set_off_t_filter(o, 4, start_lba, end_lba, 0);
return(ret);
}