#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <editline/readline.h>
#include "lib/string.h"
#include "m0hsm_api.h"
#include "motr/idx.h"
Go to the source code of this file.
|
static void | client_fini (void) |
|
static int | client_init (void) |
|
static int | open_entity (struct m0_entity *entity) |
|
static int | m0hsm_write_file (struct m0_uint128 id, const char *path) |
|
static int | load_env (char **tgt, const char *env) |
|
static int | load_client_env () |
|
static void | usage () |
|
int64_t | read_arg64 (const char *s) |
|
int | read_fid (const char *s, struct m0_uint128 *fid) |
|
static int | parse_copy_subopt (char *opts, enum hsm_cp_flags *flags) |
|
static int | parse_release_subopt (char *opts, enum hsm_rls_flags *flags) |
|
static int | parse_cmd_options (int argc, char **argv) |
|
int | m0hsm_test_write (struct m0_uint128 id, off_t offset, size_t len, int seed) |
|
int | m0hsm_test_read (struct m0_uint128 id, off_t offset, size_t len) |
|
static int | run_cmd (int argc, char **argv) |
|
char ** | sh_split_line (char *line, int *argc) |
|
static int | shell_loop () |
|
int | main (int argc, char **argv) |
|
◆ IO_SIZE
#define IO_SIZE (1024 * 1024) |
◆ SH_TOK_BUFSIZE
#define SH_TOK_BUFSIZE 64 |
◆ SH_TOK_DELIM
#define SH_TOK_DELIM " \t\r\n\a" |
◆ SHORT_OPT
◆ client_fini()
static void client_fini |
( |
void |
| ) |
|
|
static |
◆ client_init()
static int client_init |
( |
void |
| ) |
|
|
static |
◆ load_client_env()
static int load_client_env |
( |
| ) |
|
|
static |
◆ load_env()
static int load_env |
( |
char ** |
tgt, |
|
|
const char * |
env |
|
) |
| |
|
static |
◆ m0hsm_test_read()
int m0hsm_test_read |
( |
struct m0_uint128 |
id, |
|
|
off_t |
offset, |
|
|
size_t |
len |
|
) |
| |
read data from an existing object at the given offset.
Definition at line 2045 of file m0hsm_api.c.
◆ m0hsm_test_write()
int m0hsm_test_write |
( |
struct m0_uint128 |
id, |
|
|
off_t |
offset, |
|
|
size_t |
len, |
|
|
int |
seed |
|
) |
| |
write data to an existing object at the given offset
- Parameters
-
seed | Used to generate block contents so it can be used to verify we read the right layer. |
Definition at line 1875 of file m0hsm_api.c.
◆ m0hsm_write_file()
static int m0hsm_write_file |
( |
struct m0_uint128 |
id, |
|
|
const char * |
path |
|
) |
| |
|
static |
wraps m0hsm_pwrite
Definition at line 130 of file m0hsm.c.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
◆ open_entity()
static int open_entity |
( |
struct m0_entity * |
entity | ) |
|
|
static |
Helper to open an object entity
Definition at line 112 of file m0hsm.c.
◆ parse_cmd_options()
static int parse_cmd_options |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
|
static |
◆ parse_copy_subopt()
static int parse_copy_subopt |
( |
char * |
opts, |
|
|
enum hsm_cp_flags * |
flags |
|
) |
| |
|
static |
◆ parse_release_subopt()
static int parse_release_subopt |
( |
char * |
opts, |
|
|
enum hsm_rls_flags * |
flags |
|
) |
| |
|
static |
◆ read_arg64()
int64_t read_arg64 |
( |
const char * |
s | ) |
|
◆ read_fid()
int read_fid |
( |
const char * |
s, |
|
|
struct m0_uint128 * |
fid |
|
) |
| |
Read FID in the format [hi:]lo. Return how many numbers are read.
Definition at line 263 of file m0hsm.c.
◆ run_cmd()
static int run_cmd |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
|
static |
◆ sh_split_line()
char** sh_split_line |
( |
char * |
line, |
|
|
int * |
argc |
|
) |
| |
◆ shell_loop()
static int shell_loop |
( |
| ) |
|
|
static |
◆ usage()
static void usage |
( |
void |
| ) |
|
|
static |
◆ client_conf
◆ container
◆ dix_conf
◆ ha_addr
◆ hsm_options
Initial value:
Definition at line 53 of file m0hsm.c.
◆ instance
◆ local_addr
◆ option_tab
const struct option option_tab[] |
|
static |
Initial value:= {
{
"quiet", no_argument,
NULL,
'q'},
{
"verbose", required_argument,
NULL,
'v'},
}
Definition at line 343 of file m0hsm.c.
◆ proc_fid
◆ profile
◆ RCFILE
const char RCFILE[] = ".hsm/config" |
|
static |
◆ uber_realm