diff options
| author | Steve French <sfrench@us.ibm.com> | 2006-01-12 17:47:08 -0500 |
|---|---|---|
| committer | Steve French <sfrench@us.ibm.com> | 2006-01-12 17:47:08 -0500 |
| commit | 94bc2be31a01a3055ec94176e595dfe208e92d3b (patch) | |
| tree | ebfbe81c6718a6390bfa1b99c6d228237d818576 /fs/hugetlbfs/inode.c | |
| parent | c32a0b689cb9cc160cfcd19735bbf50bb70c6ef4 (diff) | |
| parent | 58cba4650a7a414eabd2b40cc9d8e45fcdf192d9 (diff) | |
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/hugetlbfs/inode.c')
| -rw-r--r-- | fs/hugetlbfs/inode.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 8c1cef3bb677..ab4c3a9d51b8 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/highmem.h> | 18 | #include <linux/highmem.h> |
| 19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
| 20 | #include <linux/string.h> | 20 | #include <linux/string.h> |
| 21 | #include <linux/capability.h> | ||
| 21 | #include <linux/backing-dev.h> | 22 | #include <linux/backing-dev.h> |
| 22 | #include <linux/hugetlb.h> | 23 | #include <linux/hugetlb.h> |
| 23 | #include <linux/pagevec.h> | 24 | #include <linux/pagevec.h> |
| @@ -100,9 +101,6 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma) | |||
| 100 | loff_t len, vma_len; | 101 | loff_t len, vma_len; |
| 101 | int ret; | 102 | int ret; |
| 102 | 103 | ||
| 103 | if ((vma->vm_flags & (VM_MAYSHARE | VM_WRITE)) == VM_WRITE) | ||
| 104 | return -EINVAL; | ||
| 105 | |||
| 106 | if (vma->vm_pgoff & (HPAGE_SIZE / PAGE_SIZE - 1)) | 104 | if (vma->vm_pgoff & (HPAGE_SIZE / PAGE_SIZE - 1)) |
| 107 | return -EINVAL; | 105 | return -EINVAL; |
| 108 | 106 | ||
| @@ -121,7 +119,7 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma) | |||
| 121 | 119 | ||
| 122 | vma_len = (loff_t)(vma->vm_end - vma->vm_start); | 120 | vma_len = (loff_t)(vma->vm_end - vma->vm_start); |
| 123 | 121 | ||
| 124 | down(&inode->i_sem); | 122 | mutex_lock(&inode->i_mutex); |
| 125 | file_accessed(file); | 123 | file_accessed(file); |
| 126 | vma->vm_flags |= VM_HUGETLB | VM_RESERVED; | 124 | vma->vm_flags |= VM_HUGETLB | VM_RESERVED; |
| 127 | vma->vm_ops = &hugetlb_vm_ops; | 125 | vma->vm_ops = &hugetlb_vm_ops; |
| @@ -136,7 +134,7 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma) | |||
| 136 | if (inode->i_size < len) | 134 | if (inode->i_size < len) |
| 137 | inode->i_size = len; | 135 | inode->i_size = len; |
| 138 | out: | 136 | out: |
| 139 | up(&inode->i_sem); | 137 | mutex_unlock(&inode->i_mutex); |
| 140 | 138 | ||
| 141 | return ret; | 139 | return ret; |
| 142 | } | 140 | } |
