Re: [PATCH 3/18] allow callers of seq_open do allocation themselves

From: Jonathan Corbet
Date: Tue Nov 08 2005 - 15:33:28 EST


Al Viro <viro@xxxxxxxxxxxxxxxx> wrote:

> Allows caller of seq_open() to kmalloc() seq_file + whatever else they want
> and set ->private_data to it. seq_open() will then abstain from doing
> allocation itself.

It looks like seq_release() frees the structure regardless of where it
came from. So the seq_file structure must be the first field in
whatever structure contains it, and one has to hope that won't change in
the future. Is that really the way the interface was meant to work?

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