diff options
author | Christoph Hellwig <hch@lst.de> | 2008-10-16 01:02:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 14:21:33 -0400 |
commit | f7a5000f7a8924e9c5fad1801616601d6dc65a17 (patch) | |
tree | 82bd7f554378b26fe23707a3755359787b252574 /arch/ia64/ia32/sys_ia32.c | |
parent | f7ad160b49c49dc9cd383b9184c6fa4a9b4f7ebb (diff) |
compat: move cp_compat_stat to common code
struct stat / compat_stat is the same on all architectures, so
cp_compat_stat should be, too.
Turns out it is, except that various architectures have slightly and some
high2lowuid/high2lowgid or the direct assignment instead of the
SET_UID/SET_GID that expands to the correct one anyway.
This patch replaces the arch-specific cp_compat_stat implementations with
a common one based on the x86-64 one.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: David S. Miller <davem@davemloft.net> [ sparc bits ]
Acked-by: Kyle McMartin <kyle@mcmartin.ca> [ parisc bits ]
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/ia64/ia32/sys_ia32.c')
-rw-r--r-- | arch/ia64/ia32/sys_ia32.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c index bf196cbb3796..2362a8eefb30 100644 --- a/arch/ia64/ia32/sys_ia32.c +++ b/arch/ia64/ia32/sys_ia32.c | |||
@@ -118,41 +118,6 @@ sys32_execve (char __user *name, compat_uptr_t __user *argv, compat_uptr_t __use | |||
118 | return error; | 118 | return error; |
119 | } | 119 | } |
120 | 120 | ||
121 | int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf) | ||
122 | { | ||
123 | compat_ino_t ino; | ||
124 | int err; | ||
125 | |||
126 | if ((u64) stat->size > MAX_NON_LFS || | ||
127 | !old_valid_dev(stat->dev) || | ||
128 | !old_valid_dev(stat->rdev)) | ||
129 | return -EOVERFLOW; | ||
130 | |||
131 | ino = stat->ino; | ||
132 | if (sizeof(ino) < sizeof(stat->ino) && ino != stat->ino) | ||
133 | return -EOVERFLOW; | ||
134 | |||
135 | if (clear_user(ubuf, sizeof(*ubuf))) | ||
136 | return -EFAULT; | ||
137 | |||
138 | err = __put_user(old_encode_dev(stat->dev), &ubuf->st_dev); | ||
139 | err |= __put_user(ino, &ubuf->st_ino); | ||
140 | err |= __put_user(stat->mode, &ubuf->st_mode); | ||
141 | err |= __put_user(stat->nlink, &ubuf->st_nlink); | ||
142 | err |= __put_user(high2lowuid(stat->uid), &ubuf->st_uid); | ||
143 | err |= __put_user(high2lowgid(stat->gid), &ubuf->st_gid); | ||
144 | err |= __put_user(old_encode_dev(stat->rdev), &ubuf->st_rdev); | ||
145 | err |= __put_user(stat->size, &ubuf->st_size); | ||
146 | err |= __put_user(stat->atime.tv_sec, &ubuf->st_atime); | ||
147 | err |= __put_user(stat->atime.tv_nsec, &ubuf->st_atime_nsec); | ||
148 | err |= __put_user(stat->mtime.tv_sec, &ubuf->st_mtime); | ||
149 | err |= __put_user(stat->mtime.tv_nsec, &ubuf->st_mtime_nsec); | ||
150 | err |= __put_user(stat->ctime.tv_sec, &ubuf->st_ctime); | ||
151 | err |= __put_user(stat->ctime.tv_nsec, &ubuf->st_ctime_nsec); | ||
152 | err |= __put_user(stat->blksize, &ubuf->st_blksize); | ||
153 | err |= __put_user(stat->blocks, &ubuf->st_blocks); | ||
154 | return err; | ||
155 | } | ||
156 | 121 | ||
157 | #if PAGE_SHIFT > IA32_PAGE_SHIFT | 122 | #if PAGE_SHIFT > IA32_PAGE_SHIFT |
158 | 123 | ||