49 args->cma_utility->cup_file,
50 args->cma_utility->cup_id,
51 args->cma_utility->cup_block_size,
52 args->cma_utility->cup_block_count,
53 args->cma_utility->cup_offset,
54 args->cma_utility->cup_blks_per_io,
56 args->cma_utility->cup_update_mode);
61 fprintf(
file,
"Usage: %s [OPTION]... SOURCE\n" 62 "Copy SOURCE to MOTR (Multithreaded: One thread per object).\n" 63 "Designed to dump large amount of data into Motr" 65 "Mandatory arguments to long options are mandatory for short options too.\n" 66 " -l, --local ADDR Local endpoint address.\n" 67 " -H, --ha ADDR HA endpoint address.\n" 68 " -p, --profile FID Profile FID.\n" 69 " -P, --process FID Process FID.\n" 70 " -o, --object FID ID of the first motr object.\n" 71 " -n, --n_obj INT No of objects to write.\n" 72 " -s, --block-size INT Block size multiple of 4k in bytes or with " 73 "suffix b/k/m/g.\n%*c Ex: 1k=1024, " 74 "1m=1024*1024. Range: [4k-32m]\n" 75 " -c, --block-count INT Number of blocks (>0) to copy, can give with " 76 "suffix b/k/m/g/K/M/G.\n%*c Ex: 1k=1024, " 77 "1m=1024*1024, 1K=1000 1M=1000*1000.\n" 78 " -L, --layout-id INT Layout ID, Range: [1-14].\n" 79 " -b, --blocks-per-io INT Number of blocks (>=0) per IO. Default=100 " 80 "if 0 or nothing is provided.\n" 81 " -O, --offset INT Updates the exisiting object from given " 82 "offset. \n%*c Default=0 if not provided. " 83 "Offset should be multiple of 4k.\n" 84 " -r, --read-verify Verify parity after reading the data.\n" 85 " -S, --msg_size INT Max RPC msg size 64k i.e 65536\n" 86 "%*c Note: this should match with m0d's current " 88 " -q, --min_queue INT Minimum length of the receive queue i.e 16\n" 89 " -u, --update_mode INT Object update mode\n" 90 " -h, --help Shows this help text and exit.\n" 95 int main(
int argc,
char **argv)
108 conf.mc_is_read_verify =
false;
111 fprintf(stderr,
"Blocks per IO (%d) is out of range. " 112 "Max is %d for write operation!\n",
120 fprintf(stderr,
"init failed! rc = %d\n",
rc);
136 for (
i = 0;
i < obj_nr; ++
i) {
142 for (
i = 0;
i < obj_nr; ++
i)
147 for (
i = 0;
i < obj_nr; ++
i) {
150 if (copy_mt_args.
cma_rc[
i] != 0) {
151 if (copy_mt_args.
cma_rc[
i] == -EEXIST) {
152 fprintf(stderr,
"Object exists for Id: " U128X_F 153 ". To update an existing " 154 "object use -u=start index! " 161 fprintf(stderr,
"copy failed for "
#define M0_ALLOC_ARR(arr, nr)
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
int m0_thread_join(struct m0_thread *q)
static struct m0_container container
int m0_write(struct m0_container *container, char *src, struct m0_uint128 id, uint32_t block_size, uint32_t block_count, uint64_t update_offset, int blks_per_io, bool take_locks, bool update_mode)
static void copy_mt_usage(FILE *file, char *prog_name)
M0_INTERNAL void client_init(struct sim *s, struct client_conf *conf)
#define M0_THREAD_INIT(thread, TYPE, init, func, arg, namefmt,...)
struct m0_utility_param * cma_utility
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
int main(int argc, char **argv)
int m0_utility_args_init(int argc, char **argv, struct m0_utility_param *params, struct m0_idx_dix_config *dix_conf, struct m0_config *conf, void(*utility_usage)(FILE *, char *))
struct m0_mutex cma_mutex
void m0_thread_fini(struct m0_thread *q)
struct m0_uint128 * cma_ids
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
static struct m0_idx_dix_config dix_conf
static void copy_thread_launch(struct m0_copy_mt_args *args)
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
M0_INTERNAL void client_fini(struct client_conf *conf)