diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-11-30 17:37:04 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-11 06:44:29 -0500 |
commit | f8b7256096a20436f6d0926747e3ac3d64c81d24 (patch) | |
tree | 18bcabd1de263bd2d0f8d6b763bde8b037716c5c /arch/blackfin/kernel | |
parent | 0067bd8a55862ac9dd212bd1c4f6f5bff1ca1301 (diff) |
Unify sys_mmap*
New helper - sys_mmap_pgoff(); switch syscalls to using it.
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r-- | arch/blackfin/kernel/sys_bfin.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/arch/blackfin/kernel/sys_bfin.c b/arch/blackfin/kernel/sys_bfin.c index afcef129d4e8..2e7f8e10bf87 100644 --- a/arch/blackfin/kernel/sys_bfin.c +++ b/arch/blackfin/kernel/sys_bfin.c | |||
@@ -22,39 +22,6 @@ | |||
22 | #include <asm/cacheflush.h> | 22 | #include <asm/cacheflush.h> |
23 | #include <asm/dma.h> | 23 | #include <asm/dma.h> |
24 | 24 | ||
25 | /* common code for old and new mmaps */ | ||
26 | static inline long | ||
27 | do_mmap2(unsigned long addr, unsigned long len, | ||
28 | unsigned long prot, unsigned long flags, | ||
29 | unsigned long fd, unsigned long pgoff) | ||
30 | { | ||
31 | int error = -EBADF; | ||
32 | struct file *file = NULL; | ||
33 | |||
34 | flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | ||
35 | if (!(flags & MAP_ANONYMOUS)) { | ||
36 | file = fget(fd); | ||
37 | if (!file) | ||
38 | goto out; | ||
39 | } | ||
40 | |||
41 | down_write(¤t->mm->mmap_sem); | ||
42 | error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); | ||
43 | up_write(¤t->mm->mmap_sem); | ||
44 | |||
45 | if (file) | ||
46 | fput(file); | ||
47 | out: | ||
48 | return error; | ||
49 | } | ||
50 | |||
51 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | ||
52 | unsigned long prot, unsigned long flags, | ||
53 | unsigned long fd, unsigned long pgoff) | ||
54 | { | ||
55 | return do_mmap2(addr, len, prot, flags, fd, pgoff); | ||
56 | } | ||
57 | |||
58 | asmlinkage void *sys_sram_alloc(size_t size, unsigned long flags) | 25 | asmlinkage void *sys_sram_alloc(size_t size, unsigned long flags) |
59 | { | 26 | { |
60 | return sram_alloc_with_lsl(size, flags); | 27 | return sram_alloc_with_lsl(size, flags); |