[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100917144024.33e66e53.akpm@linux-foundation.org>
Date: Fri, 17 Sep 2010 14:40:24 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Namhyung Kim <namhyung@...il.com>
Cc: Sam Ravnborg <sam@...nborg.org>, Arnd Bergmann <arnd@...db.de>,
Phillip Lougher <phillip@...gher.demon.co.uk>,
Al Viro <viro@...iv.linux.org.uk>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/2] init: add sys-wrapper.h
On Wed, 1 Sep 2010 00:30:18 +0900
Namhyung Kim <namhyung@...il.com> wrote:
> sys-wrapper.h contains wrapper functions for various syscalls used in init
> code. This wrappers handle proper address space conversion so that it can
> remove a lot of warnings from sparse.
This all looks pretty neat.
> +#define kernel_sys_call(call, ...) \
> +({ \
> + long result; \
> + mm_segment_t old_fs = get_fs(); \
> + set_fs(KERNEL_DS); \
> + result = call(__VA_ARGS__); \
> + set_fs(old_fs); \
> + result; \
> +})
I was worried that some syscalls don't need the set_fs(), and that this
would add overhead. But I see that the patch addresses that.
> - int err = sys_mount(name, "/root", fs, flags, data);
> + int err = kernel_sys_mount(name, "/root", fs, flags, data);
It would be good if we could arrange for _all_ kernel syscalls to use
the wrappers. ie: cause a direct call to sys_mount() to not compile?
I don't know how practical that would be.
--
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