diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-07-27 06:29:16 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-07-27 06:29:19 -0400 |
commit | 7a8e0c8d9af43c9dfc62a8b2b9cc0484f48f7da4 (patch) | |
tree | a97ebd19d8f1216b63c0d2743fbef93eecf63fb7 /arch/s390/kernel/sys_s390.c | |
parent | cb1863a4619e5c80e43acad61b19cc5114b1c60d (diff) |
[S390] Wire up sys_fallocate.
This patch implements support of fallocate system call on s390(x)
platform. A wrapper is added to address the issue which s390 ABI has with
the arguments of this system call.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/sys_s390.c')
-rw-r--r-- | arch/s390/kernel/sys_s390.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c index 1c90c7e99978..13e27bdb96e2 100644 --- a/arch/s390/kernel/sys_s390.c +++ b/arch/s390/kernel/sys_s390.c | |||
@@ -265,3 +265,23 @@ s390_fadvise64_64(struct fadvise64_64_args __user *args) | |||
265 | return -EFAULT; | 265 | return -EFAULT; |
266 | return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice); | 266 | return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice); |
267 | } | 267 | } |
268 | |||
269 | #ifndef CONFIG_64BIT | ||
270 | /* | ||
271 | * This is a wrapper to call sys_fallocate(). For 31 bit s390 the last | ||
272 | * 64 bit argument "len" is split into the upper and lower 32 bits. The | ||
273 | * system call wrapper in the user space loads the value to %r6/%r7. | ||
274 | * The code in entry.S keeps the values in %r2 - %r6 where they are and | ||
275 | * stores %r7 to 96(%r15). But the standard C linkage requires that | ||
276 | * the whole 64 bit value for len is stored on the stack and doesn't | ||
277 | * use %r6 at all. So s390_fallocate has to convert the arguments from | ||
278 | * %r2: fd, %r3: mode, %r4/%r5: offset, %r6/96(%r15)-99(%r15): len | ||
279 | * to | ||
280 | * %r2: fd, %r3: mode, %r4/%r5: offset, 96(%r15)-103(%r15): len | ||
281 | */ | ||
282 | asmlinkage long s390_fallocate(int fd, int mode, loff_t offset, | ||
283 | u32 len_high, u32 len_low) | ||
284 | { | ||
285 | return sys_fallocate(fd, mode, offset, ((u64)len_high << 32) | len_low); | ||
286 | } | ||
287 | #endif | ||