24 #ifndef __MOTR_ISCSERVICE_DEMO_UTIL_H__ 25 #define __MOTR_ISCSERVICE_DEMO_UTIL_H__ 127 #define LOG(_fmt, ...) \ 128 fprintf(stderr, "%s: %s():%d: "_fmt, prog, __func__, __LINE__, ##__VA_ARGS__) 129 #define ERR(_fmt, ...) if (trace_level >= LOG_ERROR) LOG(_fmt, ##__VA_ARGS__) 130 #define ERRS(_fmt, ...) if (trace_level >= LOG_ERROR) \ 131 LOG(_fmt ": %s\n", ##__VA_ARGS__, strerror(errno)) 132 #define DBG(_fmt, ...) if (trace_level >= LOG_DEBUG) LOG(_fmt, ##__VA_ARGS__) 133 #define DBG2(_fmt, ...) if (trace_level >= LOG_DEBUG2) LOG(_fmt, ##__VA_ARGS__) 135 #define CHECK_BSZ_ARGS(bsz, m0bs) \ 136 if ((bsz) < 1 || (bsz) % PAGE_SIZE) { \ 137 ERR("bsz(%lu) must be multiple of %luK\n", (m0bs), PAGE_SIZE/1024); \ 140 if ((m0bs) < 1 || (m0bs) % (bsz)) { \ 141 ERR("bsz(%lu) must divide m0bs(%lu)\n", (bsz), (m0bs)); \
int isc_req_prepare(struct isc_req *, struct m0_buf *args, const struct m0_fid *comp, struct m0_layout_io_plop *iopl, uint32_t reply_len)
uint64_t set_exts(struct m0_indexvec *ext, uint64_t off, uint64_t bsz)
int isc_init(struct m0_config *, struct m0_client **)
static struct io_request req
void isc_fini(struct m0_client *)
struct m0_rpc_session * cir_rpc_sess
void free_segs(struct m0_bufvec *data, struct m0_indexvec *ext, struct m0_bufvec *attr)
static void attr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
struct m0_semaphore isc_sem
struct m0_layout_plop * cir_plop
int isc_req_send(struct isc_req *req)
struct m0_fop_isc cir_isc_fop
struct m0_list_link cir_link
void isc_req_fini(struct isc_req *req)
int alloc_segs(struct m0_bufvec *data, struct m0_indexvec *ext, struct m0_bufvec *attr, uint64_t bsz, uint32_t cnt)
uint64_t isc_m0gs(struct m0_obj *, struct m0_client *)
struct m0_realm uber_realm