23 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_IOSERVICE 36 #define SERVER_ENDPOINT_ADDR "0@lo:12345:34:1" 47 LOG_NAME_MAX_LEN = 128,
49 RPC_SIZE_MAX_LEN = 32,
53 char log_name[LOG_NAME_MAX_LEN];
54 char full_ep[EP_MAX_LEN];
55 char max_rpc_size[RPC_SIZE_MAX_LEN];
59 snprintf(max_rpc_size, RPC_SIZE_MAX_LEN,
62 #define NAME(ext) "io_sdev" ext 64 NAME(
""),
"-T",
"AD",
"-D",
NAME(
".db"),
65 "-S",
NAME(
".stob"),
"-A",
"linuxstob:"NAME(
""),
79 snprintf(log_name, LOG_NAME_MAX_LEN,
"confd_%s.log", confd_ep);
89 char str[0x1000]=
"rfb";
94 rc = fwrite(str, 0x1000, 1,
file) == 1 ? 0 : -EINVAL;
103 const char *
location =
"linuxstob:io_sdev";
111 char tmp_location[128];
112 char *fname1, *fname2;
117 .sd_bsize = block_size };
124 cwd = get_current_dir_name();
126 rc = asprintf(&fname1,
"%s/test1", cwd);
128 rc = asprintf(&fname2,
"%s/test2", cwd);
152 total_size = grp_size;
161 m0_fi_enable(
"m0_storage_dev_new_by_conf",
"no-conf-dev");
231 cwd = get_current_dir_name();
233 rc = asprintf(&path1,
"%s/test1", cwd);
235 rc = asprintf(&path2,
"%s/test2", cwd);
345 #undef M0_TRACE_SUBSYSTEM
M0_INTERNAL struct m0_stob_domain * m0_stob_dom_get(struct m0_stob *stob)
M0_INTERNAL struct m0_storage_dev * m0_storage_devs_find_by_cid(struct m0_storage_devs *devs, uint64_t cid)
m0_bcount_t sds_free_blocks
M0_INTERNAL int m0_storage_dev_stob_find(struct m0_storage_devs *devs, struct m0_stob_id *sid, struct m0_stob **stob)
M0_INTERNAL void m0_storage_dev_attach(struct m0_storage_dev *dev, struct m0_storage_devs *devs)
M0_INTERNAL void m0_storage_dev_stob_put(struct m0_storage_devs *devs, struct m0_stob *stob)
static void storage_dev_test(void)
int m0_rpc_server_start(struct m0_rpc_server_ctx *sctx)
struct m0_stob_domain * isd_domain
const struct m0_conf_obj_type M0_CONF_SDEV_TYPE
#define SERVER_ENDPOINT_ADDR
M0_INTERNAL int m0_storage_dev_new_by_conf(struct m0_storage_devs *devs, struct m0_conf_sdev *sdev, bool force, struct m0_storage_dev **dev)
M0_INTERNAL struct m0_stob_domain * m0_stob_domain_find_by_location(const char *location)
M0_INTERNAL int m0_storage_dev_new(struct m0_storage_devs *devs, uint64_t cid, const char *path, uint64_t size, struct m0_conf_sdev *conf_sdev, bool force, struct m0_storage_dev **dev)
#define M0_FID_TINIT(type, container, key)
const char * rsx_log_file_name
M0_INTERNAL void m0_storage_devs_lock(struct m0_storage_devs *devs)
M0_INTERNAL void m0_fi_disable(const char *fp_func, const char *fp_tag)
#define M0_NET_XPRT_PREFIX_DEFAULT
const struct m0_fid_type cot_ftype
static void m0_fi_enable(const char *func, const char *tag)
static struct m0_stob * stob
struct m0_be_seg * rc_beseg
M0_INTERNAL int m0_storage_dev_stob_destroy(struct m0_storage_devs *devs, struct m0_stob *stob, struct m0_dtx *dtx)
M0_INTERNAL void m0_stob_id_make(uint64_t container, uint64_t key, const struct m0_fid *dom_id, struct m0_stob_id *stob_id)
struct m0_net_xprt ** rsx_xprts
M0_INTERNAL void m0_storage_devs_fini(struct m0_storage_devs *devs)
M0_INTERNAL void m0_storage_devs_detach_all(struct m0_storage_devs *devs)
M0_INTERNAL int m0_storage_devs_init(struct m0_storage_devs *devs, enum m0_storage_dev_type type, struct m0_be_seg *be_seg, struct m0_stob_domain *bstore_dom, struct m0_reqh *reqh)
static void m0_fi_enable_off_n_on_m(const char *func, const char *tag, uint32_t n, uint32_t m)
M0_INTERNAL int m0_stob_domain_destroy_location(const char *location)
m0_bcount_t sds_block_size
M0_INTERNAL enum m0_stob_state m0_stob_state_get(struct m0_stob *stob)
struct m0_reqh_context cc_reqh_ctx
M0_INTERNAL void m0_storage_dev_detach(struct m0_storage_dev *dev)
M0_INTERNAL const char * m0_stob_domain_location_get(const struct m0_stob_domain *dom)
M0_INTERNAL void m0_storage_dev_space(struct m0_storage_dev *dev, struct m0_storage_space *space)
#define M0_ALLOC_PTR(ptr)
M0_INTERNAL int m0_storage_dev_stob_create(struct m0_storage_devs *devs, struct m0_stob_id *sid, struct m0_dtx *dtx)
#define M0_UT_CONF_PROCESS
struct m0_net_xprt ** m0_net_all_xprt_get(void)
struct m0_conf_obj sd_obj
static int create_test_file(const char *filename)
static void m0_fi_enable_once(const char *func, const char *tag)
M0_INTERNAL void m0_storage_devs_unlock(struct m0_storage_devs *devs)
struct m0_ut_suite storage_dev_ut
void m0_rpc_server_stop(struct m0_rpc_server_ctx *sctx)
static int rpc_start(struct m0_rpc_server_ctx *rpc_srv)
M0_INTERNAL void m0_stob_delete_mark(struct m0_stob *stob)
M0_INTERNAL uint64_t m0_pid(void)
static void storage_dev_linux(void)
m0_bcount_t sds_total_size
static struct m0_layout_domain domain
struct m0_motr rsx_motr_ctx