Signed-off-by: Angus Salkeld <asalkeld(a)redhat.com>
---
include/qb/qbrb.h | 14 +++++++-------
lib/logsys.c | 8 +++-----
lib/ringbuffer.c | 8 ++++----
3 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/include/qb/qbrb.h b/include/qb/qbrb.h
index fe70a6c..1fb9ef6 100644
--- a/include/qb/qbrb.h
+++ b/include/qb/qbrb.h
@@ -101,16 +101,16 @@ void qb_rb_close(qb_ringbuffer_t * rb);
/**
* Write a chunk to the ring buffer.
*
- * This simply calls qb_rb_chunk_writable_alloc() and then
- * qb_rb_chunk_writable_commit().
+ * This simply calls qb_rb_chunk_alloc() and then
+ * qb_rb_chunk_commit().
*
* @param rb ringbuffer instance
* @param data (in) the data to write
* @param len (in) the size of the chunk.
* @return the amount of bytes actually buffered (either len or -1).
*
- * @see qb_rb_chunk_writable_alloc()
- * @see qb_rb_chunk_writable_commit()
+ * @see qb_rb_chunk_alloc()
+ * @see qb_rb_chunk_commit()
*/
ssize_t qb_rb_chunk_write(qb_ringbuffer_t * rb, const void *data, size_t len);
@@ -125,16 +125,16 @@ ssize_t qb_rb_chunk_write(qb_ringbuffer_t * rb, const void *data,
size_t len);
* @param len (in) the size to allocate.
* @return pointer to chunk to write to, or NULL (if no space).
*
- * @see qb_rb_chunk_writable_alloc()
+ * @see qb_rb_chunk_alloc()
*/
-void *qb_rb_chunk_writable_alloc(qb_ringbuffer_t * rb, size_t len);
+void *qb_rb_chunk_alloc(qb_ringbuffer_t * rb, size_t len);
/**
* finalize the chunk.
* @param rb ringbuffer instance
* @param len (in) the size of the chunk.
*/
-int32_t qb_rb_chunk_writable_commit(qb_ringbuffer_t * rb, size_t len);
+int32_t qb_rb_chunk_commit(qb_ringbuffer_t * rb, size_t len);
/**
* Read (without reclaiming) the last chunk.
diff --git a/lib/logsys.c b/lib/logsys.c
index 280c40d..b5ccf9f 100644
--- a/lib/logsys.c
+++ b/lib/logsys.c
@@ -950,10 +950,8 @@ void _logsys_log_rec(uint32_t rec_ident,
record_reclaim_size += 4;
qb_thread_lock(logsys_flt_lock);
- flt_data =
- qb_rb_chunk_writable_alloc(rb,
- (record_reclaim_size *
- sizeof(uint32_t)));
+ flt_data = qb_rb_chunk_alloc(rb,
+ (record_reclaim_size * sizeof(uint32_t)));
assert(flt_data != NULL);
idx = 0;
@@ -988,7 +986,7 @@ void _logsys_log_rec(uint32_t rec_ident,
sleep(1);
assert(0);
}
- qb_rb_chunk_writable_commit(rb, (idx * sizeof(uint32_t)));
+ qb_rb_chunk_commit(rb, (idx * sizeof(uint32_t)));
qb_thread_unlock(logsys_flt_lock);
records_written++;
diff --git a/lib/ringbuffer.c b/lib/ringbuffer.c
index 265f483..5de6d04 100644
--- a/lib/ringbuffer.c
+++ b/lib/ringbuffer.c
@@ -310,7 +310,7 @@ ssize_t qb_rb_space_used(qb_ringbuffer_t * rb)
return used;
}
-void *qb_rb_chunk_writable_alloc(qb_ringbuffer_t * rb, size_t len)
+void *qb_rb_chunk_alloc(qb_ringbuffer_t * rb, size_t len)
{
uint32_t write_pt;
@@ -370,7 +370,7 @@ _qb_rb_chunk_step_locked_(qb_ringbuffer_t * rb, uint32_t pointer)
return pointer;
}
-int32_t qb_rb_chunk_writable_commit(qb_ringbuffer_t * rb, size_t len)
+int32_t qb_rb_chunk_commit(qb_ringbuffer_t * rb, size_t len)
{
uint32_t old_write_pt = rb->shared_hdr->write_pt;
/*
@@ -403,7 +403,7 @@ int32_t qb_rb_chunk_writable_commit(qb_ringbuffer_t * rb, size_t len)
ssize_t qb_rb_chunk_write(qb_ringbuffer_t * rb, const void *data, size_t len)
{
- char *dest = qb_rb_chunk_writable_alloc(rb, len);
+ char *dest = qb_rb_chunk_alloc(rb, len);
if (dest == NULL) {
return -1;
@@ -411,7 +411,7 @@ ssize_t qb_rb_chunk_write(qb_ringbuffer_t * rb, const void *data,
size_t len)
memcpy(dest, data, len);
- qb_rb_chunk_writable_commit(rb, len);
+ qb_rb_chunk_commit(rb, len);
return len;
}
--
1.6.6.1