patch-2.4.3 linux/drivers/char/drm/mga_bufs.c

Next file: linux/drivers/char/drm/r128_bufs.c
Previous file: linux/drivers/char/drm/i810_dma.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.2/linux/drivers/char/drm/mga_bufs.c linux/drivers/char/drm/mga_bufs.c
@@ -549,17 +549,17 @@
 			DRM_DEBUG("map->flags : %x\n", map->flags);
 			DRM_DEBUG("map->handle : %p\n", map->handle);
 			DRM_DEBUG("map->mtrr : %d\n", map->mtrr);
-			down(&current->mm->mmap_sem);
+			down_write(&current->mm->mmap_sem);
 			virtual = do_mmap(filp, 0, map->size, 
 					  PROT_READ|PROT_WRITE,
 					  MAP_SHARED, 
 					  (unsigned long)map->offset);
-			up(&current->mm->mmap_sem);
+			up_write(&current->mm->mmap_sem);
 		} else {
-			down(&current->mm->mmap_sem);
+			down_write(&current->mm->mmap_sem);
 			virtual = do_mmap(filp, 0, dma->byte_count,
 					  PROT_READ|PROT_WRITE, MAP_SHARED, 0);
-			up(&current->mm->mmap_sem);
+			up_write(&current->mm->mmap_sem);
 		}
 		if (virtual > -1024UL) {
 			/* Real error */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)