Subject: Re: genfs_getpages and MAX_READ_AHEAD
To: None <petrov@netbsd.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 06/11/2003 14:02:47
hi,
> > currently, genfs_getpages has a limit of number of pages.
> > it's annoying because a caller should consider filesystem's block size
> > to avoid assertion failure.
> >
> > how about following patch?
> > although using alloca here is ...yucky,
> > there're already variable-sized arrays around.
> >
>
> Could you give more details on why it's needed. Is that easy
> to bump on that limitation?
to bump it simply, we should know maximum size of filesystem block.
> In this patch you're replacing fixed-size array and assert on
> alloca, which is more dangerous. malloc/free would be safer
> but they cost more.
i don't think that (big) fixed-sized array is more safe than alloca.
i agree that having a limit of size to alloca and using malloc for big ones
(as Jason suggested) is reasonable.
YAMAMOTO Takashi