Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.4.1-pre11 /mm/memory.c

Filename:/mm/memory.c
Lines Added:9
Lines Deleted:5
Also changed in: (Previous) 2.4.1-pre10  2.4.1-pre9  2.4.1-pre8  2.4.1-pre6  2.4.1-pre7  2.4.1-pre4 
(Following) 2.4.1-pre12  2.4.1  2.4.1-ac1  2.4.1-ac2  2.4.1-ac3  2.4.1-ac4 

Location
[  2.4.1-pre11
  [  mm
     o  memory.c

Patch

diff -u --recursive --new-file v2.4.0/linux/mm/memory.c linux/mm/memory.c
--- v2.4.0/linux/mm/memory.c   Mon Jan  1 10:37:41 2001
+++ linux/mm/memory.c   Sat Jan 27 19:12:35 2001
@@ -207,7 +207,8 @@
          
          src_pte = pte_offset(src_pmd, address);
          dst_pte = pte_offset(dst_pmd, address);
-         
+
+         spin_lock(&src->page_table_lock);         
          do {
             pte_t pte = *src_pte;
             struct page *ptepage;
@@ -240,10 +241,11 @@
 cont_copy_pte_range:      set_pte(dst_pte, pte);
 cont_copy_pte_range_noset:   address += PAGE_SIZE;
             if (address >= end)
-               goto out;
+               goto out_unlock;
             src_pte++;
             dst_pte++;
          } while ((unsigned long)src_pte & PTE_TABLE_MASK);
+         spin_unlock(&src->page_table_lock);
       
 cont_copy_pmd_range:   src_pmd++;
          dst_pmd++;
@@ -252,6 +254,10 @@
 out:
    return 0;
 
+out_unlock:
+   spin_unlock(&src->page_table_lock);
+   return 0;
+
 nomem:
    return -ENOMEM;
 }
@@ -939,7 +945,6 @@
    if (inode->i_size < offset)
       goto do_expand;
    inode->i_size = offset;
-   truncate_inode_pages(mapping, offset);
    spin_lock(&mapping->i_shared_lock);
    if (!mapping->i_mmap && !mapping->i_mmap_shared)
       goto out_unlock;
@@ -954,8 +959,7 @@
 
 out_unlock:
    spin_unlock(&mapping->i_shared_lock);
-   /* this should go into ->truncate */
-   inode->i_size = offset;
+   truncate_inode_pages(mapping, offset);
    if (inode->i_op && inode->i_op->truncate)
       inode->i_op->truncate(inode);
    return;


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.