diff options
Diffstat (limited to 'xlators/debug/delay-gen/src/delay-gen.c')
| -rw-r--r-- | xlators/debug/delay-gen/src/delay-gen.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/xlators/debug/delay-gen/src/delay-gen.c b/xlators/debug/delay-gen/src/delay-gen.c index a2d02527f23..4698f1fd785 100644 --- a/xlators/debug/delay-gen/src/delay-gen.c +++ b/xlators/debug/delay-gen/src/delay-gen.c @@ -27,7 +27,7 @@ delay_gen(xlator_t *this, int fop) return 0; if ((rand() % DELAY_GRANULARITY) < dg->delay_ppm) - usleep(dg->delay_duration); + gf_nanosleep(dg->delay_duration * GF_US_IN_NS); return 0; } @@ -679,4 +679,19 @@ struct volume_options options[] = { .default_value = "", }, - {.key = {NULL}}}; + {.key = {NULL}}, +}; + +xlator_api_t xlator_api = { + .init = init, + .fini = fini, + .notify = notify, + .reconfigure = reconfigure, + .mem_acct_init = mem_acct_init, + .op_version = {GD_OP_VERSION_3_12_0}, + .fops = &fops, + .cbks = &cbks, + .options = options, + .identifier = "delay-gen", + .category = GF_TECH_PREVIEW, +}; |
