diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-30 20:08:42 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-01 10:37:17 -0400 |
commit | e3fc629d7bb70848fbf479688a66d4e76dff46ac (patch) | |
tree | 96b6d5ffdb1c643fb28807a635e6ca4e24964034 | |
parent | 98de59bfe4b2ff6344d9ad8e5296f80de5dcc5b6 (diff) |
switch aio and shm to do_mmap_pgoff(), make do_mmap() static
after all, 0 bytes and 0 pages is the same thing...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/aio.c | 6 | ||||
-rw-r--r-- | include/linux/mm.h | 2 | ||||
-rw-r--r-- | ipc/shm.c | 2 | ||||
-rw-r--r-- | mm/mmap.c | 4 | ||||
-rw-r--r-- | mm/nommu.c | 4 |
5 files changed, 9 insertions, 9 deletions
@@ -134,9 +134,9 @@ static int aio_setup_ring(struct kioctx *ctx) | |||
134 | info->mmap_size = nr_pages * PAGE_SIZE; | 134 | info->mmap_size = nr_pages * PAGE_SIZE; |
135 | dprintk("attempting mmap of %lu bytes\n", info->mmap_size); | 135 | dprintk("attempting mmap of %lu bytes\n", info->mmap_size); |
136 | down_write(&ctx->mm->mmap_sem); | 136 | down_write(&ctx->mm->mmap_sem); |
137 | info->mmap_base = do_mmap(NULL, 0, info->mmap_size, | 137 | info->mmap_base = do_mmap_pgoff(NULL, 0, info->mmap_size, |
138 | PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, | 138 | PROT_READ|PROT_WRITE, |
139 | 0); | 139 | MAP_ANONYMOUS|MAP_PRIVATE, 0); |
140 | if (IS_ERR((void *)info->mmap_base)) { | 140 | if (IS_ERR((void *)info->mmap_base)) { |
141 | up_write(&ctx->mm->mmap_sem); | 141 | up_write(&ctx->mm->mmap_sem); |
142 | info->mmap_size = 0; | 142 | info->mmap_size = 0; |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 7d5c37f24c63..4189e0d0ac05 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1394,7 +1394,7 @@ extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned lo | |||
1394 | extern unsigned long mmap_region(struct file *file, unsigned long addr, | 1394 | extern unsigned long mmap_region(struct file *file, unsigned long addr, |
1395 | unsigned long len, unsigned long flags, | 1395 | unsigned long len, unsigned long flags, |
1396 | vm_flags_t vm_flags, unsigned long pgoff); | 1396 | vm_flags_t vm_flags, unsigned long pgoff); |
1397 | extern unsigned long do_mmap(struct file *, unsigned long, | 1397 | extern unsigned long do_mmap_pgoff(struct file *, unsigned long, |
1398 | unsigned long, unsigned long, | 1398 | unsigned long, unsigned long, |
1399 | unsigned long, unsigned long); | 1399 | unsigned long, unsigned long); |
1400 | extern int do_munmap(struct mm_struct *, unsigned long, size_t); | 1400 | extern int do_munmap(struct mm_struct *, unsigned long, size_t); |
@@ -1054,7 +1054,7 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr) | |||
1054 | goto invalid; | 1054 | goto invalid; |
1055 | } | 1055 | } |
1056 | 1056 | ||
1057 | user_addr = do_mmap (file, addr, size, prot, flags, 0); | 1057 | user_addr = do_mmap_pgoff(file, addr, size, prot, flags, 0); |
1058 | *raddr = user_addr; | 1058 | *raddr = user_addr; |
1059 | err = 0; | 1059 | err = 0; |
1060 | if (IS_ERR_VALUE(user_addr)) | 1060 | if (IS_ERR_VALUE(user_addr)) |
@@ -971,7 +971,7 @@ static inline unsigned long round_hint_to_min(unsigned long hint) | |||
971 | * The caller must hold down_write(¤t->mm->mmap_sem). | 971 | * The caller must hold down_write(¤t->mm->mmap_sem). |
972 | */ | 972 | */ |
973 | 973 | ||
974 | static unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, | 974 | unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, |
975 | unsigned long len, unsigned long prot, | 975 | unsigned long len, unsigned long prot, |
976 | unsigned long flags, unsigned long pgoff) | 976 | unsigned long flags, unsigned long pgoff) |
977 | { | 977 | { |
@@ -1102,7 +1102,7 @@ static unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, | |||
1102 | return mmap_region(file, addr, len, flags, vm_flags, pgoff); | 1102 | return mmap_region(file, addr, len, flags, vm_flags, pgoff); |
1103 | } | 1103 | } |
1104 | 1104 | ||
1105 | unsigned long do_mmap(struct file *file, unsigned long addr, | 1105 | static unsigned long do_mmap(struct file *file, unsigned long addr, |
1106 | unsigned long len, unsigned long prot, | 1106 | unsigned long len, unsigned long prot, |
1107 | unsigned long flag, unsigned long offset) | 1107 | unsigned long flag, unsigned long offset) |
1108 | { | 1108 | { |
diff --git a/mm/nommu.c b/mm/nommu.c index 8cbfd623b04a..a1792ed2cb1a 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -1232,7 +1232,7 @@ enomem: | |||
1232 | /* | 1232 | /* |
1233 | * handle mapping creation for uClinux | 1233 | * handle mapping creation for uClinux |
1234 | */ | 1234 | */ |
1235 | static unsigned long do_mmap_pgoff(struct file *file, | 1235 | unsigned long do_mmap_pgoff(struct file *file, |
1236 | unsigned long addr, | 1236 | unsigned long addr, |
1237 | unsigned long len, | 1237 | unsigned long len, |
1238 | unsigned long prot, | 1238 | unsigned long prot, |
@@ -1470,7 +1470,7 @@ error_getting_region: | |||
1470 | return -ENOMEM; | 1470 | return -ENOMEM; |
1471 | } | 1471 | } |
1472 | 1472 | ||
1473 | unsigned long do_mmap(struct file *file, unsigned long addr, | 1473 | static unsigned long do_mmap(struct file *file, unsigned long addr, |
1474 | unsigned long len, unsigned long prot, | 1474 | unsigned long len, unsigned long prot, |
1475 | unsigned long flag, unsigned long offset) | 1475 | unsigned long flag, unsigned long offset) |
1476 | { | 1476 | { |