On 2019-02-15, John Ogness <john.ogn...@linutronix.de> wrote:
> prb_commit() does not actually care what is in the handle. It is going
> to commit everything up to the reserve.

After thinking about what I wrote here, I realized that the struct
prb_handle has no purpose in this ringbuffer implementation. We really
could simplify the writer interface to:

    char *prb_reserve(struct printk_ringbuffer *rb, unsigned int size);

    void prb_commit(struct printk_ringbuffer *rb);

That probably feels really strange because the writer doesn't specify
_what_ to commit. But this ringbuffer implementation doesn't need to
know that.

The only reason I can think of for having a handle is if there should be
any statistics, debugging, or sanity checking added. (For example if a
writer tried to commit something it did not reserve.)

John Ogness

Reply via email to