From: Matthew Wilcox <matthew@wil.cx>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linux-arch@vger.kernel.org
Subject: Re: [PATCH] consolidate shmat usage
Date: Wed, 23 Mar 2005 14:51:32 +0000 [thread overview]
Message-ID: <20050323145132.GJ21986@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <20050323174810.17df4440.sfr@canb.auug.org.au>
On Wed, Mar 23, 2005 at 05:48:10PM +1100, Stephen Rothwell wrote:
> This patch creates sys_shmat and sys_smhatcall and uses them wherever possible - this tidies up sys_ipc a bit in most cases. I have not touched um arch.
The concept is great, but I'd quibble over the details ...
> I am eventually aiming at consolidating (as much as possible of) sys_ipc
> and doing compat_sys_ipc.
Great, but please remember not all architectures have a sys_ipc (looks like
alpha, ia64, parisc and x86_64 according to a fairly recent version of glibc).
> +++ linus-compat_sys_ipc.2/arch/parisc/kernel/sys_parisc.c 2005-03-23 16:41:53.000000000 +1100
> @@ -163,13 +163,7 @@
>
> long sys_shmat_wrapper(int shmid, char __user *shmaddr, int shmflag)
> {
> - unsigned long raddr;
> - int r;
> -
> - r = do_shmat(shmid, shmaddr, shmflag, &raddr);
> - if (r < 0)
> - return r;
> - return raddr;
> + return sys_shmatcall(shmid, shmaddr, shmflag);
> }
I don't see the need for a wrapper function in sys_parisc.c -- would
make sense to just call the sys_shmatcall() directly. I suspect the same
goes for Alpha's osf_shmat() function.
> diff -ruN linus-compat_sys_ipc.1/ipc/shm.c linus-compat_sys_ipc.2/ipc/shm.c
> --- linus-compat_sys_ipc.1/ipc/shm.c 2005-03-18 04:08:16.000000000 +1100
> +++ linus-compat_sys_ipc.2/ipc/shm.c 2005-03-23 17:18:28.000000000 +1100
> +asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg,
> + unsigned long __user *addr)
> +asmlinkage long sys_shmatcall(int shmid, char __user *shmaddr, int shmflg)
> +{
> + ulong raddr;
> + long ret;
> +
> + ret = do_shmat(shmid, shmaddr, shmflg, &raddr);
> + return ret ? ret : raddr;
> +}
I dislike the naming here. The manpage for shmat is the three-argument
version. The only reason we have the four-argument version is because
of the silly sys_ipc multiplexer. So I think sys_shmat() should be
the three-argument form and we should rename the existing sys_shmat()
to something like ipc_shmat(). Does it need to be asmlinkage?
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
next prev parent reply other threads:[~2005-03-23 14:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-23 4:01 [PATCH] consolidate asm/ipc.h Stephen Rothwell
2005-03-23 4:12 ` David S. Miller
2005-03-23 6:48 ` [PATCH] consolidate shmat usage Stephen Rothwell
2005-03-23 10:54 ` David Howells
2005-04-05 8:02 ` Stephen Rothwell
2005-03-23 14:51 ` Matthew Wilcox [this message]
2005-04-05 8:01 ` Stephen Rothwell
2005-04-05 13:03 ` Matthew Wilcox
2005-04-05 20:00 ` Ralf Baechle
2005-04-05 20:16 ` Russell King
2005-04-05 20:20 ` Ralf Baechle
2005-04-06 15:05 ` Stephen Rothwell
2005-04-07 5:14 ` Stephen Rothwell
2005-04-11 20:29 ` Russell King
2005-04-27 6:27 ` [PATCH] consolidate sys_shmat Stephen Rothwell
2005-04-27 12:50 ` Ralf Baechle
2005-04-27 14:36 ` Stephen Rothwell
2005-04-05 8:05 ` [PATCH] consolidate shmat usage Stephen Rothwell
2005-03-23 8:06 ` [PATCH] consolidate asm/ipc.h Andi Kleen
2005-03-24 0:30 ` Stephen Rothwell
2005-03-23 10:49 ` David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050323145132.GJ21986@parcelfarce.linux.theplanet.co.uk \
--to=matthew@wil.cx \
--cc=linux-arch@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox