lkml.org 
[lkml]   [2006]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [take10 1/2] kevent: Core files.
On Wed, Aug 16, 2006 at 03:37:30PM +0300, Mika Penttilä (mika.penttila@kolumbus.fi) wrote:
> +void kevent_user_ring_add_event(struct kevent *k)
> +{
> + unsigned int pidx, off;
> + struct kevent_mring *ring, *copy_ring;
> +
> + ring = (struct kevent_mring *)k->user->pring[0];
> +
> + pidx = ring->index/KEVENTS_ON_PAGE;
> + off = ring->index%KEVENTS_ON_PAGE;
> +
> + copy_ring = (struct kevent_mring *)k->user->pring[pidx];
> +
> + copy_ring->event[off].id.raw[0] = k->event.id.raw[0];
> + copy_ring->event[off].id.raw[1] = k->event.id.raw[1];
> + copy_ring->event[off].ret_flags = k->event.ret_flags;
> +
> + if (++ring->index >= KEVENT_MAX_EVENTS)
> + ring->index = 0;
> +}
>
> Can you assume that the page at pidx is already allocated and why?

It is checked and allocated if needed in kevent_user_ring_grow(), which
is called for each new kevent.

> --Mika
>

--
Evgeniy Polyakov
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-08-16 14:47    [W:0.194 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site