Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19017
b: refs/heads/master
c: 92ff2ec
h: refs/heads/master
i:
  19015: 9d34c47
v: v3
  • Loading branch information
Jes Sorensen authored and Tony Luck committed Jan 19, 2006
1 parent 0436ab7 commit 7a6af23
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4b16bfbf8f8013fefb49592d030ff87651ab48cb
refs/heads/master: 92ff2ecd0deddc4c5fb2140d5861d0ddd50e9e57
28 changes: 12 additions & 16 deletions trunk/arch/ia64/ia32/sys_ia32.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
#include <linux/compat.h>
#include <linux/vfs.h>
#include <linux/mman.h>
#include <linux/mutex.h>

#include <asm/intrinsics.h>
#include <asm/semaphore.h>
#include <asm/types.h>
#include <asm/uaccess.h>
#include <asm/unistd.h>
Expand Down Expand Up @@ -86,7 +86,7 @@
* while doing so.
*/
/* XXX make per-mm: */
static DECLARE_MUTEX(ia32_mmap_sem);
static DEFINE_MUTEX(ia32_mmap_mutex);

asmlinkage long
sys32_execve (char __user *name, compat_uptr_t __user *argv, compat_uptr_t __user *envp,
Expand Down Expand Up @@ -895,11 +895,11 @@ ia32_do_mmap (struct file *file, unsigned long addr, unsigned long len, int prot
prot = get_prot32(prot);

#if PAGE_SHIFT > IA32_PAGE_SHIFT
down(&ia32_mmap_sem);
mutex_lock(&ia32_mmap_mutex);
{
addr = emulate_mmap(file, addr, len, prot, flags, offset);
}
up(&ia32_mmap_sem);
mutex_unlock(&ia32_mmap_mutex);
#else
down_write(&current->mm->mmap_sem);
{
Expand Down Expand Up @@ -1000,11 +1000,9 @@ sys32_munmap (unsigned int start, unsigned int len)
if (start >= end)
return 0;

down(&ia32_mmap_sem);
{
ret = sys_munmap(start, end - start);
}
up(&ia32_mmap_sem);
mutex_lock(&ia32_mmap_mutex);
ret = sys_munmap(start, end - start);
mutex_unlock(&ia32_mmap_mutex);
#endif
return ret;
}
Expand Down Expand Up @@ -1056,7 +1054,7 @@ sys32_mprotect (unsigned int start, unsigned int len, int prot)
if (retval < 0)
return retval;

down(&ia32_mmap_sem);
mutex_lock(&ia32_mmap_mutex);
{
if (offset_in_page(start)) {
/* start address is 4KB aligned but not page aligned. */
Expand All @@ -1080,7 +1078,7 @@ sys32_mprotect (unsigned int start, unsigned int len, int prot)
retval = sys_mprotect(start, end - start, prot);
}
out:
up(&ia32_mmap_sem);
mutex_unlock(&ia32_mmap_mutex);
return retval;
#endif
}
Expand Down Expand Up @@ -1124,11 +1122,9 @@ sys32_mremap (unsigned int addr, unsigned int old_len, unsigned int new_len,
old_len = PAGE_ALIGN(old_end) - addr;
new_len = PAGE_ALIGN(new_end) - addr;

down(&ia32_mmap_sem);
{
ret = sys_mremap(addr, old_len, new_len, flags, new_addr);
}
up(&ia32_mmap_sem);
mutex_lock(&ia32_mmap_mutex);
ret = sys_mremap(addr, old_len, new_len, flags, new_addr);
mutex_unlock(&ia32_mmap_mutex);

if ((ret >= 0) && (old_len < new_len)) {
/* mremap expanded successfully */
Expand Down

0 comments on commit 7a6af23

Please sign in to comment.