Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22480
b: refs/heads/master
c: a7290ee
h: refs/heads/master
v: v3
  • Loading branch information
Michael Buesch authored and Linus Torvalds committed Mar 22, 2006
1 parent 52afa3e commit daaab62
Show file tree
Hide file tree
Showing 2 changed files with 10 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: 617d2214ee06c209e5c375c280d50abace8058e1
refs/heads/master: a7290ee08e434399660ace34427c17696e47c562
25 changes: 9 additions & 16 deletions trunk/arch/i386/kernel/sys_i386.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@ asmlinkage int sys_pipe(unsigned long __user * fildes)
return error;
}

/* common code for old and new mmaps */
static inline long do_mmap2(
unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff)
asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff)
{
int error = -EBADF;
struct file * file = NULL;
struct file *file = NULL;
struct mm_struct *mm = current->mm;

flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
if (!(flags & MAP_ANONYMOUS)) {
Expand All @@ -56,23 +55,16 @@ static inline long do_mmap2(
goto out;
}

down_write(&current->mm->mmap_sem);
down_write(&mm->mmap_sem);
error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
up_write(&current->mm->mmap_sem);
up_write(&mm->mmap_sem);

if (file)
fput(file);
out:
return error;
}

asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff)
{
return do_mmap2(addr, len, prot, flags, fd, pgoff);
}

/*
* Perform the select(nd, in, out, ex, tv) and mmap() system
* calls. Linux/i386 didn't use to be able to handle more than
Expand Down Expand Up @@ -101,7 +93,8 @@ asmlinkage int old_mmap(struct mmap_arg_struct __user *arg)
if (a.offset & ~PAGE_MASK)
goto out;

err = do_mmap2(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT);
err = sys_mmap2(a.addr, a.len, a.prot, a.flags,
a.fd, a.offset >> PAGE_SHIFT);
out:
return err;
}
Expand Down

0 comments on commit daaab62

Please sign in to comment.