/* Because the reader may move the head_page pointer, we can not trust what the head page is (it may be pointing to the reader page). But if the next page is a header page, its flags will be non zero.  */
static int rb_is_head_page(struct ring_buffer_per_cpu *cpu_buffer, struct buffer_page *page, struct list_head *list)
/* Because the reader may move the head_page pointer, we can not trust what the head page is (it may be pointing to the reader page). But if the next page is a header page, its flags will be non zero.  */
static int rb_is_head_page(struct ring_buffer_per_cpu *cpu_buffer, struct buffer_page *page, struct list_head *list)
{
	unsigned long val;
	val = (unsigned long)list->next;
	if ((val & ~RB_FLAG_MASK) != (unsigned long)&page->list)
		return RB_PAGE_MOVED;
	return val & RB_FLAG_MASK;
}