Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14975
b: refs/heads/master
c: 7fc7e2e
h: refs/heads/master
i:
  14973: 61708c6
  14971: ed07d6d
  14967: 95eaaca
  14959: 012496f
  14943: 6ea4db8
  14911: 90f1568
  14847: 92d0216
v: v3
  • Loading branch information
Linus Torvalds committed Dec 12, 2005
1 parent a5ea475 commit fb6151e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 47 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: fb155c1619f056ae9765eed272cd6aba6e1a7399
refs/heads/master: 7fc7e2eeecb599ba719c4c4503100fc8cd6a6920
1 change: 0 additions & 1 deletion trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ extern unsigned int kobjsize(const void *objp);
#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */
#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */
#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */
#define VM_INCOMPLETE 0x02000000 /* Strange partial PFN mapping marker */

#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */
#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
Expand Down
46 changes: 1 addition & 45 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,50 +1227,6 @@ int vm_insert_page(struct vm_area_struct *vma, unsigned long addr, struct page *
}
EXPORT_SYMBOL(vm_insert_page);

/*
* Somebody does a pfn remapping that doesn't actually work as a vma.
*
* Do it as individual pages instead, and warn about it. It's bad form,
* and very inefficient.
*/
static int incomplete_pfn_remap(struct vm_area_struct *vma,
unsigned long start, unsigned long end,
unsigned long pfn, pgprot_t prot)
{
static int warn = 10;
struct page *page;
int retval;

if (!(vma->vm_flags & VM_INCOMPLETE)) {
if (warn) {
warn--;
printk("%s does an incomplete pfn remapping", current->comm);
dump_stack();
}
}
vma->vm_flags |= VM_INCOMPLETE | VM_IO | VM_RESERVED;

if (start < vma->vm_start || end > vma->vm_end)
return -EINVAL;

if (!pfn_valid(pfn))
return -EINVAL;

page = pfn_to_page(pfn);
if (!PageReserved(page))
return -EINVAL;

retval = 0;
while (start < end) {
retval = insert_page(vma->vm_mm, start, page, prot);
if (retval < 0)
break;
start += PAGE_SIZE;
page++;
}
return retval;
}

/*
* maps a range of physical memory into the requested pages. the old
* mappings are removed. any references to nonexistent pages results
Expand Down Expand Up @@ -1365,7 +1321,7 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr,
*/
if (!(vma->vm_flags & VM_SHARED)) {
if (addr != vma->vm_start || end != vma->vm_end)
return incomplete_pfn_remap(vma, addr, end, pfn, prot);
return -EINVAL;
vma->vm_pgoff = pfn;
}

Expand Down

0 comments on commit fb6151e

Please sign in to comment.