Re: [RFC/PATCH 2/4] fs/mm: execute in place (3rd version)

From: Jörn Engel
Date: Tue May 24 2005 - 05:42:23 EST


On Tue, 24 May 2005 15:00:29 +0530, Suparna Bhattacharya wrote:
>
> OK, though this leaves filemap.c alone which is good, I have to admit
> that this entire duplication of read/write routines really worries me.
>
> There has to be a third way.

There is. I'm not convinced it's a good idea, but maybe someone
smarter can comment on it.

v1 and v2 basically contained the generic code with an extra check
here and there.

int do_shtuff(...)
{
if (xip)
do_xip_shtuff(...);
/* shtuff */
...
}

v3 contains a copy of the generic code in filemap_xip.c.

int do_shtuff_xip(...)
{
do_xip_shtuff(...);
/* shtuff copied from filemap.c */
...
}

v4 could do something like this:

int __do_generic_shtuff(...)
{
/* the generic shtuff */
...
}

int do_shtuff(...)
{
return __do_generic_shtuff(...);
}

int do_shtuff_xip(...)
{
do_xip_shtuff(...);
return __do_generic_shtuff(...);
}

Jörn

--
You cannot suppose that Moliere ever troubled himself to be original in the
matter of ideas. You cannot suppose that the stories he tells in his plays
have never been told before. They were culled, as you very well know.
-- Andre-Louis Moreau in Scarabouche
-
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/