{\r
struct vm_area_struct *vma;\r
\r
+ if (result>0) {\r
+ down_read(¤t->mm->mmap_sem);\r
+ for (i = 0; i < result; i++)\r
+ put_page(pages[i]);\r
+ up_read(¤t->mm->mmap_sem);\r
+ }\r
+\r
for(i=0; i<pageCount; i++)\r
{\r
vma = find_vma(current->mm, (Memory + i) << PAGE_SHIFT);\r
pageTable[i] = page_to_phys(pages[i]);\r
}\r
\r
+ down_read(¤t->mm->mmap_sem);\r
+ for (i = 0; i < result; i++)\r
+ put_page(pages[i]);\r
+ up_read(¤t->mm->mmap_sem);\r
+\r
return 0;\r
}\r
while(0);\r
{\r
struct vm_area_struct *vma;\r
\r
+ if (result>0) {\r
+ down_read(¤t->mm->mmap_sem);\r
+ for (i = 0; i < result; i++)\r
+ put_page(pages[i]);\r
+ up_read(¤t->mm->mmap_sem);\r
+ }\r
+\r
for(i=0; i<pageCount; i++)\r
{\r
vma = find_vma(current->mm, (Memory + i) << PAGE_SHIFT);\r
pageTable[i] = page_to_phys(pages[i]);\r
}\r
\r
+ down_read(¤t->mm->mmap_sem);\r
+ for (i = 0; i < result; i++)\r
+ put_page(pages[i]);\r
+ up_read(¤t->mm->mmap_sem);\r
+\r
return 0;\r
}\r
while(0);\r