/* Decrement the entries to the page that an event is on. The event does not even need to exist, only the pointer to the page it is on. This may only be called before the commit takes place.  */
static void rb_decrement_entry(struct ring_buffer_per_cpu *cpu_buffer, struct ring_buffer_event *event)
/* Decrement the entries to the page that an event is on. The event does not even need to exist, only the pointer to the page it is on. This may only be called before the commit takes place.  */
static void rb_decrement_entry(struct ring_buffer_per_cpu *cpu_buffer, struct ring_buffer_event *event)
{
	unsigned long addr = (unsigned long)event;
	struct buffer_page *bpage = cpu_buffer->commit_page;
	struct buffer_page *start;
	addr &= PAGE_MASK;
	if (likely(bpage->page == (void *)addr)) {
		local_dec(&bpage->entries);
		return;
	}
	rb_inc_page(cpu_buffer, &bpage);
	start = bpage;
	do {
		if (bpage->page == (void *)addr) {
			local_dec(&bpage->entries);
			return;
		}
		rb_inc_page(cpu_buffer, &bpage);
	} while (bpage != start);
	RB_WARN_ON(cpu_buffer, 1);
}