Go to the source code of this file.
|
#define | __MOTR_ISCSERVICE_DEMO_UTIL_H__ |
|
#define | LOG(_fmt, ...) fprintf(stderr, "%s: %s():%d: "_fmt, prog, __func__, __LINE__, ##__VA_ARGS__) |
|
#define | ERR(_fmt, ...) if (trace_level >= LOG_ERROR) LOG(_fmt, ##__VA_ARGS__) |
|
#define | ERRS(_fmt, ...) |
|
#define | DBG(_fmt, ...) if (trace_level >= LOG_DEBUG) LOG(_fmt, ##__VA_ARGS__) |
|
#define | DBG2(_fmt, ...) if (trace_level >= LOG_DEBUG2) LOG(_fmt, ##__VA_ARGS__) |
|
#define | CHECK_BSZ_ARGS(bsz, m0bs) |
|
|
int | isc_init (struct m0_config *, struct m0_client **) |
|
void | isc_fini (struct m0_client *) |
|
uint64_t | isc_m0gs (struct m0_obj *, struct m0_client *) |
|
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) |
|
int | isc_req_send (struct isc_req *req) |
|
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) |
|
void | free_segs (struct m0_bufvec *data, struct m0_indexvec *ext, struct m0_bufvec *attr) |
|
uint64_t | set_exts (struct m0_indexvec *ext, uint64_t off, uint64_t bsz) |
|
◆ __MOTR_ISCSERVICE_DEMO_UTIL_H__
#define __MOTR_ISCSERVICE_DEMO_UTIL_H__ |
◆ CHECK_BSZ_ARGS
#define CHECK_BSZ_ARGS |
( |
|
bsz, |
|
|
|
m0bs |
|
) |
| |
Value: ERR(
"bsz(%lu) must be multiple of %luK\n", (m0bs),
PAGE_SIZE/1024); \
return -EINVAL; \
} \
if ((m0bs) < 1 || (m0bs) % (bsz)) { \
ERR("bsz(%lu) must divide m0bs(%lu)\n", (bsz), (m0bs)); \
return -EINVAL; \
}
Definition at line 135 of file util.h.
◆ DBG
◆ DBG2
◆ ERR
◆ ERRS
#define ERRS |
( |
|
_fmt, |
|
|
|
... |
|
) |
| |
Value: LOG(_fmt ": %s\n", ##__VA_ARGS__, strerror(errno))
Definition at line 130 of file util.h.
◆ LOG
#define LOG |
( |
|
_fmt, |
|
|
|
... |
|
) |
| fprintf(stderr, "%s: %s():%d: "_fmt, prog, __func__, __LINE__, ##__VA_ARGS__) |
◆ anonymous enum
Enumerator |
---|
LOG_ERROR | |
LOG_DEBUG | |
LOG_DEBUG2 | |
Definition at line 121 of file util.h.
◆ isc_buffer_len
Enumerator |
---|
CBL_DEFAULT_MAX | 32K
|
CBL_DEFAULT_MIN | |
Definition at line 41 of file util.h.
◆ alloc_segs()
◆ free_segs()
◆ isc_fini()
◆ isc_init()
Initialise Motr-related stuff.
Definition at line 247 of file util.c.
◆ isc_m0gs()
Return parity group size for object.
Definition at line 49 of file util.c.
◆ isc_req_fini()
void isc_req_fini |
( |
struct isc_req * |
req | ) |
|
Finalizes the request, including input and result buffers.
Definition at line 229 of file util.c.
◆ isc_req_prepare()
Prepares a request using provided parameters.
- Parameters
-
[in] | args | Holds arguments for the computation. |
[in] | comp | The unique fid associated with the computation. |
[in] | iopl | IO plop associated with the request. |
[in] | reply_len | Expected length of reply buffer. This is allowed to be greater than the actual length of reply. |
Definition at line 108 of file util.c.
◆ isc_req_send()
int isc_req_send |
( |
struct isc_req * |
req | ) |
|
Sends a request asynchronously.
The request is added to the isc_reqs list maintaining the order by the object unit offset. On reply receipt, isc_sem(aphore) is up-ped. The received reply is populated at req->cir_result. The error code is returned at req->cir_rc.
Note: the isc_reqs list is unprotected, so all the requests should be sent from the same thread.
Definition at line 198 of file util.c.
◆ set_exts()
uint64_t set_exts |
( |
struct m0_indexvec * |
ext, |
|
|
uint64_t |
off, |
|
|
uint64_t |
bsz |
|
) |
| |
◆ isc_reqs
◆ isc_sem
◆ m0trace_on
◆ prog
◆ trace_level
◆ uber_realm