Skip to content

Commit

Permalink
Merge pull request #92 from openebs/e2e-fio-fs-size-mib
Browse files Browse the repository at this point in the history
chore: tools: e2e_fio: support FS file size in Mib
  • Loading branch information
blaisedias authored Oct 29, 2024
2 parents 007da8e + d71e374 commit d44d33f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tools/e2e-fio/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM alpine:edge
MAINTAINER openebs [email protected]

RUN apk --no-cache add \
fio=3.37-r0 gcc musl-dev
fio=3.38-r0 gcc musl-dev

ADD e2e_fio.c /
ADD liveness.c /
Expand Down
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.38-e2e-0"
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 d44d33f

Please sign in to comment.