49 fprintf(
file,
"Usage: %s [OPTION]... SOURCE\n" 50 "Copy SOURCE to MOTR.\n" 52 "Mandatory arguments to long options are mandatory for short options too.\n" 53 " -l, --local ADDR Local endpoint address.\n" 54 " -H, --ha ADDR HA endpoint address.\n" 55 " -p, --profile FID Profile FID.\n" 56 " -P, --process FID Process FID.\n" 57 " -o, --object FID ID of the motr object. " 58 "Object id should larger than " 59 "M0_ID_APP.\n%*c The first 0x100000 " 60 "ids are reserved for use by client.\n" 61 " -s, --block-size INT Block size multiple of 4k in bytes or with " 62 "suffix b/k/m/g.\n%*c Ex: 1k=1024, " 63 "1m=1024*1024. Range: [4k-32m].\n" 64 " -c, --block-count INT Number of blocks (>0) to copy, can give with " 65 "suffix b/k/m/g/K/M/G.\n%*c Ex: 1k=1024, " 66 "1m=1024*1024, 1K=1000 1M=1000*1000.\n" 67 " -L, --layout-id INT Layout ID. Range: [1-14].\n" 68 " -e, --enable-locks Enables acquiring and releasing RW locks " 69 "before and after performing IO.\n" 70 " -b, --blocks-per-io INT Number of blocks (>=0) per IO. " 71 "Default=100 if 0 or nothing is provided.\n" 72 " -O, --offset INT Updates the exisiting object from given " 73 "offset.\n%*c Default=0 if not provided. " 74 "Offset should be multiple of 4k.\n" 75 " -S, --msg_size INT Max RPC msg size 64k i.e 65536\n" 76 "%*c Note: this should match with m0d's current " 78 " -q, --min_queue INT Minimum length of the receive queue i.e 16\n" 79 " -u, --update_mode Object update mode\n" 80 " -h, --help Shows this help text and exit.\n" 81 , prog_name,
WIDTH,
' ',
WIDTH,
' ',
WIDTH,
' ',
WIDTH,
' ',
WIDTH,
' ');
84 int main(
int argc,
char **argv)
93 conf.mc_is_read_verify =
false;
96 fprintf(stderr,
"Blocks per IO (%d) is out of range. " 97 "Max is %d for write operation!\n",
105 fprintf(stderr,
"Client init failed: rc=%d\n",
rc);
119 fprintf(stderr,
"Object "U128X_F" already exists: " 120 "rc=%d. To update an existing object, " 121 "use -u=start index.\n",
124 fprintf(stderr,
"Object "U128X_F" write failed: rc=%d\n" 131 return rc == 0 ? 0 : 1;
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)
M0_INTERNAL void client_init(struct sim *s, struct client_conf *conf)
static void copy_usage(FILE *file, char *prog_name)
struct m0_addb_ctx m0_addb_ctx
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 *))
static struct m0_idx_dix_config dix_conf
M0_INTERNAL void client_fini(struct client_conf *conf)