struct lib_ring_buffer_backend *bufb,
size_t size, size_t num_subbuf,
int extra_reader_sb,
- struct shm_handle *handle,
+ struct lttng_ust_shm_handle *handle,
struct shm_object *shmobj)
{
struct channel_backend *chanb = &shmp(handle, bufb->chan)->backend;
int lib_ring_buffer_backend_create(struct lib_ring_buffer_backend *bufb,
struct channel_backend *chanb, int cpu,
- struct shm_handle *handle,
+ struct lttng_ust_shm_handle *handle,
struct shm_object *shmobj)
{
- const struct lib_ring_buffer_config *config = chanb->config;
+ const struct lib_ring_buffer_config *config = &chanb->config;
set_shmp(bufb->chan, handle->chan._ref);
bufb->cpu = cpu;
}
void lib_ring_buffer_backend_reset(struct lib_ring_buffer_backend *bufb,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct channel_backend *chanb = &shmp(handle, bufb->chan)->backend;
- const struct lib_ring_buffer_config *config = chanb->config;
+ const struct lib_ring_buffer_config *config = &chanb->config;
unsigned long num_subbuf_alloc;
unsigned int i;
void channel_backend_reset(struct channel_backend *chanb)
{
struct channel *chan = caa_container_of(chanb, struct channel, backend);
- const struct lib_ring_buffer_config *config = chanb->config;
+ const struct lib_ring_buffer_config *config = &chanb->config;
/*
* Don't reset buf_size, subbuf_size, subbuf_size_order,
* @parent: dentry of parent directory, %NULL for root directory
* @subbuf_size: size of sub-buffers (> PAGE_SIZE, power of 2)
* @num_subbuf: number of sub-buffers (power of 2)
- * @shm_handle: shared memory handle
+ * @lttng_ust_shm_handle: shared memory handle
*
* Returns channel pointer if successful, %NULL otherwise.
*
const char *name,
const struct lib_ring_buffer_config *config,
void *priv, size_t subbuf_size, size_t num_subbuf,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct channel *chan = caa_container_of(chanb, struct channel, backend);
unsigned int i;
chanb->num_subbuf = num_subbuf;
strncpy(chanb->name, name, NAME_MAX);
chanb->name[NAME_MAX - 1] = '\0';
- chanb->config = config;
+ memcpy(&chanb->config, config, sizeof(*config));
/* Per-cpu buffer size: control (prior to backend) */
shmsize = offset_align(shmsize, __alignof__(struct lib_ring_buffer));
* Destroy all channel buffers and frees the channel.
*/
void channel_backend_free(struct channel_backend *chanb,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
- const struct lib_ring_buffer_config *config = chanb->config;
+ const struct lib_ring_buffer_config *config = &chanb->config;
unsigned int i;
if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
* Returns the length copied.
*/
size_t lib_ring_buffer_read(struct lib_ring_buffer_backend *bufb, size_t offset,
- void *dest, size_t len, struct shm_handle *handle)
+ void *dest, size_t len, struct lttng_ust_shm_handle *handle)
{
struct channel_backend *chanb = &shmp(handle, bufb->chan)->backend;
- const struct lib_ring_buffer_config *config = chanb->config;
+ const struct lib_ring_buffer_config *config = &chanb->config;
ssize_t orig_len;
struct lib_ring_buffer_backend_pages_shmp *rpages;
unsigned long sb_bindex, id;
* Should be protected by get_subbuf/put_subbuf.
*/
int lib_ring_buffer_read_cstr(struct lib_ring_buffer_backend *bufb, size_t offset,
- void *dest, size_t len, struct shm_handle *handle)
+ void *dest, size_t len, struct lttng_ust_shm_handle *handle)
{
struct channel_backend *chanb = &shmp(handle, bufb->chan)->backend;
- const struct lib_ring_buffer_config *config = chanb->config;
+ const struct lib_ring_buffer_config *config = &chanb->config;
ssize_t string_len, orig_offset;
char *str;
struct lib_ring_buffer_backend_pages_shmp *rpages;
*/
void *lib_ring_buffer_read_offset_address(struct lib_ring_buffer_backend *bufb,
size_t offset,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct lib_ring_buffer_backend_pages_shmp *rpages;
struct channel_backend *chanb = &shmp(handle, bufb->chan)->backend;
- const struct lib_ring_buffer_config *config = chanb->config;
+ const struct lib_ring_buffer_config *config = &chanb->config;
unsigned long sb_bindex, id;
offset &= chanb->buf_size - 1;
*/
void *lib_ring_buffer_offset_address(struct lib_ring_buffer_backend *bufb,
size_t offset,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
size_t sbidx;
struct lib_ring_buffer_backend_pages_shmp *rpages;
struct channel_backend *chanb = &shmp(handle, bufb->chan)->backend;
- const struct lib_ring_buffer_config *config = chanb->config;
+ const struct lib_ring_buffer_config *config = &chanb->config;
unsigned long sb_bindex, id;
- void *ret;
offset &= chanb->buf_size - 1;
sbidx = offset >> chanb->subbuf_size_order;