Re: [-mm patch] UNION_FS must depend on SLAB

Josef Sipek
2007-02-20T15:15:10Z

On Tue, Feb 20, 2007 at 08:37:34AM +0200, Pekka Enberg wrote:
> On 2/20/07, Adrian Bunk <bunk@stusta.de> wrote:
> > CC fs/unionfs/copyup.o
> >/home/bunk/linux/kernel-2.6/linux-2.6.20-mm2/fs/unionfs/copyup.c: In
> >function 'create_parents_named':
> >/home/bunk/linux/kernel-2.6/linux-2.6.20-mm2/fs/unionfs/copyup.c:620:
> >error: 'malloc_sizes' undeclared (first use in this function)
> >/home/bunk/linux/kernel-2.6/linux-2.6.20-mm2/fs/unionfs/copyup.c:620:
> >error: (Each undeclared identifier is reported only once
> >/home/bunk/linux/kernel-2.6/linux-2.6.20-mm2/fs/unionfs/copyup.c:620:
> >error: for each function it appears in.)
> >make[3]: *** [fs/unionfs/copyup.o] Error 1
>
> Hmm, why is unionfs playing around with malloc_sizes in the first place?
> Jeff?

The code is in lookup.c:

if (oldsize) {
int minsize = malloc_sizes[0].cs_size;

if (!newsize || ((oldsize < newsize) && (newsize > minsize))) {
kfree(info->lower_paths);
info->lower_paths = NULL;
}
}

That's the only user of malloc_sizes. It is supposed to be an optimization -
we get the smallest sized piece of memory even if we don't need all of it.
This way we don't reallocate & memcpy needlessly.

Josef "Jeff" Sipek.

--
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like
that.
- Linus Torvalds