diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-12-14 22:10:10 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-12-14 22:10:10 -0500 |
commit | e0aa51f54faa0659b529143de6c608e76675326f (patch) | |
tree | 22fc566b74bfe6bd612a858ba354818900cdc394 /arch/sh | |
parent | 9f815a1765b0ce766ab1d26ef192d30410f70b2b (diff) | |
parent | 3ea6b3d0e6d0ffd91c0f8cadeb69b7133c038b32 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/sys_sh.c | 28 | ||||
-rw-r--r-- | arch/sh/mm/mmap.c | 3 |
2 files changed, 4 insertions, 27 deletions
diff --git a/arch/sh/kernel/sys_sh.c b/arch/sh/kernel/sys_sh.c index 8aa5d1ceaf14..71399cde03b5 100644 --- a/arch/sh/kernel/sys_sh.c +++ b/arch/sh/kernel/sys_sh.c | |||
@@ -28,37 +28,13 @@ | |||
28 | #include <asm/cacheflush.h> | 28 | #include <asm/cacheflush.h> |
29 | #include <asm/cachectl.h> | 29 | #include <asm/cachectl.h> |
30 | 30 | ||
31 | static inline long | ||
32 | do_mmap2(unsigned long addr, unsigned long len, unsigned long prot, | ||
33 | unsigned long flags, int fd, unsigned long pgoff) | ||
34 | { | ||
35 | int error = -EBADF; | ||
36 | struct file *file = NULL; | ||
37 | |||
38 | flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | ||
39 | if (!(flags & MAP_ANONYMOUS)) { | ||
40 | file = fget(fd); | ||
41 | if (!file) | ||
42 | goto out; | ||
43 | } | ||
44 | |||
45 | down_write(¤t->mm->mmap_sem); | ||
46 | error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); | ||
47 | up_write(¤t->mm->mmap_sem); | ||
48 | |||
49 | if (file) | ||
50 | fput(file); | ||
51 | out: | ||
52 | return error; | ||
53 | } | ||
54 | |||
55 | asmlinkage int old_mmap(unsigned long addr, unsigned long len, | 31 | asmlinkage int old_mmap(unsigned long addr, unsigned long len, |
56 | unsigned long prot, unsigned long flags, | 32 | unsigned long prot, unsigned long flags, |
57 | int fd, unsigned long off) | 33 | int fd, unsigned long off) |
58 | { | 34 | { |
59 | if (off & ~PAGE_MASK) | 35 | if (off & ~PAGE_MASK) |
60 | return -EINVAL; | 36 | return -EINVAL; |
61 | return do_mmap2(addr, len, prot, flags, fd, off>>PAGE_SHIFT); | 37 | return sys_mmap_pgoff(addr, len, prot, flags, fd, off>>PAGE_SHIFT); |
62 | } | 38 | } |
63 | 39 | ||
64 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | 40 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, |
@@ -74,7 +50,7 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | |||
74 | 50 | ||
75 | pgoff >>= PAGE_SHIFT - 12; | 51 | pgoff >>= PAGE_SHIFT - 12; |
76 | 52 | ||
77 | return do_mmap2(addr, len, prot, flags, fd, pgoff); | 53 | return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff); |
78 | } | 54 | } |
79 | 55 | ||
80 | /* | 56 | /* |
diff --git a/arch/sh/mm/mmap.c b/arch/sh/mm/mmap.c index d2984fa42d3d..afeb710ec5c3 100644 --- a/arch/sh/mm/mmap.c +++ b/arch/sh/mm/mmap.c | |||
@@ -54,7 +54,8 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, | |||
54 | /* We do not accept a shared mapping if it would violate | 54 | /* We do not accept a shared mapping if it would violate |
55 | * cache aliasing constraints. | 55 | * cache aliasing constraints. |
56 | */ | 56 | */ |
57 | if ((flags & MAP_SHARED) && (addr & shm_align_mask)) | 57 | if ((flags & MAP_SHARED) && |
58 | ((addr - (pgoff << PAGE_SHIFT)) & shm_align_mask)) | ||
58 | return -EINVAL; | 59 | return -EINVAL; |
59 | return addr; | 60 | return addr; |
60 | } | 61 | } |