diff options
-rw-r--r-- | mm/fremap.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/mm/fremap.c b/mm/fremap.c index 37a93f8f3aec..14bd3bf7826e 100644 --- a/mm/fremap.c +++ b/mm/fremap.c | |||
@@ -97,26 +97,28 @@ static int populate_range(struct mm_struct *mm, struct vm_area_struct *vma, | |||
97 | 97 | ||
98 | } | 98 | } |
99 | 99 | ||
100 | /*** | 100 | /** |
101 | * sys_remap_file_pages - remap arbitrary pages of a shared backing store | 101 | * sys_remap_file_pages - remap arbitrary pages of an existing VM_SHARED vma |
102 | * file within an existing vma. | ||
103 | * @start: start of the remapped virtual memory range | 102 | * @start: start of the remapped virtual memory range |
104 | * @size: size of the remapped virtual memory range | 103 | * @size: size of the remapped virtual memory range |
105 | * @prot: new protection bits of the range | 104 | * @prot: new protection bits of the range (see NOTE) |
106 | * @pgoff: to be mapped page of the backing store file | 105 | * @pgoff: to-be-mapped page of the backing store file |
107 | * @flags: 0 or MAP_NONBLOCKED - the later will cause no IO. | 106 | * @flags: 0 or MAP_NONBLOCKED - the later will cause no IO. |
108 | * | 107 | * |
109 | * this syscall works purely via pagetables, so it's the most efficient | 108 | * sys_remap_file_pages remaps arbitrary pages of an existing VM_SHARED vma |
109 | * (shared backing store file). | ||
110 | * | ||
111 | * This syscall works purely via pagetables, so it's the most efficient | ||
110 | * way to map the same (large) file into a given virtual window. Unlike | 112 | * way to map the same (large) file into a given virtual window. Unlike |
111 | * mmap()/mremap() it does not create any new vmas. The new mappings are | 113 | * mmap()/mremap() it does not create any new vmas. The new mappings are |
112 | * also safe across swapout. | 114 | * also safe across swapout. |
113 | * | 115 | * |
114 | * NOTE: the 'prot' parameter right now is ignored, and the vma's default | 116 | * NOTE: the 'prot' parameter right now is ignored (but must be zero), |
115 | * protection is used. Arbitrary protections might be implemented in the | 117 | * and the vma's default protection is used. Arbitrary protections |
116 | * future. | 118 | * might be implemented in the future. |
117 | */ | 119 | */ |
118 | asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, | 120 | asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, |
119 | unsigned long __prot, unsigned long pgoff, unsigned long flags) | 121 | unsigned long prot, unsigned long pgoff, unsigned long flags) |
120 | { | 122 | { |
121 | struct mm_struct *mm = current->mm; | 123 | struct mm_struct *mm = current->mm; |
122 | struct address_space *mapping; | 124 | struct address_space *mapping; |
@@ -125,7 +127,7 @@ asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, | |||
125 | int err = -EINVAL; | 127 | int err = -EINVAL; |
126 | int has_write_lock = 0; | 128 | int has_write_lock = 0; |
127 | 129 | ||
128 | if (__prot) | 130 | if (prot) |
129 | return err; | 131 | return err; |
130 | /* | 132 | /* |
131 | * Sanitize the syscall parameters: | 133 | * Sanitize the syscall parameters: |