Re: [RFC PATCH v1 04/25] printk-rb: add writer interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2019-02-15, John Ogness <john.ogness@xxxxxxxxxxxxx> 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



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux