tech-kern archive

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

Re: cookies and kmem_alloc



On Tue, Jan 26, 2016 at 08:45:10AM -0500, Christos Zoulas wrote:
> On Jan 26,  6:17am, dholland-tech%netbsd.org@localhost (David Holland) wrote:
> -- Subject: Re: cookies and kmem_alloc
> 
> | On Mon, Jan 25, 2016 at 02:31:15PM -0500, Christos Zoulas wrote:
> |  > The directory functions pass around ap_cookies, and ap_ncookies,
> |  > but if one uses kmem_alloc() instead of malloc(), there is no way
> |  > to kmem_free() the buffer, since we don't pass the size. I suggest
> |  > that we add a new field called ap_acookies, which holds the size we
> |  > allocated with kmem_alloc(), or it is 0 for compatibility for code
> |  > that allocated the cookie buffer with malloc(). Any better ideas?
> | 
> | Burn down the in-kernel readdir interface and do a new one; it is
> | terrible the way it is and there's nothing to be gained by attempting
> | to polish it.
> 
> It is complicated to do that. And we'll need to retain compatibility at
> the system call level which makes this harder.

Why don't we move to a real push interface for readdir-like interfaces
and not the current mess we have? That would remove most of the double
buffering needs or at least contain them in the consumer logic, which
does know the sizes of things it cares about.

Joerg


Home | Main Index | Thread Index | Old Index