[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTinOD=ovyk5CdBeJf7e0cPeGP_WUE=ZFArWrvBe2@mail.gmail.com>
Date: Sun, 26 Dec 2010 09:48:39 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Jesper Juhl <jj@...osbits.net>
Cc: linux-kernel@...r.kernel.org, Will Dyson <will_dyson@...ox.com>,
Makoto Kato <m_kato@....so-net.ne.jp>,
"Sergey S. Kostyliov" <rathamahata@...4.ru>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] befs: Don't pass huge structs by value.
On Sat, Dec 25, 2010 at 20:27, Jesper Juhl <jj@...osbits.net> wrote:
> 'struct befs_disk_data_stream' is huge (~144 bytes) and it's being passed
> by value in fs/befs/endian.h::cpu_to_fsrun().
>
> It seems to me that it would be better to pass a pointer, no?
> This patch changes the function to take a pointer to the large struct.
>
> Signed-off-by: Jesper Juhl <jj@...osbits.net>
> ---
> endian.h | 16 ++++++++--------
> linuxvfs.c | 2 +-
> 2 files changed, 9 insertions(+), 9 deletions(-)
>
> Compile tested only. I have no way to test this.
>
> diff --git a/fs/befs/endian.h b/fs/befs/endian.h
> index 6cb84d8..a99caa0 100644
> --- a/fs/befs/endian.h
> +++ b/fs/befs/endian.h
> @@ -102,22 +102,22 @@ cpu_to_fsrun(const struct super_block *sb, befs_block_run n)
> }
>
> static inline befs_data_stream
> -fsds_to_cpu(const struct super_block *sb, befs_disk_data_stream n)
> +fsds_to_cpu(const struct super_block *sb, befs_disk_data_stream *n)
Please make befs_disk_data_stream const, so people don't accidentally modify it.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists