Re: [PATCH v7 0/2] ring-buffer: Rename sub-buffer into buffer page

From: Steven Rostedt
Date: Mon Dec 18 2023 - 11:42:20 EST


On Mon, 18 Dec 2023 11:28:17 -0500
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> > Remove all references to sub-buffer and replace them with either bpage
> > or ring_buffer_page.

The user interface should not be changed.

But what I would like to have changed (and this will come after all other
changes are complete), is to do the following renaming:

original structure name new name variable reference
----------------------- -------- ------------------
struct buffer_data_page struct buffer_data bdata (was bpage)
struct buffer_page struct buffer_subbuf subbuf (was also bpage)

Also change:

struct buffer_page {
[..]
struct buffer_data_page *page; /* Actual data page */
};

Into:

struct buffer_subbuf {
[..]
struct buffer_data *data; /* Actual data */
};



Then we can do a global rename of functions like:

free_buffer_page() -> free_buffer_subbuf()

And things like rb_init_page() into rb_init_subbuf()

__rb_allocate_pages() -> rb_allocate_subbufs()

etc.

This should be broken up into steps of changes:

1. Rename the struct buffer_data_page and bpage->bdata
2. Rename the struct buffer_page and bpage->subbuf
3. Rename static functions

And I just realized that the two functions exposed outside of the file are
not used anywhere else. We can remove one and make the other one static (as
it is used within the file).

ring_buffer_nr_pages() -> delete
ring_buffer_nr_dirty_pages -> convert to static rb_nr_dirty_pages()


Thanks,

-- Steve