diff options
author | Michael Buesch <mbuesch@freenet.de> | 2006-03-22 03:08:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-22 10:54:02 -0500 |
commit | a7290ee08e434399660ace34427c17696e47c562 (patch) | |
tree | ee7d16b2c946c90450cf22e8bcd91111ca66270f /arch/i386/kernel/sys_i386.c | |
parent | 617d2214ee06c209e5c375c280d50abace8058e1 (diff) |
[PATCH] Uninline sys_mmap common code (reduce binary size)
Remove the inlining of the new vs old mmap system call common code. This
reduces the size of the resulting vmlinux for defconfig as follows:
mb@pc1:~/develop/git/linux-2.6$ size vmlinux.mmap*
text data bss dec hex filename
3303749 521524 186564 4011837 3d373d vmlinux.mmapinline
3303557 521524 186564 4011645 3d367d vmlinux.mmapnoinline
The new sys_mmap2() has also one function call overhead removed, now.
(probably it was already optimized to a jmp before, but anyway...)
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/sys_i386.c')
-rw-r--r-- | arch/i386/kernel/sys_i386.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/arch/i386/kernel/sys_i386.c b/arch/i386/kernel/sys_i386.c index a4a61976ecb9..8fdb1fb17a5f 100644 --- a/arch/i386/kernel/sys_i386.c +++ b/arch/i386/kernel/sys_i386.c | |||
@@ -40,14 +40,13 @@ asmlinkage int sys_pipe(unsigned long __user * fildes) | |||
40 | return error; | 40 | return error; |
41 | } | 41 | } |
42 | 42 | ||
43 | /* common code for old and new mmaps */ | 43 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, |
44 | static inline long do_mmap2( | 44 | unsigned long prot, unsigned long flags, |
45 | unsigned long addr, unsigned long len, | 45 | unsigned long fd, unsigned long pgoff) |
46 | unsigned long prot, unsigned long flags, | ||
47 | unsigned long fd, unsigned long pgoff) | ||
48 | { | 46 | { |
49 | int error = -EBADF; | 47 | int error = -EBADF; |
50 | struct file * file = NULL; | 48 | struct file *file = NULL; |
49 | struct mm_struct *mm = current->mm; | ||
51 | 50 | ||
52 | flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | 51 | flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); |
53 | if (!(flags & MAP_ANONYMOUS)) { | 52 | if (!(flags & MAP_ANONYMOUS)) { |
@@ -56,9 +55,9 @@ static inline long do_mmap2( | |||
56 | goto out; | 55 | goto out; |
57 | } | 56 | } |
58 | 57 | ||
59 | down_write(¤t->mm->mmap_sem); | 58 | down_write(&mm->mmap_sem); |
60 | error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); | 59 | error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); |
61 | up_write(¤t->mm->mmap_sem); | 60 | up_write(&mm->mmap_sem); |
62 | 61 | ||
63 | if (file) | 62 | if (file) |
64 | fput(file); | 63 | fput(file); |
@@ -66,13 +65,6 @@ out: | |||
66 | return error; | 65 | return error; |
67 | } | 66 | } |
68 | 67 | ||
69 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | ||
70 | unsigned long prot, unsigned long flags, | ||
71 | unsigned long fd, unsigned long pgoff) | ||
72 | { | ||
73 | return do_mmap2(addr, len, prot, flags, fd, pgoff); | ||
74 | } | ||
75 | |||
76 | /* | 68 | /* |
77 | * Perform the select(nd, in, out, ex, tv) and mmap() system | 69 | * Perform the select(nd, in, out, ex, tv) and mmap() system |
78 | * calls. Linux/i386 didn't use to be able to handle more than | 70 | * calls. Linux/i386 didn't use to be able to handle more than |
@@ -101,7 +93,8 @@ asmlinkage int old_mmap(struct mmap_arg_struct __user *arg) | |||
101 | if (a.offset & ~PAGE_MASK) | 93 | if (a.offset & ~PAGE_MASK) |
102 | goto out; | 94 | goto out; |
103 | 95 | ||
104 | err = do_mmap2(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT); | 96 | err = sys_mmap2(a.addr, a.len, a.prot, a.flags, |
97 | a.fd, a.offset >> PAGE_SHIFT); | ||
105 | out: | 98 | out: |
106 | return err; | 99 | return err; |
107 | } | 100 | } |