44 fprintf(
file,
"Usage: %s [OPTION]... DEST_FILE\n" 45 "Read from MOTR to DEST_FILE.\n" 46 "If no DEST_FILE is provided, then dump contents in console.\n" 48 "Mandatory arguments to long options are mandatory for short options too.\n" 49 " -l, --local ADDR Local endpoint address.\n" 50 " -H, --ha ADDR HA endpoint address.\n" 51 " -p, --profile FID Profile FID.\n" 52 " -P, --process FID Process FID.\n" 53 " -o, --object FID ID of the motr object " 54 "Object id should larger than " 55 "M0_ID_APP.\n%*c The first 0x100000 ids" 56 " are reserved for use by client.\n" 57 " -s, --block-size INT Block size multiple of 4k in bytes or with " 58 "suffix b/k/m/g.\n%*c Ex: 1k=1024, " 59 "1m=1024*1024. Range: [4k-32m].\n" 60 " -c, --block-count INT Number of blocks (>0) to copy, can give with " 61 "suffix b/k/m/g/K/M/G.\n%*c Ex: 1k=1024, " 62 "1m=1024*1024, 1K=1000 1M=1000*1000.\n" 63 " -L, --layout-id INT Layout ID, Range: [1-14].\n" 64 " -v, --pver FID Pool version fid.\n" 65 " -e, --enable-locks Enables acquiring and releasing RW locks " 66 "before and after performing IO.\n" 67 " -b, --blocks-per-io INT Number of blocks per IO (>=0). \n%*c " 68 "Default=100 if 0 or nothing is provided.\n" 69 " -r, --read-verify Verify parity after reading the data.\n" 70 " -S, --msg_size INT Max RPC msg size 64k i.e 65536\n" 71 "%*c Note: this should match with m0d's current " 73 " -q, --min_queue INT Minimum length of the receive queue i.e 16\n" 74 " -O, --offset INT Updates the exisiting object from given " 75 "offset.\n%*c Default=0 if not provided. " 76 "Offset should be multiple of 4k.\n" 77 " -N, --no-hole Report read error on hole in object\n" 78 " -h, --help Shows this help text and exit.\n" 79 , prog_name,
WIDTH,
' ',
WIDTH,
' ',
WIDTH,
' ',
WIDTH,
' ',
WIDTH,
' ',
83 int main(
int argc,
char **argv)
87 char *dest_fname =
NULL;
96 fprintf(stderr,
"init failed! rc = %d\n",
rc);
101 dest_fname = strdup(argv[
optind]);
109 fprintf(stderr,
"m0_read failed! rc = %d\n",
rc);
114 return rc == 0 ? 0 : 1;
M0_INTERNAL void client_init(struct sim *s, struct client_conf *conf)
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 void cat_usage(FILE *file, char *prog_name)
static struct m0_container container
M0_INTERNAL void client_fini(struct client_conf *conf)
int m0_read(struct m0_container *container, struct m0_uint128 id, char *dest, uint32_t block_size, uint32_t block_count, uint64_t offset, int blks_per_io, bool take_locks, uint32_t flags, struct m0_fid *read_pver)
static struct m0_idx_dix_config dix_conf
struct m0_addb_ctx m0_addb_ctx
int main(int argc, char **argv)