44 fprintf(
file,
"Usage: %s [OPTION]...\n" 45 "Truncate MOTR object to a given size.\n" 47 "Mandatory arguments to long options are mandatory for short options too.\n" 48 " -l, --local ADDR Local endpoint address.\n" 49 " -H, --ha ADDR HA endpoint address.\n" 50 " -p, --profile FID Profile FID.\n" 51 " -P, --process FID Process FID.\n" 52 " -o, --object FID ID of the motr object. " 53 "Object id should larger than " 54 "M0_ID_APP.\n%*c The first 0x100000 ids" 55 " are reserved for use by client.\n" 56 " -s, --block-size INT Block size multiple of 4k in bytes or with " 57 "suffix b/k/m/g.\n%*c Ex: 1k=1024, " 58 "1m=1024*1024. Range: [4k-32m].\n" 59 " -c, --block-count INT Number of blocks (>0) to copy, can give with " 60 "suffix b/k/m/g/K/M/G.\n%*c Ex: 1k=1024, " 61 "1m=1024*1024, 1K=1000 1M=1000*1000.\n" 62 " -t, --trunc-len INT Number of blocks (>0) to punch out," 63 "can give with suffix b/k/m/g/K/M/G.\n" 64 " -L, --layout-id INT Layout ID. Range: [1-14].\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). Default=100 " 68 "if 0 or nothing is provided.\n" 69 " -S, --msg_size INT Max RPC msg size 64k i.e 65536\n" 70 "%*c Note: this should match with m0d's current " 72 " -q, --min_queue INT Minimum length of the receive queue i.e 16\n" 74 " -h, --help Shows this help text and exit.\n" 78 int main(
int argc,
char **argv)
87 conf.mc_is_read_verify =
false;
91 fprintf(stderr,
"init failed! rc = %d\n",
rc);
102 fprintf(stderr,
"m0_truncate failed! rc = %d\n",
rc);
M0_INTERNAL void client_init(struct sim *s, struct client_conf *conf)
static void trunc_usage(FILE *file, char *prog_name)
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 *))
int main(int argc, char **argv)
static struct m0_container container
static struct m0_idx_dix_config dix_conf
M0_INTERNAL void client_fini(struct client_conf *conf)
int m0_truncate(struct m0_container *container, struct m0_uint128 id, uint32_t block_size, uint32_t trunc_count, uint32_t trunc_len, int blks_per_io, bool take_locks)
struct m0_addb_ctx m0_addb_ctx