diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2013-04-30 18:27:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-30 20:04:03 -0400 |
commit | 1a0df59444972105f0d4c2b0c16ce414d70c420a (patch) | |
tree | 39403c6890f792b0a4af7218884d375ec7b975ed /kernel/compat.c | |
parent | 8d82e180b51f8ecca9ae9d6a3e7f01d50ea34c20 (diff) |
kernel/compat.c: make do_sysinfo() static
The only use outside of kernel/timer.c was in kernel/compat.c, so move
compat_sys_sysinfo() next to sys_sysinfo() in kernel/timer.c.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/compat.c')
-rw-r--r-- | kernel/compat.c | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/kernel/compat.c b/kernel/compat.c index 19971d8c7299..1e8f1455117a 100644 --- a/kernel/compat.c +++ b/kernel/compat.c | |||
@@ -1138,71 +1138,6 @@ asmlinkage long compat_sys_migrate_pages(compat_pid_t pid, | |||
1138 | } | 1138 | } |
1139 | #endif | 1139 | #endif |
1140 | 1140 | ||
1141 | struct compat_sysinfo { | ||
1142 | s32 uptime; | ||
1143 | u32 loads[3]; | ||
1144 | u32 totalram; | ||
1145 | u32 freeram; | ||
1146 | u32 sharedram; | ||
1147 | u32 bufferram; | ||
1148 | u32 totalswap; | ||
1149 | u32 freeswap; | ||
1150 | u16 procs; | ||
1151 | u16 pad; | ||
1152 | u32 totalhigh; | ||
1153 | u32 freehigh; | ||
1154 | u32 mem_unit; | ||
1155 | char _f[20-2*sizeof(u32)-sizeof(int)]; | ||
1156 | }; | ||
1157 | |||
1158 | asmlinkage long | ||
1159 | compat_sys_sysinfo(struct compat_sysinfo __user *info) | ||
1160 | { | ||
1161 | struct sysinfo s; | ||
1162 | |||
1163 | do_sysinfo(&s); | ||
1164 | |||
1165 | /* Check to see if any memory value is too large for 32-bit and scale | ||
1166 | * down if needed | ||
1167 | */ | ||
1168 | if ((s.totalram >> 32) || (s.totalswap >> 32)) { | ||
1169 | int bitcount = 0; | ||
1170 | |||
1171 | while (s.mem_unit < PAGE_SIZE) { | ||
1172 | s.mem_unit <<= 1; | ||
1173 | bitcount++; | ||
1174 | } | ||
1175 | |||
1176 | s.totalram >>= bitcount; | ||
1177 | s.freeram >>= bitcount; | ||
1178 | s.sharedram >>= bitcount; | ||
1179 | s.bufferram >>= bitcount; | ||
1180 | s.totalswap >>= bitcount; | ||
1181 | s.freeswap >>= bitcount; | ||
1182 | s.totalhigh >>= bitcount; | ||
1183 | s.freehigh >>= bitcount; | ||
1184 | } | ||
1185 | |||
1186 | if (!access_ok(VERIFY_WRITE, info, sizeof(struct compat_sysinfo)) || | ||
1187 | __put_user (s.uptime, &info->uptime) || | ||
1188 | __put_user (s.loads[0], &info->loads[0]) || | ||
1189 | __put_user (s.loads[1], &info->loads[1]) || | ||
1190 | __put_user (s.loads[2], &info->loads[2]) || | ||
1191 | __put_user (s.totalram, &info->totalram) || | ||
1192 | __put_user (s.freeram, &info->freeram) || | ||
1193 | __put_user (s.sharedram, &info->sharedram) || | ||
1194 | __put_user (s.bufferram, &info->bufferram) || | ||
1195 | __put_user (s.totalswap, &info->totalswap) || | ||
1196 | __put_user (s.freeswap, &info->freeswap) || | ||
1197 | __put_user (s.procs, &info->procs) || | ||
1198 | __put_user (s.totalhigh, &info->totalhigh) || | ||
1199 | __put_user (s.freehigh, &info->freehigh) || | ||
1200 | __put_user (s.mem_unit, &info->mem_unit)) | ||
1201 | return -EFAULT; | ||
1202 | |||
1203 | return 0; | ||
1204 | } | ||
1205 | |||
1206 | COMPAT_SYSCALL_DEFINE2(sched_rr_get_interval, | 1141 | COMPAT_SYSCALL_DEFINE2(sched_rr_get_interval, |
1207 | compat_pid_t, pid, | 1142 | compat_pid_t, pid, |
1208 | struct compat_timespec __user *, interval) | 1143 | struct compat_timespec __user *, interval) |