diff options
Diffstat (limited to 'arch/s390/kernel/sys_s390.c')
-rw-r--r-- | arch/s390/kernel/sys_s390.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c index e9d94f61d500..86a74c9c9e63 100644 --- a/arch/s390/kernel/sys_s390.c +++ b/arch/s390/kernel/sys_s390.c | |||
@@ -32,32 +32,6 @@ | |||
32 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
33 | #include "entry.h" | 33 | #include "entry.h" |
34 | 34 | ||
35 | /* common code for old and new mmaps */ | ||
36 | static inline long do_mmap2( | ||
37 | unsigned long addr, unsigned long len, | ||
38 | unsigned long prot, unsigned long flags, | ||
39 | unsigned long fd, unsigned long pgoff) | ||
40 | { | ||
41 | long error = -EBADF; | ||
42 | struct file * file = NULL; | ||
43 | |||
44 | flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | ||
45 | if (!(flags & MAP_ANONYMOUS)) { | ||
46 | file = fget(fd); | ||
47 | if (!file) | ||
48 | goto out; | ||
49 | } | ||
50 | |||
51 | down_write(¤t->mm->mmap_sem); | ||
52 | error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); | ||
53 | up_write(¤t->mm->mmap_sem); | ||
54 | |||
55 | if (file) | ||
56 | fput(file); | ||
57 | out: | ||
58 | return error; | ||
59 | } | ||
60 | |||
61 | /* | 35 | /* |
62 | * Perform the select(nd, in, out, ex, tv) and mmap() system | 36 | * Perform the select(nd, in, out, ex, tv) and mmap() system |
63 | * calls. Linux for S/390 isn't able to handle more than 5 | 37 | * calls. Linux for S/390 isn't able to handle more than 5 |
@@ -81,7 +55,7 @@ SYSCALL_DEFINE1(mmap2, struct mmap_arg_struct __user *, arg) | |||
81 | 55 | ||
82 | if (copy_from_user(&a, arg, sizeof(a))) | 56 | if (copy_from_user(&a, arg, sizeof(a))) |
83 | goto out; | 57 | goto out; |
84 | error = do_mmap2(a.addr, a.len, a.prot, a.flags, a.fd, a.offset); | 58 | error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset); |
85 | out: | 59 | out: |
86 | return error; | 60 | return error; |
87 | } | 61 | } |
@@ -98,7 +72,7 @@ SYSCALL_DEFINE1(s390_old_mmap, struct mmap_arg_struct __user *, arg) | |||
98 | if (a.offset & ~PAGE_MASK) | 72 | if (a.offset & ~PAGE_MASK) |
99 | goto out; | 73 | goto out; |
100 | 74 | ||
101 | error = do_mmap2(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT); | 75 | error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT); |
102 | out: | 76 | out: |
103 | return error; | 77 | return error; |
104 | } | 78 | } |