Skip to content

Commit

Permalink
chore: tools: e2e_fio: support FS file size in Mib
Browse files Browse the repository at this point in the history
Add support to specify files size on FS in MiB

Signed-off-by: Blaise Dias <[email protected]>
  • Loading branch information
blaisedias committed Oct 29, 2024
1 parent 5555797 commit dbc28a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tools/e2e-fio/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# existing semantics.
set -e
IMAGE="openebs/e2e-fio"
TAG="v3.37-e2e-0"
TAG="v3.37-e2e-1"
registry=""
tag_as_latest=""

Expand Down
10 changes: 7 additions & 3 deletions tools/e2e-fio/e2e_fio.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ enum {
* position of string in the array should match symbol position in enum
*/
const char* filesize_keywords[] = {
"availblockspercent", "availblockslessby", "bytes"};
"availblockspercent", "availblockslessby", "bytes", "MiB"};
enum {
BLOCKS_PERCENT,
BLOCKS_LESSBY,
SIZE_BYTES,
SIZE_MIBIBYTES,
};

/* struct for linked list of child processes */
Expand Down Expand Up @@ -341,6 +342,11 @@ int do_makefile(const char **argv, int count) {
use_blocks = (val + fs_stat.f_bsize - 1) / fs_stat.f_bsize;
use_bytes = val;
break;
case SIZE_MIBIBYTES:
val = val * (1024 * 1024);
use_blocks = (val + fs_stat.f_bsize - 1) / fs_stat.f_bsize;
use_bytes = val;
break;
}
printf("fs: %s, file: %s blocks: %ld bytes: %ld\n", fspath, fsfile, use_blocks, use_bytes);
printf("creat %s\n", fsfile);
Expand Down Expand Up @@ -911,11 +917,9 @@ int main(int argc, const char **argv)
perror("unlink failed");
}
eff = eff->next;
printf("#### 1 %p %p %s\n", files_list, eff, files_list->filename);
free(files_list->filename);
free(files_list);
files_list = eff;
printf("#### 1 %p %p\n", eff, files_list);
}
}
printf("Exit value is %d\n", exitv);
Expand Down

0 comments on commit dbc28a6

Please sign in to comment.