patch-2.1.43 linux/mm/mprotect.c

Next file: linux/mm/mremap.c
Previous file: linux/mm/mmap.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.42/linux/mm/mprotect.c linux/mm/mprotect.c
@@ -111,7 +111,7 @@
 	n->vm_flags = newflags;
 	n->vm_page_prot = prot;
 	if (n->vm_inode)
-		n->vm_inode->i_count++;
+		atomic_inc(&n->vm_inode->i_count);
 	if (n->vm_ops && n->vm_ops->open)
 		n->vm_ops->open(n);
 	insert_vm_struct(current->mm, n);
@@ -134,7 +134,7 @@
 	n->vm_flags = newflags;
 	n->vm_page_prot = prot;
 	if (n->vm_inode)
-		n->vm_inode->i_count++;
+		atomic_inc(&n->vm_inode->i_count);
 	if (n->vm_ops && n->vm_ops->open)
 		n->vm_ops->open(n);
 	insert_vm_struct(current->mm, n);
@@ -166,7 +166,7 @@
 	vma->vm_flags = newflags;
 	vma->vm_page_prot = prot;
 	if (vma->vm_inode)
-		vma->vm_inode->i_count += 2;
+		atomic_add(2, &vma->vm_inode->i_count);
 	if (vma->vm_ops && vma->vm_ops->open) {
 		vma->vm_ops->open(left);
 		vma->vm_ops->open(right);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov